This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Stack pointer gets corrupted in debugger

Hi everyone

I am usinng the NXP KL43L256Z4 Cortex M0+, compiler MDK-ARM uVision V5.25.2

When I am in a breakpoint, I change any register value (ex. R6 = 0xFFFFFF), in the next step the Stackpointer R13(SP), gets always the 0xFFFFFFFC value, does not matter where point in the program it is.

Current values:

R13(SP) = 0x1FFFE460
R0 = 0X000000

Breakpoint                CPSID   I               ; Mask interrupts
                LDR     R0, =SystemInit
                BLX     R0

Here I insert into R0, 0XFFFFFF

in this moment the SP become: R13(SP) = 0x1FFFFFFC

Somebody saw somthing like it? It is a KEIL error?

Parents
  • Firstly thank you.

    The point it is, when I change the value maunaly in any register from R0 to R12 (it is part of my software tests...), the Stack pointer change yours value to 0x00FFFFFFC.

    The SP should never change its value when writing in another register! The stack is adequately large, and I have only one break point.

    No matter what point of the code I am, any line that I am debugging when I write in a registry manualy, I get this error.

    The code compile correcty, without other faults. Now I will try to use the current Keil version for test, but the version that I have is safety certificate.

Reply
  • Firstly thank you.

    The point it is, when I change the value maunaly in any register from R0 to R12 (it is part of my software tests...), the Stack pointer change yours value to 0x00FFFFFFC.

    The SP should never change its value when writing in another register! The stack is adequately large, and I have only one break point.

    No matter what point of the code I am, any line that I am debugging when I write in a registry manualy, I get this error.

    The code compile correcty, without other faults. Now I will try to use the current Keil version for test, but the version that I have is safety certificate.

Children