Re: LPCXpresso 8.1.4_606
I am having trouble debugging when inserting or activating breakpoints "live" (while the code is running).
I am reading data from a UART and putting it in an array. In normal operation, the values put in the array should never be 0. I have the following debug trap in my code:
if (data[0] == 0) {
NOP; //#define NOP __asm volatile("nop")
}
When I put a breakpoint at the NOP before starting the code, the breakpoint is never reached, indicating that the data extracted from the uart is correct. However, if I insert the breakpoint (or activate it by ticking a pre-inserted breakpoint's checkbox) while the code is running, the break is called immediately. When I look at the values in my array, they are all zeros!
When I use the suspend button to stop the code in an arbitrary place, my array is never filled with zeros. The zeros in the array appear to be unique to placing or activating a breakpoint while the code is running.
Can someone please explain this behavior?
afaik, when inserting a breakpoint 'live' the debugger does this by stopping the cpu, inserting the breakpoint and then restarting (without you seeing it do it!). Would this explain what you are seeing?