[HTG] DFU Recovery Bootloader (nRF52840 Only)
Summary
In the event of a failed firmware flash or failed boot post-flash, nRF52840-based devices may fall back into UF2 mode.
This mode presents the board as a USB mass-storage device, to which you can upload a pre-compiled .uf2 firmware file to recover and boot the device normally again.
This may be undesirable under some scenarios where the USB port is difficult to access, such as when the node is mounted up high or on a rooftop.
To solve this, you can flash an alternative bootloader-only image, which will instead boot the node back into DFU mode in the event of a failure. This can then facilitate a reflash attempt over Bluetooth. Once the bootloader is installed, you can then flash or re-flash MeshCore over the top of it as normal (the bootloader will be retained).
You can read more about the OTA fix bootloader on the GitHub repository.
Prerequisites
- This bootloader applies to nRF52840-based boards only
- You will need a mobile device with the nRF Device Firmware Update app installed
- Play Store: https://play.google.com/store/apps/details?id=no.nordicsemi.android.dfu
- App Store: https://apps.apple.com/au/app/nrf-device-firmware-update/id1624454660
Process
There are multiple ways to flash the bootloader, choose the most convenient method for you below.
Note: if your device already has MeshCore installed your configuration will be retained. Regardless, always take a backup before flashing.
Method 1 - UF2 Mode
- Browse to the GitHub Releases page for the OTA fix bootloader, and download the .uf2 file for your board.
- Connect the board to a computer and place the board into UF2 boot mode. Refer to the board documentation for instructions on how to do this. Usually, double-clicking the board's reset button will do it. Confirm that the board appears as a storage device.
- Copy the file to the storage device. The board will reboot automatically after the transfer completes, and should enter DFU mode.
- Open the nRF Device Firmware Update app on your mobile device and flash the MeshCore firmware image as normal.
Method 2 - DFU Mode
- Enter DFU mode on the board. Refer to the board documentation for instructions on how to do this.
- Browse to the GitHub Releases page for the OTA fix bootloader, and download the .zip file for your board.
- Flash the bootloader onto the device using the nRF Device Firmware Update app.
- Wait for the device to reboot back into DFU mode, then open the nRF Device Firmware Update app on your mobile device and flash the MeshCore firmware image as normal.