Add watchpoint to stackpointer

cancel
Showing results for 
Search instead for 
Did you mean: 

Add watchpoint to stackpointer

Jump to solution
503 Views
Contributor III

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:
pastedImage_2.png

2. Want to add Watchpoint, didn't work! - No option for "Add Watchpoint"
pastedImage_3.png

Add Watchpoint works for Variables:

pastedImage_5.png

1 Solution
22 Views
Senior Contributor III

It is not possible to watch registers on Cortex-M cpus.

this thread may be of interest

https://community.nxp.com/thread/428355 

View solution in original post

4 Replies
23 Views
Senior Contributor III

It is not possible to watch registers on Cortex-M cpus.

this thread may be of interest

https://community.nxp.com/thread/428355 

View solution in original post

22 Views
Contributor III

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 !!!

pastedImage_5.png

0 Kudos
22 Views
Senior Contributor III

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.

22 Views
Contributor III

Thank you for your explanation.
Now I understand how this mechanism works!

0 Kudos