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

How to switch from own bootloader to application (using S120) above the bootloader

I have built an application using S120 v2.1.0. The app runs fines from 0x1d000. When I run an own bootloader (RS485, no need of interrupts or S120, no pstorage functions, etc) from 0x1d000, it runs fine too. It erases and flashes the app code beginning at startaddress 0x22000 (verified by reading back the flash through SEGGER J-Flash). The content of address 0x22000 is 20004000!

Unfortunately jumping from the bootloader to the app does not work. I put the MSP to 0x22000 and the PC to 0x22004. In general the jumpToApp function should work since the bootloader is running again if I enter 0x1d000 for jumptoApplication address (no jump to hardfault). What do I additionally have to take care for if I want to jump from bootloader at 0x1d000 to application flashed above the bootloader (i.e. compiler settings, redirection of vectors, MSP, etc.)?

  • A Hint: As long as I do not call device_manager_init() inside the application code, application is running (in a limited manner of course), started from the bootloader.

    So, it is not a matter of calling the application from the bootloader (that piece of code works obviously), but a matter of preparing compiler, bootloader, or application code to be able to run together with the softdevice.

Related