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.

Debug Server Scripting (DSS) of the JavaScript code can not be simultaneously multi-core run

Other Parts Discussed in Thread: TCI6638K2K, CCSTUDIO

I want to use TI provided Debug Server Scripting (DSS) function, and through write JavaScript code to the CCS 5 program download to the DSP (TCI6638K2K)

-------------------------------------------------- -------------------------------------------------- -------------------------------------------------- -------------------------------------------------- -------

The following is the JavaScript code content

//To execute this script, simply type in the following line in the script console
//loadJSFile D:\DSP_code\DSP_Lite\start_USB560M_DSPLiteTx_X100.js

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

//change the directory path into your project location 
importPackage(Packages.org.eclipse.core.resources); 
env.setCurrentDirectory("D:/wkspc_Ue_BAND0_v1.0");

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

// Get the Debug Server and start a Debug Session
debugServer = script.getServer("DebugServer.1");

// Configure target for a Blackhawk USB560-M Emulator_0
script.traceWrite("Configuring debug server for TCI6638...");
debugServer.setConfig("D:/wkspc_Ue_BAND0_v1.0/Ue_RxCore0123.ccxml");
script.traceWrite("Done!");

// Open a debug session for each TCI6638 CPU
script.traceWrite("Opening a debug session for all TCI6638 cores...");
debugSession0 = debugServer.openSession("Texas Instruments XDS2xx USB Emulator_0/C66xx_0");
debugSession1 = debugServer.openSession("Texas Instruments XDS2xx USB Emulator_0/C66xx_1");
debugSession2 = debugServer.openSession("Texas Instruments XDS2xx USB Emulator_0/C66xx_2");
debugSession3 = debugServer.openSession("Texas Instruments XDS2xx USB Emulator_0/C66xx_3");
debugSession4 = debugServer.openSession("Texas Instruments XDS2xx USB Emulator_0/C66xx_4");
debugSession5 = debugServer.openSession("Texas Instruments XDS2xx USB Emulator_0/C66xx_5");
debugSession6 = debugServer.openSession("Texas Instruments XDS2xx USB Emulator_0/C66xx_6");
debugSession7 = debugServer.openSession("Texas Instruments XDS2xx USB Emulator_0/C66xx_7");
script.traceWrite("Done!");

// Connect to each TCI6638 CPU
script.traceWrite("Connecting to all TCI6638 CPUs...");
debugSession0.target.connect();
debugSession1.target.connect();
debugSession2.target.connect();
debugSession3.target.connect();
debugSession4.target.connect();
debugSession5.target.connect();
debugSession6.target.connect();
debugSession7.target.connect();
script.traceWrite("Done!");

//======================= load program ================================

//--------- Device 1 -----------
script.traceWrite("Loading program to CPU 0...");
debugSession0.memory.loadProgram("/Ue_coreC/Debug/Ue_coreC.out");
script.traceWrite("Done!");

script.traceWrite("Loading program to CPU 1...");
debugSession1.memory.loadProgram("Ue_coreD/Debug/Ue_coreD.out");
script.traceWrite("Done!");

script.traceWrite("Loading program to CPU 2...");
debugSession2.memory.loadProgram("/Ue_coreE/Debug/Ue_coreE.out");
script.traceWrite("Done!");

script.traceWrite("Loading program to CPU 3...");
debugSession3.memory.loadProgram("/Ue_coreF/Debug/Ue_coreF.out");
script.traceWrite("Done!");

script.traceWrite("Loading program to CPU 4...");
debugSession4.memory.loadProgram("/Ue_coreA/Debug/Ue_coreA.out");
script.traceWrite("Done!");

script.traceWrite("Loading program to CPU 5...");
debugSession5.memory.loadProgram("/Ue_coreB/Debug/Ue_coreB.out");
script.traceWrite("Done!");

script.traceWrite("Loading program to CPU 6...");
debugSession6.memory.loadProgram("/Ue_coreG/Debug/Ue_coreG.out");
script.traceWrite("Done!");

