I've got an mBed application that includes a softdevice (s132 - 2.0.1) that is installed at 0x00000-0x520000 and works as required. I created a test bootloader using the example "blinky" from the nRF52 SDK14 (no softdevice). I load this at 0x78000. When I erase the UICR, my mBed application starts as required. When I write 0x78000 to the BOOTLOADER_ADDR (0x10001014) and do a reset, my example "blinky" code starts. How do I pass control back to the mBed application once my bootloader code is finished? I don't want to use Nordic's DFU code is it is too bulky and too complex.
First question, when I set the BOOTLOADER_ADDR to 0x78000 to start my blinky bootloader, does the softdevice get started also? Note that the example "blinky" app from the NRF52 SDK14 does not include a softdevice.
Does anyone have any code that would allow me to jump to my mBed app (standard app with softdevice)? I've tried several things but each time my blinky bootloader gets restarted.
I've tried the simplistic approach:
void *ptr = (void *)0x1c000; goto *ptr;
But this does not work.
Lastly, I expected that if I set the BOOTLOADER_ADDR to 0x1000 or 0x1C000 (the start of my mBed application) and do a reset that it would start my mbed app, but it doesn't. I have to clear the BOOTLOADER_ADDR in the UICR to 0xffffffff to get it starting again.
Any insights would be greatly appreciated.