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.
Tool/software: Code Composer Studio
Hi,
I am trying to create a script which should do the following:
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
Saurabh,
I recall doing this in the past, but I am not sure if it was in the context of the Rhino debugger or on normal operation.
I would strongly check the sections 7.6.2.1 and 7.6.2.2. of the CCS User's guide on the CCSv9.1.0 Help (menu Help --> Contents) or at the link below:
https://software-dl.ti.com/ccs/esd/documents/users_guide/index.html
I wil lget back to thsi thread.
Regards,
Rafael
Saurabh,
This document shows how to handle this exact use case:
http://software-dl.ti.com/ccs/esd/documents/dss_launching_ccs_from_dss.html
Regards,
John