script.traceWrite("Loading program to CPU 7...");
debugSession7.memory.loadProgram("/Ue_coreH/Debug/Ue_coreH.out");
script.traceWrite("Done!");

//======================= Run program ================================ 
var dsArray=new Array();
dsArray[0]=debugSession0;
dsArray[1]=debugSession1;
dsArray[2]=debugSession2;
dsArray[3]=debugSession3;
dsArray[4]=debugSession4;
dsArray[5]=debugSession5;
dsArray[6]=debugSession6;
dsArray[7]=debugSession7;
script.traceWrite("End Scripint session!");

 

-------------------------------------------------- -------------------------------------------------- -------------------------------------------------- -------------------------------------------------- -------

But  "Run program" phase, can not run eight core simultaneously , only five core can run, as shown below.

  • Hello,
    A few observations:

    I am assuming that you are running your script from the CCS Scripting Console after you have started a debug session. Is that correct?

    I do not see an actual (simultaneous) run command. After program load, all I see the script creating the array of debug sessions and nothing more.

    From your screenshot I can see that the first 5 cores are running while the last three are halted at main. Given that, and the fact that you do not have a run command in the script, it looks like the first 5 cores are unable to auto-run to main while the last 3 is successful (the debugger will try to auto-run to main on program load). Is this indeed the case and that the issue is really that the first 5 cores are unable to auto-run to main?

    Also note that CCSv5 is an older version that has been deprecated in support. If possible, I recommend updating your CCS version to something more current.

    Thanks
    ki
  • Hi,

    Thanks for getting back to me.

    i'm sorry, that JavaScript code is not correct version.

    i use "debugServer.simultaneous.run(dsArray);" run command to run multi-core, but only 5 cores can auto-run, last 3 cores can't auto-run.

    The correct version are as follows:

    -------------------------------------------------- -------------------------------------------------- -------------------------------------------------- -------------------

    //To execute this script, simply type in the following line in the script console
    //loadJSFile D:\DSP_code\DSP_Lite\start_USB560M_DSPLiteTx_X100.js

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

    //change the directory path into your project location
    importPackage(Packages.org.eclipse.core.resources);
    env.setCurrentDirectory("D:/wkspc_Ue_BAND0_v1.0");

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

    // Get the Debug Server and start a Debug Session
    debugServer = script.getServer("DebugServer.1");

    // Configure target for a Blackhawk USB560-M Emulator_0
    script.traceWrite("Configuring debug server for TCI6638...");
    debugServer.setConfig("D:/wkspc_Ue_BAND0_v1.0/Ue_RxCore0123.ccxml");
    script.traceWrite("Done!");

    // Open a debug session for each TCI6638 CPU
    script.traceWrite("Opening a debug session for all TCI6638 cores...");
    debugSession0 = debugServer.openSession("Texas Instruments XDS2xx USB Emulator_0/C66xx_0");
    debugSession1 = debugServer.openSession("Texas Instruments XDS2xx USB Emulator_0/C66xx_1");
    debugSession2 = debugServer.openSession("Texas Instruments XDS2xx USB Emulator_0/C66xx_2");
    debugSession3 = debugServer.openSession("Texas Instruments XDS2xx USB Emulator_0/C66xx_3");
    debugSession4 = debugServer.openSession("Texas Instruments XDS2xx USB Emulator_0/C66xx_4");
    debugSession5 = debugServer.openSession("Texas Instruments XDS2xx USB Emulator_0/C66xx_5");
    debugSession6 = debugServer.openSession("Texas Instruments XDS2xx USB Emulator_0/C66xx_6");
    debugSession7 = debugServer.openSession("Texas Instruments XDS2xx USB Emulator_0/C66xx_7");
    script.traceWrite("Done!");

    // Connect to each TCI6638 CPU
    script.traceWrite("Connecting to all TCI6638 CPUs...");
    debugSession0.target.connect();
    debugSession1.target.connect();
    debugSession2.target.connect();
    debugSession3.target.connect();
    debugSession4.target.connect();
    debugSession5.target.connect();
    debugSession6.target.connect();
    debugSession7.target.connect();
    script.traceWrite("Done!");

    //======================= load program ================================

    //--------- Device 1 -----------
    script.traceWrite("Loading program to CPU 0...");
    debugSession0.memory.loadProgram("/Ue_coreC/Debug/Ue_coreC.out");
    script.traceWrite("Done!");

    script.traceWrite("Loading program to CPU 1...");
    debugSession1.memory.loadProgram("Ue_coreD/Debug/Ue_coreD.out");
    script.traceWrite("Done!");

    script.traceWrite("Loading program to CPU 2...");
    debugSession2.memory.loadProgram("/Ue_coreE/Debug/Ue_coreE.out");
    script.traceWrite("Done!");

    script.traceWrite("Loading program to CPU 3...");
    debugSession3.memory.loadProgram("/Ue_coreF/Debug/Ue_coreF.out");
    script.traceWrite("Done!");

    script.traceWrite("Loading program to CPU 4...");
    debugSession4.memory.loadProgram("/Ue_coreA/Debug/Ue_coreA.out");
    script.traceWrite("Done!");

    script.traceWrite("Loading program to CPU 5...");
    debugSession5.memory.loadProgram("/Ue_coreB/Debug/Ue_coreB.out");
    script.traceWrite("Done!");

    script.traceWrite("Loading program to CPU 6...");
    debugSession6.memory.loadProgram("/Ue_coreG/Debug/Ue_coreG.out");
    script.traceWrite("Done!");

    script.traceWrite("Loading program to CPU 7...");
    debugSession7.memory.loadProgram("/Ue_coreH/Debug/Ue_coreH.out");
    script.traceWrite("Done!");

    //======================= Run program ================================

    var dsArray=new Array();
    dsArray[0]=debugSession0;
    dsArray[1]=debugSession1;
    dsArray[2]=debugSession2;
    dsArray[3]=debugSession3;
    dsArray[4]=debugSession4;
    dsArray[5]=debugSession5;
    dsArray[6]=debugSession6;
    dsArray[7]=debugSession7;
    debugServer.simultaneous.run(dsArray);

    -------------------------------------------------- -------------------------------------------------- -------------------------------------------------- -------------------



    i try another way, i use "debugSession0.target.run();" run command, one by one sequential run multi-core, but only first core can auto-run.
    //======================= Run program ================================
    debugSession0.target.run();
    debugSession1.target.run();
    debugSession2.target.run();
    debugSession3.target.run();
    debugSession4.target.run();
    debugSession5.target.run();
    debugSession6.target.run();
    debugSession7.target.run();

    -------------------------------------------------- -------------------------------------------------- -------------------------------------------------- -------------------

    Thanks.
  • As I mentioned earlier, it seems like the programs for the first 5 cores are unable to reach main. What I would like to know is if you manually just load each program to each core, are they all able to reach 'main' and stay halted there? Do all the programs have a 'main'?

    user4735746 said:
    i try another way, i use "debugSession0.target.run();" run command, one by one sequential run multi-core, but only first core can auto-run.
    //======================= Run program ================================
    debugSession0.target.run();
    debugSession1.target.run();
    debugSession2.target.run();
    debugSession3.target.run();
    debugSession4.target.run();
    debugSession5.target.run();
    debugSession6.target.run();
    debugSession7.target.run();

    If the first core is not reaching main, the call would just be blocked since it is a synchronous run call.

  • all the programs have a “main” and when I finish download program, all program able to reach 'main' and stay halted there
    I have confirm correct load program to DSP, and after eight core loading, and just try to run core 4, 5, 6, 7, but there will not be run, just stay in the eight core loaded state.

    i reference the follow link to coding JavaScript. ( Multi-core )
    (Reference Links: Multiple Debug Sessions for Multi-core Debug -> processors.wiki.ti.com/.../Debug_Server_Scripting )