I am using CCS 5.0.3 scripting console in order to asynchronously (from the debugger point of view) read/write a c66xx's memory. A javascript program is loaded via LoadJSfile and then invoked by calling its "main" when needed on the scripting console. It simply opens a TCP socket over which a PC-based program issues read/write requests (which is what makes it "asynchronous" to the debug session).
The following is the function that is used to read the memory:
function MemRead(addr, wordSize, wordCnt)
{
var result;
var successful = 0;
if (!activeDS.target.isHalted()){
// This command halts the target in order to allow memory reads
activeDS.target.halt();
}
while (! successful) {
try {
result = activeDS.memory.readData(0, addr, wordSize * 8, wordCnt);
successful = 1;
}
catch(err)
{
print ("Memory read failed. sleep and retry");
java.lang.Thread.sleep(1000);
}
}
return result;
}
Everything works well if the debug session is idle. However, if the C66xx is single stepped, eventually the activeDS.memory.readData() will fail catastrophically while logging the following error to the scripting console.
Error reading memory: Errors during memory.readData(): Address: 0x######## :Error: 0x2000000
Note that I have both "Halt the target before any debugger access (will impact servicing of interrupts" enabled in the generic debugger options, and have the programmatic halt activeDS.target.halt() in MemRead to no avail.
This causes the tcp server running in the scripting console to terminate, which seriously breaks the program connected via tcp. Obviously, the try/catch doesn't work.
- What does error 0x2000000 mean? (I blanked out the address, it is a valid, readable address that varies among the addresses the tcp application might read)
- Is there anything other than try/catch that could prevent catastrophic termination? Retrying the read is fine, the tcp application won't care.