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/CCSTUDIO: CCS: DSS Scripting- Opening CCS gui and running the DSS script without closing it.

Part Number: CCSTUDIO

Tool/software: Code Composer Studio

Hi,

I am trying to create a script which should do the following:

  • Open CCS gui
  • Launch a .ccxml and connect to a target
  • Load some .gel files based on input parameters.
  • Execute some gel functions.
  • Finish but don't close the debug session in CCS so that it can be manually debugged from this point.

I found the example ccsSession.js in the CCS folder and tried to incorporate it in my script. Now this scripts opens CCS and executes the functions. But CCS debug session is getting terminated and CCS gui is closed as soon as the script finishes.

Here is my DSS script (CCS_auto.js):

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

// Modify these variables to match your environment. Use forward slashes
var ccs6InstallDir = "C:/ti";
var DSSWorkshopDir = "C:/ccs7_workspace";
var deviceCCXMLFile = "C:/AVV/CCS_Scripting/USER1_XDS560STM.ccxml";
var logFile = "C:/AVV/CCS_Scripting/Debug/my.xml";

// 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 in the current directory to log script execution
script.traceBegin(logFile, "C:/CCS_Scripting/Debug/logfile.xsl");

// Set trace levels for console and logs
script.traceSetConsoleLevel(TraceLevel.INFO);
script.traceSetFileLevel(TraceLevel.ALL);

script.traceWrite("Begin scripting session");

// Start up CCS
ccsServer = script.getServer("CCSServer.1")
ccsSession = ccsServer.openSession(".*")

// Get the Debug Server and start a Debug Session
var debugServer = script.getServer("DebugServer.1");
debugServer.setConfig(deviceCCXMLFile);
var debugSession = debugServer.openSession(".*DAP_0.*");

// Connect to the CPU
debugSession.target.connect();
//load the top GEL file
debugSession.expression.evaluate('GEL_LoadGel("C:/CCS_Scripting/avv.gel")');
debugSession.expression.evaluate("unlock()");
debugSession.expression.evaluate("mem_init_all()");

if (arguments[1] == 1) {
debugSession.expression.evaluate('GEL_LoadGel("C:/CCS_Scripting/avv2.gel")');
debugSession.expression.evaluate("code_download_2()");
}

if (arguments[0] == 2) {
debugSession.expression.evaluate('GEL_LoadGel("C:/CCS_Scripting/tcm.gel")');
debugSession.expression.evaluate('GEL_LoadGel("C:/CCS_Scripting/l2.gel")');
debugSession.expression.evaluate("code_download_tcm()");
debugSession.expression.evaluate("code_download_l2()");
}
if (arguments[0] == 1) {
debugSession.expression.evaluate('GEL_LoadGel("C:/CCS_Scripting/tcm.gel")');
debugSession.expression.evaluate("code_download_tcm()");

debugSession.expression.evaluate("ram_rom_swap()");
debugSession.expression.evaluate("unhalt()");

I am calling this script as > CCS_auto.js 2 1

I just wanted to know if it is possible to keep CCS open.

Thanks and regards,

Saurabh