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

Ability to restart DFU when interrupted while in DFUTarg

Sometimes during a DFU update, the NRF52811 can stay in bootloader mode (seen with name DFUTarg and mac_address equal tomac_address+1).
I am on Softdevice 16.0
I'm using the https://github.com/NordicSemiconductor/Android-DFU-Library.

To be able to resolve this situation, I imagine that it would be possible for this DFU library to recognize a previous DFU process failed, and restart the DFU process from here.

I have tried setting initiator.setNumberOfRetries(1) but it did not help.

Is there something I'm missing ? How can I implement this myself ? As I can connect to the mac_address+1, is there a command I can send to make it restart on normal mode ?

Parents Reply Children
  • Hi,

    QuentinFarizon said:
    What do you mean by "not a problem" ? How does it work in practice ?

    I mean you can connect again and try to update. There should not be any problems with that. Is there? 

    QuentinFarizon said:
    Is it supposed to also try to mac_address + 1  ?

    Yes, that is intentional. If you use the same old address and is bonded, the phone will attempt to encrypt the link. If you do not share bonding information between the app and bootloader, encryption will fail and the phone will disconnect. Therefor, the bootloader always increments the MAC address by 1 when you use a bootloader without bonding. (You should not take this as an incentive to use bonding with the bootloader unless you have a good reason to do so, as that introduces other problems, particularly if the bond is deleted on the phone after entering DFU mode on the device.).

    QuentinFarizon said:
    Or am I supposed to laucnh DFU on mac_address +1 when it fails on mac_address ?

    Yes. If not using bonding in the bootloader, you would have the "normal" address when in the application, so this is where you write to the DFU service to make the device start the bootloader and enter DFU mode. After that, you always need to use address + 1 in this case.

  • Thank you for your kind help and guidance.

    DFU process was able to proceed again successfuly, after having being able to connect to the PCB in bootloader "DfuTarg" mode. My code that scanned before connecting was still filtering by a custom service that was not available in bootloader mode.

Related