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

Using openbootloader & softdevice to switch two app

Hi,

I's trying to implement switch two application firmware in the openbootloader example, but I meet some issue.

I change the sector to 0x27000 in App1, 0x40000 in App2, the bootloader is default to open the 0x27000 in softdevice S140, I change the vector to 0x40000 in the openbootloader.

Modify code as below:

in "brf_bootloader_app_start.c" :

line 76: nrf_bootloader_app_start(0x40000);

in "nrf_dfu_mbr.c"

line 84: uint32_t address = 0x40000;

But nrf52840 can't bootup with App2, how can I modify the bootloader to support this feature?

Thank you.

Parents
  • Hi

    As explained in this case, which seems to be very similar to yours, you can jump from the bootloader to your firmware with the following function:

    static sd_mbr_command_t init_sd_command = {SD_MBR_COMMAND_INIT_SD, };
    
    void jump_to_fw(uint32_t fwaddr)
    {
    	sd_mbr_command(&init_sd_command);
    	sd_softdevice_vector_table_base_set(fwaddr);
    	uint32_t app_start_ptr = ((uint32_t *)fwaddr)[1];  // get start address from vector table
    	((void (*)()) app_start_ptr) ();
    }

    Best regards,

    Simon

Reply
  • Hi

    As explained in this case, which seems to be very similar to yours, you can jump from the bootloader to your firmware with the following function:

    static sd_mbr_command_t init_sd_command = {SD_MBR_COMMAND_INIT_SD, };
    
    void jump_to_fw(uint32_t fwaddr)
    {
    	sd_mbr_command(&init_sd_command);
    	sd_softdevice_vector_table_base_set(fwaddr);
    	uint32_t app_start_ptr = ((uint32_t *)fwaddr)[1];  // get start address from vector table
    	((void (*)()) app_start_ptr) ();
    }

    Best regards,

    Simon

Children
Related