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

Simple SPI bootloader - jump not working

As it was asked here and an answer was given, but it's not working.

@Vidar: I've taken dual_bank_ble_s110 bootloader example and removed all the call I don't need, left is everything what's needed. Bootloader is started but application is not. It just "hangs" in "bootloader_util_app_start" function doing some weird stuff.

Any ideas?

int main(void)
 {
    uint32_t err_code;
        
    leds_init();

    // Initialize.
    timers_init();
    buttons_init();
		
	sd_mbr_command_t com = {SD_MBR_COMMAND_INIT_SD, };
    err_code = sd_mbr_command(&com);
    APP_ERROR_CHECK(err_code);
	
	scheduler_init();
		
    bootloader_util_app_start(CODE_REGION_1_START);
		
    NVIC_SystemReset();
}
Parents
  • I deleted this comment from my previous thread: "Think the SD_MBR_COMMAND_INIT_SD could work although the MBR is intended for use with the SD. This will forward the interrupts to the vector table above the MBR where the softdevice is typically located." Reason is that SD_MBR_COMMAND_INIT_SD doesn't only forward the interrupt, but also runs the reset handler of the Softdevice(application in this case) so it will not return back to the bootloader. The result is that the program will jump to the application, but interrupts will not be forwarded when issuing this command. Sorry for the misleading comment. If you don't want to use the existing bootloader examples with softdevice I'd recommend to design your own MBR that suits your use case as this MBR is designed for use with the softdevice.

Reply
  • I deleted this comment from my previous thread: "Think the SD_MBR_COMMAND_INIT_SD could work although the MBR is intended for use with the SD. This will forward the interrupts to the vector table above the MBR where the softdevice is typically located." Reason is that SD_MBR_COMMAND_INIT_SD doesn't only forward the interrupt, but also runs the reset handler of the Softdevice(application in this case) so it will not return back to the bootloader. The result is that the program will jump to the application, but interrupts will not be forwarded when issuing this command. Sorry for the misleading comment. If you don't want to use the existing bootloader examples with softdevice I'd recommend to design your own MBR that suits your use case as this MBR is designed for use with the softdevice.

Children
No Data
Related