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

Jumping Between Applications

hey guys i want to implement two separate application programs on the same chip.

Say Application1 is stored in address start_address1 to end_address2 and Application2 is stored in address start_address2 to end_address2.

can i just directly jump to one application to another ? i am used to using this on simpler microcontroller, can i do this in the NRF52 too?

void JumpToApp(void) {

void (*fptr)(void);
fptr = (void (*)(void))APP1_RESET_ADDRESS;
fptr();

}

thanks.

Parents
  • The nRF devices just have ARM processors at their core, so functionally you can always look up the opcode for moving the PC to where ever you want and put the opcode in your application code. In this manner, you can easily switch from one application to another.

    Based on the product spec they do not provide a way to permanently change the boot vector. Likely because this could get messy since the SD and MBR always sit at 0x0.

    I would suggest you just nestle the two applications together. In C this is pretty straightforward since most programs operate as a series of handlers calling various functions. Having the programs together as one will make your life easier down the road as all the nordic apps are geared around 1 SD, 1 app, 1 DFU/bootloader.

    If you don't like the idea of putting them together in one C project, then concatenate them after compilation and just allocate the memory yourself using the ROM settings in the compiler. Then it is still one app and the first app just switch boots to the second.

Reply
  • The nRF devices just have ARM processors at their core, so functionally you can always look up the opcode for moving the PC to where ever you want and put the opcode in your application code. In this manner, you can easily switch from one application to another.

    Based on the product spec they do not provide a way to permanently change the boot vector. Likely because this could get messy since the SD and MBR always sit at 0x0.

    I would suggest you just nestle the two applications together. In C this is pretty straightforward since most programs operate as a series of handlers calling various functions. Having the programs together as one will make your life easier down the road as all the nordic apps are geared around 1 SD, 1 app, 1 DFU/bootloader.

    If you don't like the idea of putting them together in one C project, then concatenate them after compilation and just allocate the memory yourself using the ROM settings in the compiler. Then it is still one app and the first app just switch boots to the second.

Children
No Data
Related