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

Where I can find the example of USBD DFU for PC side?

Hi,

I received my nrf52840 Dongle today. It works quite well using nrfConnect.

However, we need to implement our custom USB bootloader since the default USB bootloader provided is not securied (bin file is not encrypted). Also, I need to find a way to upload my own firmware using our software instead of nrfConnect.

I can see nrfConnect is using libUSB to do DFU transport. And nordic USB DFU is not standard DFU 1.1 compliant.

My question is,

1) where I can find an example to do such thing(eg, the example code to use libUSB to do uploading firmware to nrf52840 based on USB DFU?)

2) I will replace the dongle default bootloader with my custom bootloader. Before I am doing this, may I ask where I can find the default bootloader firmware for nrf52840 dongle in case I can restore my dongle? 

Thanks,

Vincent

  • Hi,

    What is the "standard DFU 1.1" that you refer to?

    There is no signing required for doing DFU using the on-board DFU solution, and it can only be used for downloading/updating SoftDevice and application. The bootloader is based on the Open Bootloader with DFU from SDK 15, which uses USB for transport. You can use that one as a starting point for your custom bootloader. Depending on what you need you may get away with just changing the configuration.

    Updating to an new bootloader requires connecting a programmer to the Dongle and program it the same way you would program our DKs.

    In order to backup the flash contents (including the bootloader) you can use nrfjprog with "nrfjprog --readcode backup.hex" for storing the flash contents in a hexfile named "backup.hex". Then you can program it back onto the Dongle at any later time if needed (with "nrfjprog --program backup.hex".)

    Regards,
    Terje

  • Hi Terje,

    Thanks a lot for your reply! I just found the example code to trigger DFU transfer in PC side. Also, it is open bootloader as your suggested. This nrf52840 dongle is really cool! I love it very much! :)

    Best regards,

    Vincent

Related