I would like to add a watchpoint to the stackpointer to monitor the maximum level of the stack.
The following solution didn't work for me (LPCXpresso 8.2.2, Hardware LPC54102):
How to use Watchpoints
I can attach watchpoints to variables but not to the CPU registers.
1. Add Watch for Stack Pointer:
2. Want to add Watchpoint, didn't work! - No option for "Add Watchpoint"
Add Watchpoint works for Variables:
Solved! Go to Solution.
It is not possible to watch registers on Cortex-M cpus.
this thread may be of interest
It is not possible to watch registers on Cortex-M cpus.
this thread may be of interest
Thank you for your response.
I already saw the article Monitoring Stack Size
This works for me.
However, I was mislead by the article How to use Watchpoints
This article documents that it should be possible to use Watchpoints on the Stackpointer on ARM CPUs !!!
It doesn't say that at all.
The document states "Since watchpoint 'watch' access to memory...". I.e. It works on memory. So this example is watching a write to address 0x10007D000. I guess they chose this address in case the stack grows that large.
Thank you for your explanation.
Now I understand how this mechanism works!