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
  • Can't you just apply usual debugging techniques?
    Make sure your stack is adequately large. Check how much is used?
    Check for other interrupt sources, and if the debugger can disable them?

    Set R0 to 0x00FFFFFFF where? What would that point too? Executable code? What code?
    Getting any other faults? Hard Fault?

    Hard to see much of the surrounding context for the issue.

    Could you try a current version of Keil if you think it is a bug, theses type of things get addressed over time, perhaps the release notes mention the issue, or you can email your support contact?

Reply
  • Can't you just apply usual debugging techniques?
    Make sure your stack is adequately large. Check how much is used?
    Check for other interrupt sources, and if the debugger can disable them?

    Set R0 to 0x00FFFFFFF where? What would that point too? Executable code? What code?
    Getting any other faults? Hard Fault?

    Hard to see much of the surrounding context for the issue.

    Could you try a current version of Keil if you think it is a bug, theses type of things get addressed over time, perhaps the release notes mention the issue, or you can email your support contact?

Children