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

How to jump into app from bootloader

hi,everyone. version:sdk10.0 i know the nrf51822 system running order is: softdevice->bootloader->app.But i have a question when i am reading bootloader. If the program is running properly, it will be executed here. image description

when program is running to here, whats meaning of the "CODE_REGION_1_START(#define SD_SIZE_GET(baseaddr) (*((uint32_t *) ((baseaddr) + SD_SIZE_OFFSET))))", i can't find the address? and then i find the program execute asm code.i guess finsh this asm code,jump here to app?

image description

now ,who can speak here how to understand code? thanks !

  • Hi Jaro,

    CODE_REGION_1_START is where the code region 1 start :)

    You can read more about code regions at chapter 8 UICR in the nRF51832 reference manual.

    Originally the softdevice and the MBR are resided in Code Region 0 and the application, bootloader, swap bank are in Code Region 1.

    Earlier we protect the softdevice by cover it inside code region 0 by writing to UICR. But it will cause problem when we need to update a new softdevice with bigger size. So we stop doing that and now there is only one region.

    Because of that what we do is to use the information from inside the softdevice to get to know the size of the softdevice instead of reading the UICR CLENR0.

    But in the bootloader we still calling that code region 0, and application start from code region 1, it's just the legacy of the naming from previous approach.

Related