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

bootloader only works when firmware installed by dfu ota

I have compiled the bootloader and the application firmware with keil.

When I install the application firmware by means of the bootloader dfu ota.

The bootloader launches the application firmware correctly.

However if I install the application firmware by means of: nrfjprog.exe --reset --program application.hex --verify either directly or keil flash download

The bootloader does NOT launches the application firmware correctly.

Parents
  • A while back I noticed that any time I programmed my application FW using Keil or nrfjprog, and the chip had previously been upgraded with the bootloader, the chip would get "stuck" in the bootloader. What was happening was that when the chip was bootloaded, the bootloader calculated and stored the CRC of the application FW it programmed. When the bootloader runs after a reset, it recalculates the CRC of the application FW in memory. If this CRC doesn't match the one it stored on the previous bootloader it will not jump to your application.

    So, if you bootload a device and then later reprogram it with an external programmer you will see the problem you are having. So you either need to bootload the application again, or find a way to erase the CRC the bootloader has stashed away. I did the latter by reprogramming the bootloader when I reprogrammed the application.

Reply
  • A while back I noticed that any time I programmed my application FW using Keil or nrfjprog, and the chip had previously been upgraded with the bootloader, the chip would get "stuck" in the bootloader. What was happening was that when the chip was bootloaded, the bootloader calculated and stored the CRC of the application FW it programmed. When the bootloader runs after a reset, it recalculates the CRC of the application FW in memory. If this CRC doesn't match the one it stored on the previous bootloader it will not jump to your application.

    So, if you bootload a device and then later reprogram it with an external programmer you will see the problem you are having. So you either need to bootload the application again, or find a way to erase the CRC the bootloader has stashed away. I did the latter by reprogramming the bootloader when I reprogrammed the application.

Children
Related