/* * Copyright (c) 2017, Texas Instruments Incorporated * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of Texas Instruments Incorporated nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * */ var ctt_registers = [ 0x44df0000, 0x44df0004, 0x44df0008, 0x44df000c, 0x44df0010, 0x44df0300, 0x44df0304, 0x44df0314, 0x44df0324, 0x44df0400, 0x44df0404, 0x44df0410, 0x44df0414, 0x44df0424, 0x44df0548, 0x44df0648, 0x44df0700, 0x44df0704, 0x44df0724, 0x44df0800, 0x44df0804, 0x44df0810, 0x44df0814, 0x44df0824, 0x44df082c, 0x44df0834, 0x44df083c, 0x44df0844, 0x44df084c, 0x44df0854, 0x44df085c, 0x44df0864, 0x44df086c, 0x44df0874, 0x44df087c, 0x44df0884, 0x44df088c, 0x44df0894, 0x44df089c, 0x44df08a4, 0x44df08ac, 0x44df0a24, 0x44df0a2c, 0x44df0a34, 0x44df0a3c, 0x44df0a44, 0x44df0a4c, 0x44df0a5c, 0x44df0a64, 0x44df0a6c, 0x44df0b24, 0x44df0c24, 0x44df0c2c, 0x44df0c34, 0x44df0c3c, 0x44df0c44, 0x44df0c4c, 0x44df0c54, 0x44df0c5c, 0x44df0c64, 0x44df0c6c, 0x44df0c74, 0x44df0c7c, 0x44df0c84, 0x44df0c8c, 0x44df0c94, 0x44df0c9c, 0x44df0ca4, 0x44df0cac, 0x44df0cb4, 0x44df0cbc, 0x44df0cc4, 0x44df0ccc, 0x44df0cd4, 0x44df0ce4, 0x44df0cec, 0x44df0cf4, 0x44df0d04, 0x44df0d0c, 0x44df0d14, 0x44df0d1c, 0x44df0d24, 0x44df0d2c, 0x44df0d34, 0x44df0d3c, 0x44df0d44, 0x44df0d4c, 0x44df0d54, 0x44df0d5c, 0x44df0d64, 0x44df0d6c, 0x44df0d74, 0x44df0d7c, 0x44df0d84, 0x44df0d8c, 0x44df0d94, 0x44df0d9c, 0x44df0da4, 0x44df0dac, 0x44df0db4, 0x44df0dbc, 0x44df0dc4, 0x44df0f24, 0x44df0f2c, 0x44df0f34, 0x44df0f3c, 0x44df1024, 0x44df1224, 0x44df1324, 0x44df1424, 0x44df2020, 0x44df2024, 0x44df2034, 0x44df2134, 0x44df2234, 0x44df223c, 0x44df2244, 0x44df2334, 0x44df233c, 0x44df2344, 0x44df234c, 0x44df2354, 0x44df235c, 0x44df2364, 0x44df236c, 0x44df237c, 0x44df2800, 0x44df2820, 0x44df2900, 0x44df2920, 0x44df2a00, 0x44df2a20, 0x44df2a28, 0x44df2a30, 0x44df2a38, 0x44df2a40, 0x44df2a48, 0x44df2b00, 0x44df2b20, 0x44df2b28, 0x44df2b30, 0x44df2b38, 0x44df2b40, 0x44df2b48, 0x44df2b50, 0x44df2b58, 0x44df2b60, 0x44df2b68, 0x44df2d20, 0x44df2d24, 0x44df2d2c, 0x44df2d38, 0x44df2d3c, 0x44df2d40, 0x44df2d48, 0x44df2d4c, 0x44df2d60, 0x44df2d64, 0x44df2d6c, 0x44df2d70, 0x44df2d88, 0x44df2d8c, 0x44df2da0, 0x44df2da4, 0x44df2dac, 0x44df2db0, 0x44df2db8, 0x44df2dc8, 0x44df2dcc, 0x44df2de0, 0x44df2de4, 0x44df2dec, 0x44df2df0, 0x44df2e04, 0x44df2e08, 0x44df2e0c, 0x44df2e14, 0x44df2e20, 0x44df2e24, 0x44df2e2c, 0x44df2e30, 0x44df2e48, 0x44df2e4c, 0x44df2e60, 0x44df2e64, 0x44df2e6c, 0x44df2e70, 0x44df2e84, 0x44df2e88, 0x44df2e8c, 0x44df2fa0, 0x44df2fa4, 0x44df4000, 0x44df4004, 0x44df4008, 0x44df400c, 0x44df4010, 0x44df4014, 0x44df4018, 0x44df401c, 0x44df4020, 0x44df4024, 0x44df4028, 0x44df4030, 0x44df4100, 0x44df4104, 0x44df4108, 0x44df4200, 0x44df4204, 0x44df4208, 0x44df420c, 0x44df4210, 0x44df4214, 0x44df4218, 0x44df421c, 0x44df4220, 0x44df4224, 0x44df4228, 0x44df422c, 0x44df4230, 0x44df4234, 0x44df4238, 0x44df423c, 0x44df4240, 0x44df4244, 0x44df4248, 0x44df424c, 0x44df4250, 0x44df4254, 0x44df4258, 0x44df425c, 0x44df4260, 0x44df8300, 0x44df8320, 0x44df8400, 0x44df8420, 0x44df8500, 0x44df8520, 0x44df8600, 0x44df8620, 0x44df8700, 0x44df8720, 0x44df8800, 0x44df8820, 0x44df8828, 0x44df8830, 0x44df8838, 0x44df8840, 0x44df8848, 0x44df8850, 0x44df8858, 0x44df8860, 0x44df8868, 0x44df8870, 0x44df8878, 0x44df8880, 0x44df8888, 0x44df8890, 0x44df8898, 0x44df88a0, 0x44df88a8, 0x44df8a00, 0x44df8a20, 0x44df8a28, 0x44df8a30, 0x44df8a38, 0x44df8a40, 0x44df8a48, 0x44df8a58, 0x44df8a60, 0x44df8a68, 0x44df8b00, 0x44df8b20, 0x44df8c00, 0x44df8c20, 0x44df8c28, 0x44df8c30, 0x44df8c38, 0x44df8c40, 0x44df8c48, 0x44df8c50, 0x44df8c58, 0x44df8c60, 0x44df8c68, 0x44df8c70, 0x44df8c78, 0x44df8c80, 0x44df8c88, 0x44df8c90, 0x44df8c98, 0x44df8ca0, 0x44df8ca8, 0x44df8cb0, 0x44df8cb8, 0x44df8cc0, 0x44df8cc8, 0x44df8cd0, 0x44df8ce0, 0x44df8ce8, 0x44df8cf0, 0x44df8d00, 0x44df8d08, 0x44df8d10, 0x44df8d18, 0x44df8d20, 0x44df8d28, 0x44df8d30, 0x44df8d38, 0x44df8d40, 0x44df8d48, 0x44df8d50, 0x44df8d58, 0x44df8d60, 0x44df8d68, 0x44df8d70, 0x44df8d78, 0x44df8d80, 0x44df8d88, 0x44df8d90, 0x44df8d98, 0x44df8da0, 0x44df8da8, 0x44df8db0, 0x44df8db8, 0x44df8dc0, 0x44df8f00, 0x44df8f20, 0x44df8f28, 0x44df8f30, 0x44df8f38, 0x44df9000, 0x44df9020, 0x44df9200, 0x44df9220, 0x44df9300, 0x44df9320, 0x44df9400, 0x44df9420, 0x44e10040, 0x44e101bc, 0x44e10444, 0x44e3e054]; debugSessionDAP = ds.openSession("*","CS_DAP_M3"); debugSessionDAP.target.connect(); // Check connection by reading a location known to be non-zero (PRCM_CM_WKUP_DBGSS_CLKCTRL) value = debugSessionDAP.memory.readWord(0,0x44df2820,false); if (value == 0) { // Use DebugSS instead debugSessionDAP.target.disconnect(); debugSessionDAP = ds.openSession("*","CS_DAP_DebugSS"); debugSessionDAP.target.connect(); value = debugSessionDAP.memory.readWord(0,0x44df2820,false); if (value == 0) { print("ERROR: Trouble reading sane values from memory."); print("PRCM_CM_WKUP_DBGSS_CLKCTRL = 0x" + d2h(value)); } } //Build a filename that includes date/time var today = new Date(); var year4digit = today.getFullYear(); var month2digit = ("0" + (today.getMonth()+1)).slice(-2); var day2digit = ("0" + today.getDate()).slice(-2); var hour2digit = ("0" + today.getHours()).slice(-2); var minutes2digit = ("0" + today.getMinutes()).slice(-2); var seconds2digit = ("0" + today.getSeconds()).slice(-2); var filename_date = '_' + year4digit + '-' + month2digit + '-' + day2digit + '_' + hour2digit + minutes2digit + seconds2digit; var userHomeFolder = System.getProperty("user.home"); var filename = userHomeFolder + '/Desktop/' + 'am43xx-ctt' + filename_date + '.rd1'; file = new java.io.FileWriter(filename); file.write("DeviceName AM43xx_SR1.x\n"); // helper function to create 8-digit hex numbers in ascii format function d2h(d) {return ("00000000" + (+d).toString(16)).slice(-8);} // read CTT data from physical addresses for(i=0; i Expected if rtc_porz is grounded.\n"); } } print("Data collection complete."); file.close(); debugSessionDAP.target.disconnect(); print("Created file " + filename);