Debug Server Scripting/Step By Step

From Texas Instruments Wiki
Jump to: navigation, search

DSS ( Debug Server Scripting) Getting Started Guide - Step By Step

This guide provides step by step instructions on how to utilize DSS to load and run a program. Additional information on DSS can be found here

Invoking DSS API's from the CCS Scripting Console

Execute the following DSS commands in the CCS Scripting Console to load and run a program. The scripting console could be opened via the 'View->Scripting Console' CCS menu item. More information on the Scripting Console is available here

  • Set the device configuration file ( ccxml ) - ds.setConfig( "C:/Temp/my_device.ccxml" );
 DSS API:  DebugServer.setConfig( <Path/to/target/ccxml/file> )
 Note:     ds is a reference to a DebugServer object provided by the CCS Scripting Console. DebugServer class is the main entry point to all DSS API's.
  • Open a Debug Session - var debugSession = ds.openSession(".*");
 DSS API: DebugServer.openSession( <regex to filter core > )
 Note: Obtain a reference to a Debug Session object. The regex is used to filter cores when working with multi core devices. It should be sufficient to use ".*" for single core devices.
  • Load the program - debugSession.memory.loadProgram("C:/Temp/my_program.out")
 DSS API: Memory.loadProgram( <Path/to/out/file > )
 Note:    Use the previously created DebugSession reference to access the Memory object and load the program.
  • Run the program -
 Note:    Use the previously created DebugSession reference to accesses the Target object and run the program.

Invoking a DSS Script from the CCS Scripting Console

It is possible to invoke a java script file containing a set of DSS commands from the CCS Scripting console. To create and execute a DSS script to load and run a program perform the following.

  • Create a text file ( myscript.js )
  • Copy our DSS commands in to the file
 ds.setConfig( <Path/to/target/ccxml/file> ); 
 var debugSession = ds.openSession(".*");
 debugSession.memory.loadProgram( <Path/to/out/file > );;
  • Execute the loadJSFile command in the CCS Scripting Console to load and run the script - loadJSFile("c:/Temp/myscript.js")

Running DSS Scripts from outside CSS

DSS scripts could also be run without launching CCS. To illustrate this we will run the LoadProgram.js example script that comes with the CCS installation. This script performs the basic task of loading and running a program. To run the script open a command prompt/shell perform the following.

  • Navigate to <ccs install root >/ccsv5/ccs_base/scripting/examples/DebugServerExamples directory
  • Execute the following command.
In Windows - ..\..\bin\dss LoadProgram.js
In Linux - ../../bin/dss LoadProgram.js

Note that LoadProgram.js script is similar to the script we created and ran from the CCS Scripting Console. The only differences being


a call to the ScriptingEnvironment class to create a DebugServer object which was already available when running from the CCS Scripting Console.


import <package> directives to import the referenced java packages.