Add watchpoint to stackpointer

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Add watchpoint to stackpointer

Jump to solution
1,352 Views
simonwyss
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
871 Views
converse
Senior Contributor V

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
872 Views
converse
Senior Contributor V

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

this thread may be of interest

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

871 Views
simonwyss
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
871 Views
converse
Senior Contributor V

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.

871 Views
simonwyss
Contributor III

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

0 Kudos