/* * Copyright (c) 2006-2014, 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 = [ 0x44e00000, 0x44e00004, 0x44e00008, 0x44e0000c, 0x44e00010, 0x44e00014, 0x44e00018, 0x44e0001c, 0x44e00020, 0x44e00024, 0x44e00028, 0x44e0002c, 0x44e00030, 0x44e00034, 0x44e00038, 0x44e0003c, 0x44e00040, 0x44e00044, 0x44e00048, 0x44e0004c, 0x44e00050, 0x44e00054, 0x44e00058, 0x44e00060, 0x44e00064, 0x44e00068, 0x44e0006c, 0x44e00070, 0x44e00074, 0x44e00078, 0x44e0007c, 0x44e00080, 0x44e00084, 0x44e00088, 0x44e0008c, 0x44e00090, 0x44e00094, 0x44e00098, 0x44e0009c, 0x44e000a0, 0x44e000a4, 0x44e000a8, 0x44e000ac, 0x44e000b0, 0x44e000b4, 0x44e000b8, 0x44e000bc, 0x44e000c0, 0x44e000c4, 0x44e000c8, 0x44e000cc, 0x44e000d0, 0x44e000d4, 0x44e000d8, 0x44e000dc, 0x44e000e0, 0x44e000e4, 0x44e000e8, 0x44e000ec, 0x44e000f0, 0x44e000f4, 0x44e000f8, 0x44e000fc, 0x44e00100, 0x44e00104, 0x44e0010c, 0x44e00110, 0x44e0011c, 0x44e00120, 0x44e00124, 0x44e00128, 0x44e0012c, 0x44e00130, 0x44e00134, 0x44e00138, 0x44e0013c, 0x44e00140, 0x44e00144, 0x44e00148, 0x44e0014c, 0x44e00150, 0x44e00400, 0x44e00404, 0x44e00408, 0x44e0040c, 0x44e00410, 0x44e00414, 0x44e00418, 0x44e0041c, 0x44e00420, 0x44e00424, 0x44e00428, 0x44e0042c, 0x44e00430, 0x44e00434, 0x44e00438, 0x44e0043c, 0x44e00440, 0x44e00444, 0x44e00448, 0x44e0044c, 0x44e00450, 0x44e00454, 0x44e00458, 0x44e0045c, 0x44e00460, 0x44e00464, 0x44e00468, 0x44e0046c, 0x44e00470, 0x44e00474, 0x44e00478, 0x44e0047c, 0x44e00480, 0x44e00484, 0x44e00488, 0x44e0048c, 0x44e00490, 0x44e00494, 0x44e00498, 0x44e0049c, 0x44e004a0, 0x44e004a4, 0x44e004a8, 0x44e004ac, 0x44e004b0, 0x44e004b4, 0x44e004b8, 0x44e004bc, 0x44e004c0, 0x44e004c4, 0x44e004c8, 0x44e004cc, 0x44e004d0, 0x44e004d4, 0x44e004d8, 0x44e00504, 0x44e00508, 0x44e0050c, 0x44e00510, 0x44e00514, 0x44e00518, 0x44e0051c, 0x44e00520, 0x44e00528, 0x44e0052c, 0x44e00530, 0x44e00534, 0x44e00538, 0x44e0053c, 0x44e00600, 0x44e00604, 0x44e00700, 0x44e00800, 0x44e00804, 0x44e00900, 0x44e00904, 0x44e00908, 0x44e0090c, 0x44e00910, 0x44e00914, 0x44e00a00, 0x44e00a20, 0x44e00b00, 0x44e00b04, 0x44e00b08, 0x44e00b0c, 0x44e00b10, 0x44e00c00, 0x44e00c04, 0x44e00c08, 0x44e00c0c, 0x44e00d00, 0x44e00d04, 0x44e00d08, 0x44e00d0c, 0x44e00e00, 0x44e00e04, 0x44e00e08, 0x44e00f00, 0x44e00f04, 0x44e00f08, 0x44e00f0c, 0x44e00f10, 0x44e00f14, 0x44e00f18, 0x44e00f1c, 0x44e01000, 0x44e01004, 0x44e01100, 0x44e01104, 0x44e01110, 0x44e01114, 0x44e01200, 0x44e01204, 0x44e10040]; debugSessionDAP = ds.openSession("*","CS_DAP_M3"); debugSessionDAP.target.connect(); //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/' + 'am335x-ctt' + filename_date + '.rd1'; file = new java.io.FileWriter(filename); file.write("DeviceName AM335x_SR2.x_SR1.0\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