USB DFU in SDK 2.0 or later

Hello,
Is there any documentation anywhere on USB DFU in SDK 2.0 or later?
I once implemented USB DFU in SDK 1.4, but it seems to be different from that time.

 Device Firmware Update (DFU) with MCUBoot bootloader 

I'm working with the readme.rst of zephyr/dfu in the sample project, but I can't seem to get dfu-util.exe to work.
Any hints would be appreciated.

The specification of exe in the upload file is intentional. This is because I am first checking to see if the device is recognized.

  • Hello,

    Did you build and program the USB DFU Sample Application to your board and did you connect to the nRF USB? Please note that the blog post you linked to is using the MCUmgr management protocol over SMP for DFU (SMP Server Sample), not the USB DFU Class driver that is compatible with 'dfu-util'.

    Best regards,

    Vidar

  • Hello Vidar,

    >did you connect to the nRF USB?

    Of course nRF USB is connected.(See attachment ).

    By the way, what does this error message mean?
    Cannot open DFU device 2fe3:0005 found on devnum 2 (LIBUSB_ERROR_NOT_SUPPORTED)

    How can I resolve this error?

  • Hi,

    Thanks for confirming. Have you also registered the driver as mentioned on the dfu-util homepage?

    "We offer binaries for Microsoft Windows and some other platforms. dfu-util uses libusb 1.0 to access your device, so on Windows you have to register the device with the WinUSB driver (alternatively libusb-win32 or libusbK), please see the libusb wiki for more details."

    https://dfu-util.sourceforge.net/

  • Hello Vidar,

    >Have you also registered the driver as mentioned on the dfu-util homepage?

    Thanks for info and I understood. I have installed WinUSB driver.

    (Sorry most of the displays are in Japanese. I think you can read it with Google Lens if you need to.)

    And dfu-util app seems to work fine.

      

    https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/samples/subsys/usb/dfu/README.html#usb-dfu-sample-application

    I am running it as described on this page, The USB DFU Sample Application is compiled and flashed. It seems to work well.

    Then the hello_world application with DFU options is also compiled.

    And so far, so good, but here I stumbled again. The file zephyr.signed.bin is not generated. Could this be because I am working with VSCode? I don't know.

    I checked and it seems that the dfu application also does not generate the zephyr.signed.bin file. How can this file be generated?

    I had no choice but to write various files that I thought were related to DFU. Then I was able to confirm that the firmware was updated by writing app_update.bin.

    All right! It works! But then, when I reset it, it displays revert and back to the previous firmware.

    What does this mean?
    Is it still wrong to write app_update.bin?

    Any hints would be appreciated.

  • Hello,

    app_update.bin is the correct file to use. But mcuboot will rollback to the previous version after reboot unless the application confirms the update through boot_set_confirmed() or is built with CONFIG_USB_DFU_PERMANENT_DOWNLOAD=y

1 2