bsps/arm: Set MSP in ARMv7-M start code

Set the Main Stack Pointer (MSP) to the ISR stack area end just in case
we run using the Process Stack Pointer (PSP).  This helps if
applications are started by a boot loader.
This commit is contained in:
Sebastian Huber
2021-04-16 07:50:21 +02:00
parent 51defd9274
commit 2a24f99d11

View File

@@ -553,6 +553,14 @@ _start:
#endif
ldr sp, =_ISR_Stack_area_end
/*
* Set the Main Stack Pointer (MSP) to the ISR stack area end just in
* case we run using the Process Stack Pointer (PSP).
*/
mov r0, sp
msr msp, r0
ldr lr, =bsp_start_hook_0_done + 1
b bsp_start_hook_0