Loading...
 
Skip to main content

System Workbench for STM32


Change application on Reset !

In cortex M0+ it's not BNE but BEQ

-> Suffix : EQ Flags : Z = 1 Meaning : Equal, last flag setting result was zero.

From The STM32L0 Cortex-M0+ instruction set 😊

So made this :

/* boot swap management */

ldr r4, =0x20000000 //load address of the value stored in .c
ldrb r5, r4 //load in r5 value stored in .c
ldr r6, =0xFEED0001 //to compare
cmp r5, r6 //compare value from .c (store in RAM) to r6 (fixed value)
beq SwapApp //if equal Reboot from App2
/* end of boot swap management */


ldr r0, =_estack
mov sp, r0 /* set stack pointer */
/* Copy the data segment initializers from flash to SRAM */
movs r1, #0

b LoopCopyDataInit

SwapApp:
ldr r0, =0x08023534
bx r0

 
Collapse/expand modules below