This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TMS570LS0914: IRQ Stack Pointer changes

Part Number: TMS570LS0914


Hello,

we are experiencing issues with the IRQ stack pointer.


After pogram initialization the IRQ SP points to address 0x08000600. (standard sys_core.asm)

At some point during program execution the pointer changes to address 0x08016b58.

We are using FreeRTOS and MPU.
One task does not have write access to the region, where the IRQ SP points to after it changed.
When an interrupt is executed and this task is active, this causes a data abort exception.

I am assuming that the interrupt mode inherits the MPU configuration of the active task. (Is this correct?)
If a different task is active during the interrupt, which has write access to the region, this does not cause a data abort.

We saw this issue multiple times during testing of some project using a debugger.
We are currently trying to find the root cause, which changes the IRQ Stack pointer.

Unfortunately the behavior seems random. Sometimes the data abort is caused after several hours, sometimes after 15min.

For debugging, I changed the value of the IRQ SP manually using a debugger.

Do you have any idea, what could cause a change to the IRQ stack pointer?

To my understanding, this is a separate CPU register. So even array overflows or invalid software in general, should not be able to cause this behaviour.
Even a stack overflow in the interrupts themselves, should not cause the IRQ SP to change to another value, after the interrupt is left.
Of course during execution of the interrupt, the stack pointer would decrease, as inner functions are called.

What could be the reason for this?


  • Hello Oliver,

    The interrupt stack pointer is defined during startup. The freeRTOS should switch to use the dedicated interrupt stack on entry to the interrupt service routine (ISR) which is defined in sys_core.asm. 

  • Hello,

    The stack pointer is correctly initializted at startup, as defned in sys_core.asm. We already checked at.

    The problem is, that this address changes at some point during program execution to an invalid address.

    >> The freeRTOS should switch to use the dedicated interrupt stack on entry to the interrupt service routine (ISR) which is defined in sys_core.asm.

    I think the exchange of the stack pointer from user SP to IRQ SP is automatically done by the processor and not by the operating system.

  • You are correct. It is processor which switches the stack pointer from task's stack to ISR stack. To be honest, I can’t explain why the stack pointer appears to be outside of the stack space defined in sys_core.asm.

    Do you know which ISR handler has this issue?