NOTICE: The Processors Wiki will End-of-Life in December of 2020. It is recommended to download any files or other content you may need that are hosted on processors.wiki.ti.com. The site is now set to read only.

GUI Composer/DSS Scripts

From Texas Instruments Wiki
Jump to: navigation, search

Overview[edit]

Starting with Code Composer Studio version 6, GUI Composer allows GUI Controls (e.g. buttons) to invoke Debug Server Scripting (DSS) scripts. DSS commands provide access to debug type functionality allowing control of your target system. For example you could create actions that control CPU execution or reset the system. DSS commands that deal with accessing the target and controlling its execution are limited to GUI Composer applications that use JTAG for host <-> target communication.

Calling DSS scripts in GUI Composer[edit]

To execute the DSS scripts from the application you need to add DSS Script file named dsScript.js to your application. The functions in that script can be called from the application scripts by calling the API TI.DSS( functionName, parameter1, paramater2, …). This API can be invoked from anywhere within the GUI Composer application’s script provided that guiComposer.js is already included. For example there can be a Step button in the application and when user selects that button a step command will be issued to the target. GUI Composer Runtime provides a javascript execution environment for DSS scripts. Note the DSS javascript environment is different from the application’s javascript environment. That means the DSS script will not be able to access GUI objects, e.g. set some text in a text box widget. The scripts If you need more information on DSS or GUI Composer, please visit:

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

GUI Composer: http://processors.wiki.ti.com/index.php/Category:GUI_Composer

Example[edit]

To demo the feature let’s create a GUI composer application that issues source step command to the target when a button is clicked.

  • Open GUI Composer editor.
  • Create a new GUI Composer project.
  • Add a new javascript file from the GUI Composer Project view toolbar button. Name it dsScript.js.
  • Copy and paste the content bellow to the newly opened javascript editor:
   importPackage(Packages.com.ti.ccstudio.scripting.environment)
   function myStepOver( steps) {
       if(!$active_context_name) {
           throw "An active Debug Session is required for myStepOver()";
       }
       var debugServer = ScriptingEnvironment.instance().getServer('DebugServer.1');
       var session = debugServer.openSession($active_context_name);
       var i;
       for( i = 0; i < steps; ++i) {
           session.target.sourceStep.over();
       }
   }
  • Save the javascript editor.
  • Drag and drop a button from the Pallet to the work area of the editor.
  • Select the button in the work area, then click on the Events tab on the right side of the editor.
  • In the onclick: filed enter TI.DSS( 'myStepOver' , 3)
  • Save the application by pressing the Save button at the top left of the GUI Composer window.
  • Suspend the target if it is running.
  • Preview the application by pressing the Preview button at the top right of the GUI Composer window.
  • Click the button – note how the target executes three source steps.


Notes[edit]

The use of the global variable $active_context_name in dsScript.js. When the script is invoked it will contain the name of the currently selected CPU in the debug view. If there is no debug session it will be set to null. You can see from the code how this variable is passed as parameter to openSession.


There is no restriction that the script invokes commands only on the selected core. Calling openSession with different parameter than $active_context_name can be used to obtain access to the different CPUs of the system. Keep in mind that calling a session object that is not the initialized with the active context name will probably make the script specific for a given target configuration.

E2e.jpg {{
  1. switchcategory:MultiCore=
  • For technical support on MultiCore devices, please post your questions in the C6000 MultiCore Forum
  • For questions related to the BIOS MultiCore SDK (MCSDK), please use the BIOS Forum

Please post only comments related to the article GUI Composer/DSS Scripts here.

Keystone=
  • For technical support on MultiCore devices, please post your questions in the C6000 MultiCore Forum
  • For questions related to the BIOS MultiCore SDK (MCSDK), please use the BIOS Forum

Please post only comments related to the article GUI Composer/DSS Scripts here.

C2000=For technical support on the C2000 please post your questions on The C2000 Forum. Please post only comments about the article GUI Composer/DSS Scripts here. DaVinci=For technical support on DaVincoplease post your questions on The DaVinci Forum. Please post only comments about the article GUI Composer/DSS Scripts here. MSP430=For technical support on MSP430 please post your questions on The MSP430 Forum. Please post only comments about the article GUI Composer/DSS Scripts here. OMAP35x=For technical support on OMAP please post your questions on The OMAP Forum. Please post only comments about the article GUI Composer/DSS Scripts here. OMAPL1=For technical support on OMAP please post your questions on The OMAP Forum. Please post only comments about the article GUI Composer/DSS Scripts here. MAVRK=For technical support on MAVRK please post your questions on The MAVRK Toolbox Forum. Please post only comments about the article GUI Composer/DSS Scripts here. For technical support please post your questions at http://e2e.ti.com. Please post only comments about the article GUI Composer/DSS Scripts here.

}}

Hyperlink blue.png Links

Amplifiers & Linear
Audio
Broadband RF/IF & Digital Radio
Clocks & Timers
Data Converters

DLP & MEMS
High-Reliability
Interface
Logic
Power Management

Processors

Switches & Multiplexers
Temperature Sensors & Control ICs
Wireless Connectivity