2024-03-26 02:57 AM
Hello,
I'm a bit confused about stack management on Cortex M7.
In my SW I only use the MSP.
I understood that the MSP can only be modified with a MSR instruction. However the SP can be modified with a "simple" LDR instruction.
Does that mean that when I do a ldr sp, =xxx (with CONTROL.SPSEL = 0) it modifies not only the SP register but also the MSP register ?
Since I use only MSP, is there a difference between setting the SP with a LDR and setting the MSP with a MSR ?
2024-03-26 06:48 AM
Instruction ldr sp .... relates to the current SP, whatever it is msp or psp.
If you are sure that the active SP is msp, no need to use msr.