Hi Nordic Team,
I am using MCUBoot with BLE DFU on nRF5340 and I am facing an issue where the DFU process cannot complete due to my application’s custom boot logic.
After chipset power-on, my application determines the boot mode based on the power-on reason and button state:
-
Accidental / short press power-on
→ The device immediately enters deep sleep to avoid unintended wake-up. -
Button long-press
→ Normal application startup. -
Charger insertion detected
→ Enter charging-only mode.
This logic works well for normal usage, but it conflicts with DFU.
Problem
During MCUBoot BLE DFU, I found the device needs to reboot multiple times without the above boot logic .
However, after each reboot, my application treats the reset as a normal power-on event and re-enters the “accidental boot → sleep” path.
As a result:
-
The DFU process is interrupted.
-
The new image cannot be confirmed.
-
DFU may loop indefinitely or fail completely.
In short, DFU-triggered reboots are incorrectly handled as user power-on events by the application logic.
Question
What is the recommended way on Nordic platforms to distinguish DFU-related reboots from normal power-on / user-triggered boots, so that the application does not enter sleep or charging-only mode during DFU? Is using GPREGRET / reset-retention registers the recommended approach to mark “DFU in progress” across reboots?
Any guidance or reference designs would be greatly appreciated.
Best Regards!
Ben