This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

S120 with bootloader issue

I am trying to write a bootloader that will work with the S120. Both the examples seem to only work with the S110, so they don't help much. I already have the binary I want to load in external flash, so I don't need to use the SoftDevice in the bootloader. I first wanted to make sure I could execute my application from the bootloader, but it doesn't seem to work. I have a single function call in the bootloader as follows:

__asm void StartApp(uint32_t start_addr) {

LDR   R2, [R0]               ; Get App MSP.
MSR   MSP, R2                ; Set the main stack pointer to the applications MSP.
LDR   R3, [R0, #0x00000004]  ; Get application reset vector address.
BX    R3                     ; No return - stack code is now activated only through SVC and plain interrupts.
ALIGN  

}

I pass in address 0x18000 for the start_addr. Whenever I call this function the bootloader just gets stuck in in the SVC_HAndler.

Can anyone tell me how to jump to my application from the bootloader?

Parents Reply Children
Related