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

nRF5 DFU over-the-air bootloader prevents wired flashing

When we use nRF5 bootloader provided with SDK the first application flashing must always be done using DFU over-the-air. Only after that it is possible to re-flash application with a wire, using e.g. segger j-link. This applies both, nRF51 and nRF52, and at least SDK8 and SDK12.

This is a problem since when we flash our customer's devices, it is too slow to use DFU over-the-air. We want to do first flashing quickly with the wire.

I guess the bootloader checks existence of an application, and if it's not flashed using DFU over-the-air, it does not start application at all. Even if it is there, but flashed with a wire. How to go around this check, and where it is placed in the bootloader code?

Parents
  • That is due to the fact that the app valid flag & crc was not set. When loading with the debugger, it does not set the flag & crc which is located in the DFU section (0x7F000). By loading it via DFU, that flag & crc are set properly. Softdevice always jumps to DFU if it is there. DFU checks for those flags before jumping to app. If it's invalid, DFU stays in DFU. Your app never gets called. You'll never break at main.

Reply
  • That is due to the fact that the app valid flag & crc was not set. When loading with the debugger, it does not set the flag & crc which is located in the DFU section (0x7F000). By loading it via DFU, that flag & crc are set properly. Softdevice always jumps to DFU if it is there. DFU checks for those flags before jumping to app. If it's invalid, DFU stays in DFU. Your app never gets called. You'll never break at main.

Children
No Data
Related