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.

TMS320F28379S: Debug Server Script (DSS): Why is readData always reading zero?

Guru 20045 points
Part Number: TMS320F28379S

Tool/software:

Please see attached CCS project (testDSSWS.zip) and DSS script (read_symbol_values.txt..you will need to change the extension to .js).  

The output of the script is shown below. 

>C:\ti\ccs1210\ccs\ccs_base\scripting\bin\DSS.bat read_symbol_values.js
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See www.slf4j.org/codes.html for further details.
=== Starting DSS Symbol Reader ===
Accessing scriptingEnvironment...
Debug server acquired.
Target configuration set.
Session opened for XDS2xx probe.
C28xx_CPU1: GEL Output:
Memory Map Initialization Complete

value
0
value
0
Finished reading all symbols.


if I uncomment the line containing "session.memory.writeData(Memory.Page.DATA, 50050, 195, 16)",  the script outputs the following:

>C:\ti\ccs1210\ccs\ccs_base\scripting\bin\DSS.bat read_symbol_values.js
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See www.slf4j.org/codes.html for further details.
=== Starting DSS Symbol Reader ===
Accessing scriptingEnvironment...
Debug server acquired.
Target configuration set.
Session opened for XDS2xx probe.
C28xx_CPU1: GEL Output:
Memory Map Initialization Complete

value
195
value
0
Finished reading all symbols.

testDSSWS.zip

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

print("=== Starting DSS Symbol Reader ===");

try {

    //Create the Scripting Environment Object
    var script = ScriptingEnvironment.instance();

    print("Accessing scriptingEnvironment...");
    var debugServer = script.getServer("DebugServer.1");
    print("Debug server acquired.");

    debugServer.setConfig("NewTargetConfiguration.ccxml");
    print("Target configuration set.");

    var session = debugServer.openSession("Texas Instruments XDS2xx USB Debug Probe_0/C28xx_CPU1");
    print("Session opened for XDS2xx probe.");

    session.target.connect();
    
    session.memory.writeData(Memory.Page.DATA, 50050, 195, 16)
    var value = session.memory.readData(Memory.Page.DATA, 50050, 16);

    print("value")
    print(value)

    var value = session.memory.readData(Memory.Page.DATA, 49152, 16);

    print("value")
    print(value)

    print("Finished reading all symbols.");

} catch (e) {
    print("Fatal error: " + e);
}

  • Hello,

    value
    0
    value
    0
    Finished reading all symbols.

    Assuming line 27 is commented out, the only issue I see here is that the first "0" should really be returned as "undefined" since "value" would not be defined. Once line 32 is executed, then value would be defined to "0" so the second "0" is correct.

    I see this when I run your script:

    I used CCS 12.8. I see you are using an older CCS version. Maybe that explains the discrepancy between your output and mine. 

    When you uncomment line 27, then the below output would be like the below:

    value
    195
    value
    0
    Finished reading all symbols.

    So that looks fine.