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

Device reboots into DFU Mode after App Update

Hello,

I am having an issue with the DFU in SDK V12. Using the secure_dfu package, and the buttonless dfu app as a template, I was able to get OTA DFU application updates working with the development kit. However, the same cannot be said about running the same application with custom hardware.

After running the DFU update on the Development Kit, everything runs as expected. The device resets, and launches the application; the DFU control point is visible to reset the device and boot back into DFU mode.

On the other hand, with our custom hardware. The device reports |DFU| Upload Completed in (#####) ms, but then after the reset boots right back into DFU mode.

After checking the hardware compatibility matrix, I know our chip is the same revision as the one on the pca10040 DK we were using for testing.

My suspicion is that the BANK_0 value for a valid app is not being set upon DFU completion, but I can't make any sense out of why that would fail to occur.

Has anyone else seen a failure to launch an app after DFU update with SDK12.0 and/or SDK12.1?

Here is the output from the flash after performing DFU: hex_dump.txt

Parents
  • Hi Bjørn,

    The code is instead entering the if statement just before at line 119:

    ```
    if(enter_bootloader_mode != 0 || !nrf_dfu_app_is_valid())
    {
        timers_init();
        scheduler_init();
    
        // Initializing transports
        ret_val = nrf_dfu_transports_init();
        if (ret_val != NRF_SUCCESS)
        {
            NRF_LOG_INFO("Could not initalize DFU transport: 0x%08x\r\n");
            return ret_val;
        }
    
        (void)nrf_dfu_req_handler_init();
    
        // This function will never return
        NRF_LOG_INFO("Waiting for events\r\n");
        wait_for_event();
        NRF_LOG_INFO("After waiting for events\r\n");
    }
    ```
    

    This is because the nrf_dfu_enter_check() is passing, and the enter_bootloader_mode flag is being set to 1. To confirm, this is right after a DFU update, and that flag should not be set.

Reply
  • Hi Bjørn,

    The code is instead entering the if statement just before at line 119:

    ```
    if(enter_bootloader_mode != 0 || !nrf_dfu_app_is_valid())
    {
        timers_init();
        scheduler_init();
    
        // Initializing transports
        ret_val = nrf_dfu_transports_init();
        if (ret_val != NRF_SUCCESS)
        {
            NRF_LOG_INFO("Could not initalize DFU transport: 0x%08x\r\n");
            return ret_val;
        }
    
        (void)nrf_dfu_req_handler_init();
    
        // This function will never return
        NRF_LOG_INFO("Waiting for events\r\n");
        wait_for_event();
        NRF_LOG_INFO("After waiting for events\r\n");
    }
    ```
    

    This is because the nrf_dfu_enter_check() is passing, and the enter_bootloader_mode flag is being set to 1. To confirm, this is right after a DFU update, and that flag should not be set.

Children
No Data
Related