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
  • Hi AmbystomaLabs, The main vector table is still point into the softdevice vector table. Normally the softdevice will forward those interrupt that's available to the application to the application vector table, which is located at the start address of the application. sd_softdevice_vector_table_base_set() can change that and change the forward address to the address set in the call. Using this you can branch directly to the reset handler of the 2nd application you want to run.

    This is the same mechanism we used to jump from application to bootloader and vice versa in our legacy bootloader. (Check bootloader_app_start() function in the bootloader or bootloader_start() in buttonless application in SDK v11)

  • Hi Hung Bui,
    In case of not using softdevice is there anyway that I could change the vector table ????( I mean the softdevice and mbr are still there but I don't want to use the softdevice api)
    I'm thinking like after jumping to application and the application will do the sd_softdevice_vector_table_base_set.

  • Hi Hai Anh, 

    sd_softdevice_vector_table_base_set() should only be called in a bootloader. Unless you start your application as a bootloader (by writing the address to UICR /MBR ), you won't be able to use the function if the softdevice already started by the MBR. 
    Please create a new case if you have follow up questions. 

  • Hi Hung Bui,
    Thanks for your reply, I think I don't need to change the vector_table_base anymore I only need to put the new application to the application start address that match the memory layout (for s140 is 0x27000) so I think it will be fine.

    Best regards,

    AnhLe

Reply Children
No Data
Related