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.

DSS Script automation

Part Number: TMS320F280049

Tool/software: Code Composer Studio

Hello,

I want to program approximately 200 F280049 with the attached DSS Script and multiple XDS110 with chained F28. In order to keep the script scalable, I want to use arrays and for loops. While the array for debugger names and CPU names is easily created, I am not sure about an array of debug session objects. Is this even possible in Java?

Another point to decrease the overall programming time is the use of multi threading. Is this possible in DSS scripts?

// To run this script oen the "Scripting Console" under the "View" tab in CCS
// use the "loadJSFile <path to file>" command to load and run this script

// 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)

// Configurable Parameters
var deviceCCXMLFile = "<path>/targetConfigs/TMS320F280049.ccxml";
var programToLoad = "<path>/CPU1_RAM/Basis_F280049.out";

// Create our scripting environment object - which is the main entry point into any script and
// the factory for creating other Scriptable ervers and Sessions
var script = ScriptingEnvironment.instance();

// Create a debug server
var debugServer = script.getServer( "DebugServer.1" );

// Create Arrays with the appropriate Names for debugger and modules
var rack_debugger = ["Texas Instruments XDS110 USB Debug Probe"];
var rack_modules = ["C28xx_CPU1",
			"C28xx_CPU1_0",
			"C28xx_CPU1_1",
			"C28xx_CPU1_2",
			"C28xx_CPU1_3",
			"C28xx_CPU1_4",
			"C28xx_CPU1_5",
			"C28xx_CPU1_6",
			"C28xx_CPU1_7",
			"C28xx_CPU1_8"
			];

// Set the device ccxml 
debugServer.setConfig( deviceCCXMLFile );

// Open a debug session
debugSession0 = debugServer.openSession( "Texas Instruments XDS110 USB Debug Probe", "C28xx_CPU1" );
debugSession1 = debugServer.openSession( "Texas Instruments XDS110 USB Debug Probe", "C28xx_CPU1_0" );
debugSession2 = debugServer.openSession( "Texas Instruments XDS110 USB Debug Probe", "C28xx_CPU1_1" );
debugSession3 = debugServer.openSession( "Texas Instruments XDS110 USB Debug Probe", "C28xx_CPU1_2" );
debugSession4 = debugServer.openSession( "Texas Instruments XDS110 USB Debug Probe", "C28xx_CPU1_3" );
debugSession5 = debugServer.openSession( "Texas Instruments XDS110 USB Debug Probe", "C28xx_CPU1_4" );
debugSession6 = debugServer.openSession( "Texas Instruments XDS110 USB Debug Probe", "C28xx_CPU1_5" );
debugSession7 = debugServer.openSession( "Texas Instruments XDS110 USB Debug Probe", "C28xx_CPU1_6" );
debugSession8 = debugServer.openSession( "Texas Instruments XDS110 USB Debug Probe", "C28xx_CPU1_7" );
debugSession9 = debugServer.openSession( "Texas Instruments XDS110 USB Debug Probe", "C28xx_CPU1_8" );


// Connect to the target
debugSession0.target.connect();
debugSession1.target.connect();
debugSession2.target.connect();
debugSession3.target.connect();
debugSession4.target.connect();
debugSession5.target.connect();
debugSession6.target.connect();
debugSession7.target.connect();
debugSession8.target.connect();
debugSession9.target.connect();


// Load the program 
debugSession0.memory.loadProgram( programToLoad );
debugSession1.memory.loadProgram( programToLoad );
debugSession2.memory.loadProgram( programToLoad );
debugSession3.memory.loadProgram( programToLoad );
debugSession4.memory.loadProgram( programToLoad );
debugSession5.memory.loadProgram( programToLoad );
debugSession6.memory.loadProgram( programToLoad );
debugSession7.memory.loadProgram( programToLoad );
debugSession8.memory.loadProgram( programToLoad );
debugSession9.memory.loadProgram( programToLoad );

// Run the program
debugSession0.target.runAsynch();
debugSession1.target.runAsynch();
debugSession2.target.runAsynch();
debugSession3.target.runAsynch();
debugSession4.target.runAsynch();
debugSession5.target.runAsynch();
debugSession6.target.runAsynch();
debugSession7.target.runAsynch();
debugSession8.target.runAsynch();
debugSession9.target.runAsynch();

// Disconnect from the target
//debugSession0.target.disconnect();
//debugSession1.target.disconnect();

//debugSession0.terminate();
//debugSession1.terminate();
//debugServer.stop();

Regards,
Martin

  • Hello Martin,

    User1164857 said:
    I am not sure about an array of debug session objects.

    You can try something like the below:

    // Array of Debug Sessions
    dsGroup = [];
    
    // Number of Debug Sessions
    var dsNum = 3;
    
    debugSession0 = debugServer.openSession( "Texas Instruments XDS110 USB Debug Probe", "C28xx_CPU1" );
    debugSession1 = debugServer.openSession( "Texas Instruments XDS110 USB Debug Probe", "C28xx_CPU1_0" );
    debugSession2 = debugServer.openSession( "Texas Instruments XDS110 USB Debug Probe", "C28xx_CPU1_1" );
    
    dsGroup.push(debugSession0);
    dsGroup.push(debugSession1);
    dsGroup.push(debugSession2);
    
    for (var i=0;i<dsNum;i++)
    {
        dsGroup[i].target.connect();
    }
    

    User1164857 said:
    Another point to decrease the overall programming time is the use of multi threading. Is this possible in DSS scripts?

    DSS is just a bunch of Java APIs to the debugger. The key thing to be aware of is how the DSS APIs are called in a multi-threaded application.

    Thanks

    ki