Other Parts Discussed in Thread: CCSTUDIO,
Tool/software: Code Composer Studio
Hello,
We are trying to debug our project using the two cores, when we start our project with the debugger, it starts our system in a different way than when it does without the J-Tag, but we can solve it by making a group with the 2 CPUs, RESET (Group), RESTART (Group), and RESUME, and with this our system works correctly.
It is not a problem to do this while debugging, the problem is when we are instrumentalizing the code to measure coverage with VectorCast Cover, we need to collect the debugger data, for this VectorCast we provide scripts that are almost examples of those that IT offers to access to the DSS, but of course we do the load () the runAsynch () and other commands, but we are not able to replicate what we do with the debugger in CCS (Reset-> Restart-> Resume).
We do not know what more tests to do and we need to have this tool working. I attach the JS code that runs in the DSS, if you can help.
in this script we flash and start the debugger but the DSP dont work correctly.
When the script finish the system restart, and all work perfectly
// Import the DSS packages into our namespace to save on typing
importPackage (Packages.com.ti.debug.engine.scripting)
importPackage (Packages.com.ti.ccstudio.scripting.environment)
importPackage (Packages.java.lang)
var DEBUG = true;
function sleep (milliseconds) {
var start = new Date (). getTime ();
var MAX_TIME = 1e16
for (var i = 0; i <MAX_TIME; i ++) {
if ((new Date (). getTime () - start)> milliseconds) {
break;
}
}
}
print ("dumpmemory");
// Create our scripting environment object - which is the main entry point into any script and
// the factory for creating other Scriptable ervers and Sessions
var script = ScriptingEnvironment.instance ()
// Get the Debug Server and start a Debug Session
debugServer = script.getServer ("DebugServer.1")
debugServer.setConfig (arguments [0] + "\\ code \\ projects \\ v4 \\ v4_cpu01 \\ ccs7 \\ targetConfigs \\ TMS320F28377D.ccxml");
if (DEBUG == true)
{
print ("Trying to open Debug Server Session")
}
// // debugSession_core_2 = debugServer.openSession (". * C28. * CPU1")
debugSession_core_1 = debugServer.openSession ("Texas Instruments XDS2xx USB Debug Probe \ / C28xx_CPU1")
debugSession_core_2 = debugServer.openSession ("Texas Instruments XDS2xx USB Debug Probe \ / C28xx_CPU2")
if (DEBUG == true)
{
print ("Debug Server Session Opened")
}
debugSession_core_1.target.connect ();
debugSession_core_2.target.connect ();
debugSession_core_1.memory.loadProgram (arguments [0] + "\\ code \\ projects \\ v4 \\ v4_cpu01 \\ ccs7 \\ Debug \\ veronte4-cpu1.out");
if (DEBUG == true)
{
print ("Loaded program Core 1!")
}
debugSession_core_2.memory.loadProgram (arguments [0] + "\\ code \\ projects \\ v4 \\ v4_cpu02 \\ ccs7 \\ Debug \\ veronte4-cpu2.out");
if (DEBUG == true)
{
print ("Loaded program Core 2!")
}
print ("loaded?");
// Run the program
var dsArray = new Array ();
dsArray [0] = debugSession_core_1;
dsArray [1] = debugSession_core_2;
debugServer.simultaneous.runAsynch (dsArray);
print ("running? - waiting for keyboard");
var input = new java.io.BufferedReader (new java.io.InputStreamReader (java.lang.System ['in']));
var keyboardinput = input.readLine ();
var nPage = debugSession_core_1.memory.getPageCount ();
var Page = debugSession_core_1.memory.getPage (nPage);
// Change timeout from the default (infinite) to 15 seconds
script.setScriptTimeout (15000);
try
{
print ("maybe already running");
// Get Address of vcast_output_buffer
var bufAddr = 0x524; // debugSession_core_2.symbol.getAddress ("vcast_unit_stmt_bytes_3");
print ("got bufAddr");
// Get value of vcastSingleLineOfOutput_Length
var bufLen = 15; // debugSession_core_2.expression.evaluate ("vcast_ascii_coverage_data_pos");
debugSession_core_1.target.halt ();
print ("halt");
// saveRaw (Page, bufAddr, "vcast_unit_stmt_bytes_1.bin", bufLen, 8, false);
// saveData (bufAddr, Page, "vcast_unit_stmt_bytes_1.bin", bufLen, Memory.IOFormat.HEX, true);
#TOKEN_VCAST_C_OPTIONS
print ("Read ram");
//debugSession_core_2.target.restart ();
// print ("run");
}
catch (ex)
{
print ("Exception");
}
// All done
print ("Disconnecting");
debugSession_core_2.target.disconnect ();
debugSession_core_1.target.disconnect ();
debugServer.stop ()