Hello All,
I am facing an issue when I try to load a program (*.out) using dss.bat and javascript on M4_0 on TDA3MV boards which are brand new.
The error log is as below
ERROR; 05.03.2020 10:16:50; SEVERE: Cortex_M4_IPU1_C0: File Loader: Verification failed: Values at address 0x00000002 do not match Please verify target memory and memory map.
ERROR; 05.03.2020 10:16:50; SEVERE: Cortex_M4_IPU1_C0: GEL: File: C:\Projecte\SOC_Flashing\flashDirect\flashIt_m4_0_micron.out: a data verification error occurred, file load failed.
However, when I use CCS, there is no issue (no data verification error) on loading the program.
I have attached the GELand target configuration files and the JS file used to load the program using dss.bat file.
Using the below suggestions also did not help.
1. GEL_MapOn() and GEL_MapReset()
2. Adding XINTF_Enable() in onReset() and onPreConnect()
Can you please let me know why this issue is observed only on virgin (brand new) TDA3MV platform?
// Import the DSS packages into our namespace importPackage(Packages.com.ti.debug.engine.scripting); importPackage(Packages.com.ti.ccstudio.scripting.environment); importPackage(Packages.java.lang); importPackage(java.io); importPackage(java.lang); var targetConfig = arguments[0]; var flashDirectBin = arguments[1]; var flashAction = arguments[2]; var binaryToFlash = arguments[3]; var micronFlash = arguments[4]; var flashActionAddr = 0x80000000; var fileSizeAddr = 0x80000200; var binaryAddr = 0x87700000; var cores = new Array(); var m4_0 = new Object(); m4_0.name = "m4_0"; m4_0.binary = flashDirectBin; m4_0.sessionName = "Cortex_M4_IPU1_C0"; cores.push(m4_0); var ds; var debugServer; var scriptEnv; // check if this script runs inside CCS var isCCS = (ds !== undefined); if (isCCS) { print("This script is not made to run in CCS"); } else { // create a script environment scriptEnv = ScriptingEnvironment.instance(); // get the debug server and start a debug session debugServer = scriptEnv.getServer("DebugServer.1"); debugServer.setConfig(targetConfig); print("target config: " + targetConfig); print("flashDirect binary: " + flashDirectBin); print("flash action: " + flashAction); if(flashAction == "flash") { print("binary to flash: " + binaryToFlash); var btf = File(binaryToFlash); var fileSize = btf.length(); print("file size: " + fileSize); } // invoke ccsFlasher ccsFlash(); // connect, reset, load launch(); // write the flash action to the target for(var i = 0; i < flashAction.length; i++) { var asciiNum = flashAction[i].charCodeAt(0); try { cores[0].session.memory.writeData(0, flashActionAddr+i, asciiNum, 8); // write a zero to end the string if(i == flashAction.length-1) cores[0].session.memory.writeData(0, flashActionAddr+i+1, 0, 8); } catch(err) { print("Problems writing flash action: " + err); } } // write the file size and the binary to flash to the target if(flashAction == "flash") { try { cores[0].session.memory.writeData(0, fileSizeAddr, fileSize, 32); } catch(err) { print("Problems writing file size: " + err); } try { cores[0].session.memory.loadRaw(0, binaryAddr, binaryToFlash, 32, false); } catch(err) { print("Problems writing flash action: " + err); } } runTargets(); } function ccsFlash() { print("Resetting CCS core with flasher"); cores[0].session = openSession(cores[0]); connectTarget(cores[0]); resetTarget(cores[0]); print("Loading CCS "); cores[0].session.memory.loadProgram(micronFlash); cores[0].session.target.runAsynch(); resetTarget(cores[0]); } function launch() { print("Launching"); connectTargets(); resetTargets(); loadTargets(); } function openSession(core) { return debugServer.openSession( ".*" + core.sessionName ); } function openSessions() { for(var i = 0; i < cores.length; i++) { cores[i].session = openSession(cores[i]); } } function haltTarget(core) { openSession(core); scriptEnv.setScriptTimeout(5000); if(core.session.target.isConnected()) { try { core.session.target.halt(); } catch (err) { print("Problems while halting " + core.name + ": " + err); } } scriptEnv.setScriptTimeout(-1); } function haltTargets() { for(var i = 0; i < cores.length; i++) { haltTarget(cores[i]); } } function connectTarget(core) { print("Connecting to " + core.name); openSession(core); if(!core.session.target.isConnected()) { if(typeof core.preConnectApi !== "undefined") { scriptEnv.setScriptTimeout(30000); try { print("Running pre connect GEL function: " + core.preConnectApi); cores[0].session.expression.evaluate(core.preConnectApi); } catch (err) { print("Problems while running pre connect GEL function " + preConnectApi + " on core " + cores[0].name + ". Error: " + err); } scriptEnv.setScriptTimeout(-1); } core.session.target.connect(); if(typeof core.postConnectApi !== "undefined") { scriptEnv.setScriptTimeout(30000); try { print("Running post connect GEL function: " + core.postConnectApi); core.session.expression.evaluate(core.postConnectApi); } catch (err) { print("Problems while running post connect GEL function " + postConnectApi + " on core " + core.name + ". Error: " + err); } scriptEnv.setScriptTimeout(-1); } } } function connectTargets(){ openSessions(); haltTargets(); for(var i = 0; i < cores.length; i++) { connectTarget(cores[i]); } } function resetTarget(core) { print("Resetting " + core.name); openSession(core); scriptEnv.setScriptTimeout(5000); if(core.session.target.isConnected()) { try { core.session.target.reset(); } catch (err) { print("Problems while resetting " + core.name + ": " + err); } } scriptEnv.setScriptTimeout(-1); } function resetTargets() { for(var i = 0; i < cores.length; i++) { resetTarget(cores[i]); } } function loadTarget0() { loadTarget(cores[0]); } function loadTarget1() { loadTarget(cores[1]); } function loadTarget2() { loadTarget(cores[2]); } function loadTarget3() { loadTarget(cores[3]); } function loadTarget4() { loadTarget(cores[4]); } function loadTarget5() { loadTarget(cores[5]); } function loadTarget6() { loadTarget(cores[6]); } function loadTarget7() { loadTarget(cores[7]); } function loadTarget(core){ if(typeof core.binary !== "undefined") { print("Loading " + core.name + " with " + core.binary); openSession(core); try { core.session.memory.loadProgram(core.binary); } catch (err) { print("Problems while loading " + core.name + ": " + err); } } } function loadTargets() { for(var i = 0; i < cores.length; i++) { loadTarget(cores[i]); } } function runTargets() { print("Running targets"); var dsArray = new Array(); for(var i = 0; i < cores.length; i++) { cores[i].session.target.runAsynch(); } }