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.

Launching CCS from Javascript

Is it possible (and if so, how) to create and run javascript to get the following effect with no manual intervention?

  • open the CCS GUI (actually CCS V5)
  • launch a selected configuration
  • connect selected cores
  • set breakpoints on those cores
  • run those cores
  • terminate the Javascript leaving CCS running.

I need to do this to automate an otherwise tedious and error-prone procedure.

  • Peter,

    The Debug Server Scripting (DSS) package can be used for this.  it is included with your CCS installation.  There are a number of examples included and they are probably the best place to start.  The one called CCSsession.js shows how to bring up the CCS GUI on a debug session started by DSS (which is essentially the same as what you want to do).

    DSS is located in /ccsv5/ccs_base/scripting.  The example you want is in /ccsv5/ccs_base/scripting/examples/DebugServerExamples

    There is also an example in there on how to set breakpoints.

    Regards,

    John

  • In addition to the example John referenced, the below wiki articles will also be of interest:

    http://processors.wiki.ti.com/index.php/Debug_Server_Scripting

    http://processors.wiki.ti.com/index.php/DSS_-_Launching_CCS_from_DSS

    Thanks

    ki

  • Thank you for the suggestions, but they do not move me forward.

    I had tried running CCSsession.js but:

    1. It does not bring up the CCS GUI. Instead I get a generic "Welcome to Eclipse" window.
    2. This window eventually disappears.
    3. The script sometimes hangs, but usually runs on to TEST SUCCEEDED! and then comes up with a sequence of errors of the form "Job found still running after platform shutdown".

    To be clear, what I want to do is the following:

    1. Run a command that:
      1. opens the standard CCS GUI;
      2. selects a ccmxl file;
      3. connects selected processors/cores;
      4. sets some breakpoints (the processors will already have been loaded by this point);
      5. runs the cores;
      6. leaves the CCS GUI running for normal user interaction;
      7. has no forther interaction with this CCS session.
    2. From this point on, the command is of no interest and would stop ideally, but leave CCS running.

    In other words, I want to be able to set up an interactive CCS session completely automatically to avoid users having to do the above steps (or equivalents) each time they want to debug a program.


    The document "DSS - Launching CCS from DSS" added nothing except a concern by requiring manual intervention to set a breakpoint in the script "because CCS is launched within the same JVM, but on a separate thread and the calling script has no way of knowing when the IDE is loaded". This seems to defeat the whole purpose of the exercise.

  • Hi Peter,

    Sorry, you are correct. I was hoping you would not need to use Rhino or set any breakpoints since you would not be terminating the debug session in the script. However it seems like the script must be halted after the IDE is launched to give it time to "catch up" before the debug session is started. Otherwise the GUI association seems broken.

    Peter Robertson said:
    • Run a command that:
      1. opens the standard CCS GUI;
      2. selects a ccmxl file;
      3. connects selected processors/cores;
      4. sets some breakpoints (the processors will already have been loaded by this point);
      5. runs the cores;
      6. leaves the CCS GUI running for normal user interaction;
      7. has no forther interaction with this CCS session.
    • From this point on, the command is of no interest and would stop ideally, but leave CCS running.

    You are on the right track when you started this thread:

    http://e2e.ti.com/support/development_tools/code_composer_studio/f/81/t/362495.aspx

    That seems to be the best path. When I simply launched the CCS executable, it autoloaded my DSS js  test script in .\ccsv6\ccs_base\common\IDE\scripts and executed it (basically configured the debugger for a ccxml file, connected to the target, set some breakpoints and ran to them). Overall works well. I did find one issue where while the breakpoints were set correctly and the target ran to them, they don't appear in the breakpoints view. I'm looking into this...

  • Sadly using .\ccsv6\ccs_base\common\IDE\scripts is a dead end as I mentioned in my response to that suggestion.

    (Yet another example of the disasters caused by shared resources!)

    There is also the problem that that directory is used only when CCS starts, forcing users to have to shut down any running instance before debugging something new (that is, unless there's an undocumented way of attaching to an existing instance of CCS and making it restart).

  • Hello,

    Ki-Soo Lee said:

    Otherwise the GUI association seems broken.

    I am trying to do something similar. And I also found out that the script command meant to launch the GUI, actually brings a generic Eclipse window.

    Is there a fix to this precisely ?

    Many thanks in advance.