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:
Hello,
I am trying to use a javascript file in DSS environment to start a CCS GUI session with all parameters and windows set up.
To do so, I read following sources:
7.6. Scripting — Code Composer Studio 12.7.0 Documentation
Launching Code Composer Studio from DSS (ti.com)
In the last one, there is a note: "Wait until the CCS IDE is fully launched." It seems to be a very important information !
It seems that some actions from DSS scripting environment are "missed" by CCS IDE if it is not ready (showing the opened debug session, taking into account some "option" on flash, others ?).
As a result to "let" CCS IDE to be ready, I add some ugly "wait" instructions into the following DSS script.
// Get scripting environment singleton var script = ScriptingEnvironment.instance(); // Logging configuration script.traceBegin("ccs_log.xml") script.traceSetConsoleLevel(TraceLevel.CONFIG) script.traceSetFileLevel(TraceLevel.CONFIG) // Script timeout in millisecond for current environment (-1 infinite) script.setScriptTimeout(60000); var timeout = script.getScriptTimeout(); script.traceWrite("timeout: " + timeout); // Starting up a CCS IDE ccsServer = script.getServer("CCSServer.1"); ccsSession = ccsServer.openSession(".*"); // Waiting to let IDE to be fully loaded (no synchronization schem found between javascript and eclipse) Thread.sleep(15000); // in milliseconds // Starting up a DebugServer var debugServer = script.getServer("DebugServer.1"); debugServer.setConfig("targetConfigs/LaunchpadXL_TMS320F28379D_woGEL.ccxml"); var debugSession = debugServer.openSession(".*C28xx_CPU1.*"); // Waiting to led IDE to capture this session (and take into account following configuration) Thread.sleep(5000); // in milliseconds // Configure and connect to target debugSession.options.setString("FlashEraseSelection","Necessary Sectors Only (for Program Load)"); debugSession.target.connect();
Is there any mean to build a synchronisation with CCS IDE ?
Thanks,
Damien
Hi Damien,
If you are using the same debug environment as the link you provided (https://software-dl.ti.com/ccs/esd/documents/dss_launching_ccs_from_dss.html), then the best way to synchronize the IDE and the DSS script you are debugging is use a breakpoint in the rhino debugger. Then you can run/step your script when the IDE is in sync.
Would that fit into what you are trying to do?
Thanks,
Ricky
Hi Ricky,
Thanks you for your answer.
I understand your solution, and, in fact, it was the way for me to find the reason why my javascript code didn't work as expected. My aim is to avoid human interaction.
The first idea was to add fixed delays in javascript, it works but delays depend on the host computer performance.
Finally, I am loking for a solution to known/alert/synchronise my javascript with some IDE states.
Damien
Damien,
Can you provide more information on the setup you are going for?
If you are trying to avoid human interaction, what is the purpose of the IDE being starting at the same time as the DSS script, vs just running DSS in command line mode?
We might be able to provide more suggestions once we know the test environment you are trying to set up.
Thanks,
Ricky
Ricky,
It's a good question ! I will try to describe our need completely. Indeed my first messages were focused on the synchronization problem between the DebugServer and CSS.
We want to use the CCS IDE for debugging only. We do not have a CCS project available.
We need to connect with a target (for example a launchpad) whose binary is already loaded.
We have the tree containing the generation sources and the generated binaries.
The idea is that this tree has a script to launch the CSS IDE with:
- checking loaded binaries
- configuring FLASH parameters to reload a binary with the IDE if necessary
- the correct paths to the sources (different from those used for compilation)
- loading a set of breakpoints
- loading a set of expressions
- the correct configuration of windows (breakpoints, expression, disassembly, memory...)
So without human intervention, the IDE loads itself with all the necessary information to begin the analysis work.
I hope my intention is clearer.
I managed to find some of these points but the functionalities seem to depend on the environment (DSS or CSS javascript console). I can't get a complete automated loading sequence.
For information, I use CCS 9.2
Thanks
Damien
To add an idea, it seems that the launch configurations allow you to cover part of these needs by selecting a targetconfigfile and an initialization script executed in CSS environment. However I haven't found a way to load CCS by importing and running this *.launch file automatically.
Damien,
I understand your solution, and, in fact, it was the way for me to find the reason why my javascript code didn't work as expected. My aim is to avoid human interaction.
The first idea was to add fixed delays in javascript, it works but delays depend on the host computer performance.
This is an expected limitation of trying to launch the CCS IDE from a command-line DSS script. There really isn't a better workaround than the above.
So without human intervention, the IDE loads itself with all the necessary information to begin the analysis work.
Most people who look to do something similar typically manually launch the CCS IDE and then load a DSS script via the Scripting Console. Note that you can also configure the script to auto-run when the Scripting Console is launched. Most find this an acceptable solution.
KI,
Thanks for your anwser. I understand that I was looking for something impossible. Thanks for this lead, I'll dig into it.
Damien