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

Bootloader won't start the application when I change the application start address

I am using secure dfu bootloader from the SDK 12.

I changed the start address of my application. In the bootloader, in uint32_t nrf_dfu_init() { }, calling function nrf_bootloader_app_start(MAIN_APPLICATION_START_ADDR) with the new start address.

After I flashed the application, the bootloader goes to hard fault after executing the sd_mbr_command in:

uint32_t nrf_dfu_mbr_init_sd(void)
{
    uint32_t ret_val;

    sd_mbr_command_t command =
    {
        .command = SD_MBR_COMMAND_INIT_SD
    };

    ret_val = sd_mbr_command(&command);

    return ret_val;
}

This function was called by nrf_bootloader_app_start()

It seems that forwarding interrupts to SD fails for some reason, but I don't know why.

I would appreciate any sort of help to this problem. Thanks!

Parents
  • Hi,

    You should not see an issue within nrf_dfu_mbr_init_sd() because you have changed the start_addr, as it is not used that early. Referring to the implementation of nrf_bootloader_app_start() in nrf_bootloader_app_start.c for SDK 12.0.0, the start address parameter is only used in the subsequent calls to sd_softdevice_vector_table_base_set() and  nrf_bootloader_app_start_impl() which.

    How have you verified that there is a hard fault, and that it occurs during the call to nrf_dfu_mbr_init_sd()? Can you enable logging and upload the log?

  • Thank you for the answer

    I verified it debugging the Bootloader, the program never reaches the breakpoint after nrf_dfu_mbr_init_sd().

    I also wonder why this happens when I change the start address, since the address is not used before sd_softdevice_vector_table_base_set().

    Maybe another important behavior: when I change the start address only in Application .hex file and doesn't change the start address in the Bootloader, then the Bootloader executes these functions  ( nrf_dfu_mbr_init_sd(), sd_softdevice_vector_table_base_set()) and crashes  first in nrf_bootloader_app_start_impl().

    I am not able to enable log.

Reply
  • Thank you for the answer

    I verified it debugging the Bootloader, the program never reaches the breakpoint after nrf_dfu_mbr_init_sd().

    I also wonder why this happens when I change the start address, since the address is not used before sd_softdevice_vector_table_base_set().

    Maybe another important behavior: when I change the start address only in Application .hex file and doesn't change the start address in the Bootloader, then the Bootloader executes these functions  ( nrf_dfu_mbr_init_sd(), sd_softdevice_vector_table_base_set()) and crashes  first in nrf_bootloader_app_start_impl().

    I am not able to enable log.

Children
No Data
Related