adafruit / Adafruit_nRF52_Bootloader

USB-enabled bootloaders for the nRF52 BLE SoC chips
MIT License
438 stars 393 forks source link

[Bug] Stuck in UF2 DFU mode forever when USB not connected #188

Closed glenne closed 3 years ago

glenne commented 3 years ago

Describe the bug The 0.4.0 release notes state

The Reset into application without USB connection does not work.

Set up

To Reproduce Steps to reproduce the behavior:

  1. Disconnect USB
  2. From application, execute the following to enter UF2 mode (or use some super secret button combo)
  NRF_POWER->GPREGRET = 0x57;  // UF2 DFU mode
  sd_nvic_SystemReset();
  1. Wait for application to restart when no USB connection is established

At this point, the application is stuck in DFU mode forever. It does not 'time out' after 3 seconds (or 300 seconds)

Expected behavior The device should restart in application mode after 3 seconds if no USB connection.

Additional context My device is embedded inside an enclosure without access to the reset button, tricky double button presses, triple clicks and so forth. It does have a way though via a user input to initiate UF2 mode to allow upgrades. Without a timeout of any kind once DFU mode is entered, the only option a user has is to either wait many days for the battery to go dead or to crack open the enclosure to get access to the reset button.

I was looking forward to using the UF2 update mode provided in 0.4.0 so am disappointed I cannot move to 0.4.0 without some sort of timeout if an update is not successfully completed.