Newbie question about SP, LR etc. values in debugger

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

Newbie question about SP, LR etc. values in debugger

Jump to solution
1,432 Views
sodacan
Contributor II

After having used KEIL's uVision IDE for decades, I've recently begun using MCUXpresso. While debugging and stepping through disassembly code, the way the SP, PC, LR, etc. values behave in the debugger's register window doesn't make sense to me. For example, when doing push or pop operations I expected the value of the SP to change, but it doesn't. Similarly, when looking at a memory monitor window centered around where the stack pointer is pointing, I expected to see values changing there when push operations occurred, but they don't. Is my expectation wrong, or am I [most likely] doing something wrong while stepping through this code, or is it something else?

FWIW, I'm using v11.4.1 [Build6260] of the IDE in a project for an imxrt1062 device.

Confused.

0 Kudos
Reply
1 Solution
1,405 Views
lpcxpresso_supp
NXP Employee
NXP Employee

There are several types of stepping and you do not mention which one you use. SP/PC/LR do update if the instructions being stepped actually have side effects on these registers. For example, in the screenshots below you can see the SP/PC values before and after executing a single step over the "push" instruction seen in Disassembly view. The memory area around SP value also gets updated. Note that I activated single stepping using the highlighted icon from Debug view.

lpcxpresso_supp_0-1669024851501.png

lpcxpresso_supp_1-1669024914238.png

Regards,
MCUXpresso IDE Support

 

 

View solution in original post

0 Kudos
Reply
4 Replies
1,376 Views
funbotix
Contributor I

How can I mark this as closed?

0 Kudos
Reply
1,403 Views
funbotix
Contributor I

Thanks for the replies. When I step over ASM instructions such as push/pop the value for SP in the registers windows does not change, nor does the memory it points to. I appreciate your response. Not sure what to do next. I'll assume it's some kind of user error on my end. Thanks.

0 Kudos
Reply
1,406 Views
lpcxpresso_supp
NXP Employee
NXP Employee

There are several types of stepping and you do not mention which one you use. SP/PC/LR do update if the instructions being stepped actually have side effects on these registers. For example, in the screenshots below you can see the SP/PC values before and after executing a single step over the "push" instruction seen in Disassembly view. The memory area around SP value also gets updated. Note that I activated single stepping using the highlighted icon from Debug view.

lpcxpresso_supp_0-1669024851501.png

lpcxpresso_supp_1-1669024914238.png

Regards,
MCUXpresso IDE Support

 

 

0 Kudos
Reply
1,416 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

Hi

When I use MCUXpresso v11.6.1 debug code, I can see registers change when I step over the code. see below in register window

ZhangJennie_0-1668583022947.png

 

Could you please let me know how to reproduce your problem?

Thanks,

Jun Zhang

0 Kudos
Reply