I am trying to halt when a particular memory location gets set to a specific value. I'm not looking for a particular variable to change, but rather a word in the stack.
I know how to set a watchpoint to break on write access. That works fine, but it halts very frequently and I need it to halt only when a specific, invalid value is written.
I tried to add a "condition" to the memory access watchpoint, but this makes it either run so slowly that it never finishes timer interrupt handling, or it just locks up the debugger ("stop debugging" button in PSoC Creator button is ineffective). I read something about modifying the linker file to place a variable at a specific location, then watch that variable for changes, but I'm not clear on how that's different nor exactly how to do it.
This is the watchpoint condition I am using:
(*((volatile unsigned long *)0x20007b18))==0x00002b4F
Is there another way to do this? Is this slow behavior a bug in PSoC Creator, or maybe a limitation of the Cortex-M3?
That is an interesting idea. I will need to look at how the "register" directive gets implemented. I think this will change the code and not really let me watch the particular memory address I need to monitor.
Do you know if the Arm Cortex-M3 does data value checking in hardware (built into the CPU), or does the debugger itself need to read memory after the breakpoint is hit and decide to continue or halt?