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.

CCS/MSP-EXP432P4111: DDS: how to readData ?

Part Number: MSP-EXP432P4111
Other Parts Discussed in Thread: CCSTUDIO

Tool/software: Code Composer Studio

on Linux 16.04 and CCS Version: 8.0.0.00016, MSP-EXP432P4111

I started from a register level project of the MSP432 SDK and changed main.c like so:

#include "msp.h"
uint16_t testResult = 0;
void main(void)
{
    uint8_t count = 0;
    WDT_A->CTL = WDT_A_CTL_PW | WDT_A_CTL_HOLD;		// stop watchdog timer

    while (1)
    {
        count++;
        if (count == 3)
        {
            testResult = 1;
        }
    }
}

And I use the following DDS script:

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

var deviceCCXMLFile = "/home/p/repo/microbrix/MSP432P4111-exp2/gpio3/targetConfigs/MSP432P4111.ccxml";
var programToLoad = "/home/p/repo/microbrix/MSP432P4111-exp2/gpio3/Debug/gpio3.out";
var script = ScriptingEnvironment.instance();
script.traceBegin("gpio2.xml", "/home/p/ti/ccsv8/ccs_base/scripting/examples/DebugServerExamples/DefaultStylesheet.xsl");
var debugServer = script.getServer("DebugServer.1");
debugServer.setConfig(deviceCCXMLFile);

try {
  debugSession = debugServer.openSession("Texas Instruments XDS110 USB Debug Probe", "CORTEX_M4_0");
  debugSession.target.connect();
} catch (ex) {
  script.traceWrite("could not connect to target");
}

try {
  debugSession.memory.loadProgram(programToLoad);
} catch (ex) {
  script.traceWrite("loadProgram failed: " + ex);
}

var Break_Point_properties = debugSession.breakpoint.createProperties(1);
Break_Point_properties.setString("Hardware Configuration.Type", "Watchpoint");
Break_Point_properties.setString("Hardware Configuration.Type.Location", "&testResult");
Break_Point_properties.setString("Hardware Configuration.Type.Memory", "Write");
debugSession.breakpoint.add(Break_Point_properties);
var address = debugSession.symbol.getAddress("testResult");
var testResult = debugSession.breakpoint.add(address)

script.traceWrite("run ...");
try {
  debugSession.target.run();
} catch (ex) {
  script.traceWrite("run failed: " + ex);
}


var address = debugSession.symbol.getAddress("testResult")
try {
  var data = debugSession.memory.readData(0, address, 16)
  script.traceWrite(data);
} catch (ex) {
  script.traceWrite("readData failed: " + ex);
}
try {
  debugSession.target.disconnect();
} catch (ex) {
  script.traceWrite("disconnect failed: " + ex);
}
debugSession.terminate();
debugServer.stop();
script.traceWrite("finished successfully");

I then run the script and get an error when reading the variable testResult.

❯ dss.sh run.js
CORTEX_M4_0: GEL Output: Memory Map Initialization Complete

CORTEX_M4_0: GEL Output: Halting Watchdog Timer

run ...
SEVERE: CORTEX_M4_0: Trouble Reading Memory Block at 0x20000004 on Page 0 of Length 0x2

SEVERE: Errors during memory.readData(): Address: 0x20000004 Error: 0x80000
SEVERE: Error reading memory: Errors during memory.readData(): Address: 0x20000004 Error: 0x80000
readData failed: JavaException: com.ti.ccstudio.scripting.environment.ScriptingException: Error reading memory: Errors during memory.readData(): Address: 0x20000004 Error: 0x80000
SEVERE: CORTEX_M4_0: Failed to remove the debug state from the target before disconnecting.  There may still be breakpoint op-codes embedded in program memory.  It is recommended that you reset the emulator before you connect and reload your program before you continue debugging

Regards

Peter

**Attention** This is a public forum