/* * 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 EMIF0_SDRAM_BASE_ADDR = 0x80000000; var SDRAM_LEN = 10*1024; var SDRAM_END_ADDR = EMIF0_SDRAM_BASE_ADDR + SDRAM_LEN; debugSessionDAP = ds.openSession("*","CS_DAP_DebugSS"); 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-dump-mem' + filename_date + '.rd1'; file = new java.io.FileWriter(filename); //file.write("DeviceName AM335x1.0\n"); // helper function to create 8-digit hex numbers in ascii format function d2h(d) {return ("00000000" + (+d).toString(16)).slice(-8);} print("BEG:" + EMIF0_SDRAM_BASE_ADDR); print("END:" + SDRAM_END_ADDR); // read CTT data from physical addresses for(i=EMIF0_SDRAM_BASE_ADDR; i