This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CCS: CCS 9.2 DSS Query

Tool/software: Code Composer Studio

Previously, we wrote a number of DSS javascripts to automate testing which ran without any problems under CCSv5, we have since upgraded our CCS to v9.2.0.00013 and the scripts no longer work as before.

We set the debug session up in the standard way, set 3 hardware breakpoints, then run through the system boot up sequence to check the boot sequence is correct.

The problem we are seeing is that the breakpoint code only works when we step through the code with the Rhino Debugger. If the file is run directly using dss.bat or is loaded into the Rhino Debugger, and just 'go' is selected, the code fails at line

      if (nPC != BOOT_SOMA)

Giving the message 'FAIL: Expected halt at start of BOOT 0x40300000, actually halted at 0x8000000'. This would imply that after hitting the first breakpoint it restarted but the program counter didn't actually move before hitting the 2nd breakpoint!

I've attached an example of the javascript, could someone please explain why it now only works when we step through with the Rhino Debugger!!

// 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);

// Create our scripting environment object - which is the main entry point into any script and
// the factory for creating other Scriptable Servers and Sessions
var script = ScriptingEnvironment.instance();

// Create a log file
script.traceBegin(LOG_FILE, LOG_FILE_STYLESHEET);

//  Specifies the max time to wait for underlying calls to the DebugServer to return.
script.setScriptTimeout(60000);

// Log everything to console
script.traceSetConsoleLevel(TraceLevel.ALL);

// Log INFO level and above up to SEVERE to log file which includes traceWrite outputs
script.traceSetFileLevel(TraceLevel.INFO);

// Get the Debug Server and start a Debug Session
var debugServer = script.getServer("DebugServer.1");

// Launch selected configuration
debugServer.setConfig(TARGET_CONFIGURATION_FILE);

// Open a debug session
script.traceWrite("Open debug session ... ");
var debugSession = debugServer.openSession(EMULATOR);

// Connect to target CPU
script.traceWrite("Connecting to " + EMULATOR + " ...");
debugSession.target.connect();

var bp_startup;
var properties_startup;
var bp_boot;
var properties_boot;
var bp_ofp;
var properties_ofp;
var nPC;
var nResult;

// The Start Of Memory Addresses for each of the CSCIs
var STARTUP_SOMA = 0x08000000;
var BOOT_SOMA    = 0x40300000;
var OFP_SOMA     = 0x80000000;

// Set a hardware breakpoint at the start of STARTUP memory
script.traceWrite("Set hardware breakpoint at start of STARTUP memory ...");
properties_startup = debugSession.breakpoint.createProperties(1);
properties_startup.setString("Hardware Configuration.Type", "Breakpoint");
properties_startup.setString("Hardware Configuration.Type.Location", "0x08000000");
properties_startup.setString("Hardware Configuration.Type.Access Mode", "Any");

bp_startup = debugSession.breakpoint.add(properties_startup);

// Set a hardware breakpoint at the start of BOOT memory
script.traceWrite("Set hardware breakpoint at start of BOOT memory ...");
properties_boot = debugSession.breakpoint.createProperties(1);
properties_boot.setString("Hardware Configuration.Type", "Breakpoint");
properties_boot.setString("Hardware Configuration.Type.Location", "0x40300000");
properties_boot.setString("Hardware Configuration.Type.Access Mode", "Any");

bp_boot = debugSession.breakpoint.add(properties_boot);

// Set a hardware breakpoint at the start of OFP memory
script.traceWrite("Set hardware breakpoint at start of OFP memory ...");
properties_ofp = debugSession.breakpoint.createProperties(1);
properties_ofp.setString("Hardware Configuration.Type", "Breakpoint");
properties_ofp.setString("Hardware Configuration.Type.Location", "0x80000000");
properties_ofp.setString("Hardware Configuration.Type.Access Mode", "Any");

bp_ofp = debugSession.breakpoint.add(properties_ofp);

// Reset the target
//debugSession.target.reset();
script.traceWrite("System Reset ...");
nResult = debugSession.expression.evaluate("GEL_AdvancedReset(\"System Reset\")");

nPC = debugSession.expression.evaluate("PC");

if (nPC != STARTUP_SOMA)
{
   // Not at the start of STARTUP when we would expect it to be.
   outcome = "FAIL";
   script.traceWrite("FAIL: Expected halt at start of STARTUP 0x" + Long.toHexString(STARTUP_SOMA) +
                     ", actually halted at 0x" + Long.toHexString(nPC));
}
else
{

   // Halted at start of STARTUP
   if (CSCI_UNDER_TEST == "STARTUP")
   {
      script.traceWrite("Halted at 0x" + Long.toHexString(nPC));
      script.traceWrite("Loading symbols for STARTUP ...");
      debugSession.symbol.load(STARTUP_OUT_FILE);
      symbols_loaded = true;
   }
   else
   {

      // Run on to BOOT
      debugSession.target.run();
      nPC = debugSession.expression.evaluate("PC");

      if (nPC != BOOT_SOMA)
      {
         // Not at the start of BOOT when we would expect it to be.
         outcome = "FAIL";
         script.traceWrite("FAIL: Expected halt at start of BOOT 0x" + Long.toHexString(BOOT_SOMA) +
                           ", actually halted at 0x" + Long.toHexString(nPC));
      }
      else
      {

         // Halted at start of BOOT
         if (CSCI_UNDER_TEST == "BOOT")
         {
            script.traceWrite("Halted at 0x" + Long.toHexString(nPC));
            script.traceWrite("Loading symbols for BOOT ...");
            debugSession.symbol.load(BOOT_OUT_FILE);
            symbols_loaded = true;
         }
         else
         {
            // Run on to OFP

            debugSession.target.run();
            nPC = debugSession.expression.evaluate("PC");

            if (nPC != OFP_SOMA)
            {
               // Not at the start of OFP when we would expect it to be.
               outcome = "FAIL";
               script.traceWrite("FAIL: Expected halt at start of OFP 0x" + Long.toHexString(OFP_SOMA) +
                  ", actually halted at 0x" + Long.toHexString(nPC));
            }
            else
            {
               // Halted at start of OFP
               if (CSCI_UNDER_TEST == "OFP")
               {
                  script.traceWrite("Halted at 0x" + Long.toHexString(nPC));
                  script.traceWrite("Loading symbols for OFP ...");
                  debugSession.symbol.load(OFP_OUT_FILE);
                  symbols_loaded = true;
               }
               else
               {
                  outcome = "FAIL";
                  script.traceWrite("FAIL: Script did not halt at chosen CSCI's start of memory");
               }
            }
         }
      }
   }
}

debugSession.breakpoint.removeAll();

  • Hi Jason,

    Jason Robbins said:

    If the file is run directly using dss.bat or is loaded into the Rhino Debugger, and just 'go' is selected, the code fails at line

          if (nPC != BOOT_SOMA)

    What happens if you manually follow the same steps via the CCS GUI? Can you successfully run to each breakpoint? If not, then this would confirm my suspicions that the root issue is not DSS specific but something more general.

    Thanks

    ki