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?