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

NRF52 Bootloader Switch Between Applications

Hello,

I am using the nrf52832 bootloader and i got it working with the s112 sofdevice and a custom application mapped at the end of the softdevice. 

I want to add another application (between my first application and the bootloader). And i want to modify the bootloader to choose whether to jump to the first application or the seconde one. 

The mapping of my flash is as follows:

Softdevice address : 0x0 - 0x18fff

Application 1 : 0x19000 - 0x3fff

Application 2 : 0x40000 - 0x5fff

Bootloader : 0x60000 - 0x7dff

Is there any way i can change the start address from the Bootloader before jumping into it ?

Thank you for your help.

Parents
  • Hi,

    you can jump from bootloader to your firmware with this 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) ();
    }
    

  • Thank you for the answer. 

    I was already doing that. But i was also forwarding interrupts to the start address of my application using the SD_MBR_COMMAND_IRQ_FORWARD_ADDRESS_SET command. 

    So the jump to the application was being executed successfully but the application was crashing after calling nrf_sdh_enable_request(). 

    So after removing the forward command, the application launched without any problem. 

Reply
  • Thank you for the answer. 

    I was already doing that. But i was also forwarding interrupts to the start address of my application using the SD_MBR_COMMAND_IRQ_FORWARD_ADDRESS_SET command. 

    So the jump to the application was being executed successfully but the application was crashing after calling nrf_sdh_enable_request(). 

    So after removing the forward command, the application launched without any problem. 

Children
No Data
Related