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.

TMS320F28379D: Debug Script Server Termination

Genius 14250 points

Part Number: TMS320F28379D

Dear experts,

our customers met a question below

Hi I am using a TMS320F28379D board and attempting to learn how to use the Debug Server Scripting (DSS) feature to automate some tests. I tried loading a JS file from command prompt for an example program. This program blinks the led 20 times before calling the exit() function. When I ran the test, the led blinks 20 times as expected. However, I do not see any indications of termination from the command line. Is this expected? I have attached an image of what I see on the command line. I will also attach my JS file. I should probably mention that a log file is produced, but I am unable to render it in Edge and Chrome, it will only show a blank page. Do you know what could be a possible reason for this?

importPackage(Packages.com.ti.debug.engine.scripting);
importPackage(Packages.com.ti.ccstudio.scripting.environment);
importPackage(Packages.java.lang);

// Modify the following two variables to match your environment. Use forward slashes and full paths.
//  (non-windows users: instead of ~/ use the full path to your home folder)
// The first variable should match the argument passed to setpath.bat
// The second should be the path for the DSS-Workshop folder
var ccsInstallDir = "C:/ti/ccs1011/ccs/";
var dssWorkshopDir = "C:/ti/CCS-Workshops/DSS-Workshop/";

// The necessary files
var logFile = dssWorkshopDir + "/lab1/log.xml";
var logFileStylesheet = ccsInstallDir + "/ccs_base/scripting/examples/DebugServerExamples/DefaultStylesheet.xsl";
var deviceCCXMLFile = dssWorkshopDir + "/target-config/f28379d_xds100.ccxml";
var programToLoad = "C:/ti/c2000/C2000Ware_2_01_00_00/device_support/f2837xd/examples/cpu1/blinky/cpu01/ccs/CPU1_RAM/blinky_cpu01.out";

var scriptEnv = ScriptingEnvironment.instance();

scriptEnv.traceBegin(logFile, logFileStylesheet);

scriptEnv.traceSetConsoleLevel(TraceLevel.INFO);
scriptEnv.traceSetFileLevel(TraceLevel.ALL);

var debugServer = scriptEnv.getServer("DebugServer.1");

debugServer.setConfig(deviceCCXMLFile);

var debugSession = debugServer.openSession("Texas Instruments XDS100v2 USB Debug Probe_0/C28xx_CPU1");

debugSession.target.connect();

debugSession.memory.loadProgram(programToLoad);

debugSession.target.run();

debugServer.stop();

scriptEnv.traceEnd();


Best regards,
William

  • Unfortunately, our best experts on DSS are out today.  They will see your post on Monday.

    Thanks and regards,

    -George

  • HI William,

    Does the blinky_cpu01.out program ever hit the exit point? If not, then it may be stuck in an intentional loop. This may not necessarily a problem for the program, but the DSS script is expecting the program to halt at some point. The target.run() API will block until the target is halted. Hence the script would never finish running.

    I should probably mention that a log file is produced, but I am unable to render it in Edge and Chrome, it will only show a blank page. Do you know what could be a possible reason for this?

    It means that the log was never properly closed. Basically traceEnd() was never called. Likely because it was stuck at the target.run() call. 

    You can "fix" the log by adding the missing </log> tag at the end of the file

    Thanks

    ki

  • Dear Ki

    Thank you for the reply. Could I clarify further how do I set the exit point of the program? My code only consists of a for loop and an exit function. I realised that the exit function calls the abort function in exit.c, which has an infinite for loop. I tried commenting this out but the debugging does not terminate at the program's end. That aside, I managed to see the log file without doing any changes hahah. I noticed that at one point, the log file stated that the target halted at 0x00008579, which is corresponds to the .text section of my code's object file. Could this be an issue?

    Best regards,
    William

  • My code only consists of a for loop and an exit function. I realised that the exit function calls the abort function in exit.c, which has an infinite for loop.

    I'd simply update the DSS script to add a breakpoint at the location of the exit function or after the for loop. Once the target is halted, script execution will proceed.

    Thanks

    ki