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

DFU bootloader fails second update

I have a created a bootloader using the bootloader_secure example in SDK 12.1. Using my own public-private key pair I've created two zip files, signed with nrfutil, one with the application firmware and one with the bootloader itself (if I ever want to update the bootloader).

I can update the application using DFU without issues. Bootloader update works as well using DFU the first time. The weird thing is if I try to update the same bootloader a second time, it does not work anymore. Application firmware can still be updated with DFU after this however, only the bootloader fails after the bootloader update.

So to make it more clear:

Update 1: application firmware = success

Update 2: application firmware = success

Update 3: bootloader = success

Update 4: bootloader = failure

Update 5: application firmware = success

Update 6: bootloader = failure

Update 7: application firmware = success

I did this with nRF Toolbox (failure here is progress bar showing and after the text "Starting DFU" everything goes away again with no error) and nRF Connect (failure here is "operation failed").

What I don't understand is that application firmware updates keep on working while bootloader updates only work the first time. So I'm sure the bootloader I updated the first time is still functional. I have the feeling that something is missing during or after the first bootloader update blocking any future bootloader updates.

Anyone else encountered something similar or an idea what is happening here?

Using SDK 12.1 and softdevice s132 3.0.0 .

Bootloader and application update files created using

nrfutil.exe pkg generate --bootloader bl.hex --key-file c:\vault\priv.pem --bootloader-version 0xffff --hw-version 52 --sd-req 0x81,0x88,0x8C bl_update.zip

nrfutil.exe pkg generate --application fw.hex --key-file c:\vault\priv.pem --application-version 0xffff --hw-version 52 --sd-req 0x81,0x88,0x8C fw_update.zip

image description

  • The bootloader update is only allowed when the version-number of the update is higher than the version on device. So for the first update you should set e.g. --bootloader-version 0x01 and for the second-update --bootloader-version 0x02. Of course you could also remove this check in the SDK's DFU code.

    Something similar I experienced in the past, but this doesn't seem to be your issue: If you do a combined Bootloader+SD+App-update on multiple devices without leaving the DFU screen, then the iOS nrf Toolbox App fails doing the bootloader update on the second device. Don't know if this bug still exists, but as said this is most likely not your problem.

  • Yes, the version checking is probably causing this. I thought that version 0xffff was used as wildcard and would be ignored, clearly it isn't. Not sure where I read that or where I got that from.

Related