From 0806c09a441447d9d145af7f2d01e3f01271a96d Mon Sep 17 00:00:00 2001 From: dxl <64101226@qq.com> Date: Tue, 7 Mar 2023 18:39:15 +0800 Subject: [PATCH] Fix the bug that can't restart the firmware burning when the device power lost. --- .../libraries/bootloader/nrf_bootloader_fw_activation.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/resource/nrf52_sdk/components/libraries/bootloader/nrf_bootloader_fw_activation.c b/resource/nrf52_sdk/components/libraries/bootloader/nrf_bootloader_fw_activation.c index 364f21c..e7a619f 100644 --- a/resource/nrf52_sdk/components/libraries/bootloader/nrf_bootloader_fw_activation.c +++ b/resource/nrf52_sdk/components/libraries/bootloader/nrf_bootloader_fw_activation.c @@ -403,6 +403,11 @@ nrf_bootloader_fw_activation_result_t nrf_bootloader_fw_activate(void) break; case NRF_DFU_BANK_INVALID: default: + // When updating the firmware by USB-SERIAL, if the device is powered off, + // the situation described in the following website link will occur. At this time, our solution is to add the following line of code, + // The current test can solve the problem and will not affect the OTA process of USB+BLE + // https://devzone.nordicsemi.com/f/nordic-q-a/79864/usb-ble-bootloader-stuck-unable-to-dfu-after-dfu-process-was-interrupted + nrf_dfu_settings_progress_reset(); // Add this line of code to reset the OTA progress and make it restart OTA NRF_LOG_INFO("No firmware to activate."); return ACTIVATION_NONE; }