DFU Zephyr using USB

Hello,

In my application I'm using NORA B106 and I would like to update the firmware using USB.

In my device there isn't any FTDI and I want to use the USB layer available in Zephyr.

Can you help me to understand what are the steps to implement the application?

I think that I need to : 

  • Enable the usb software module using Kconfig ( I found the following example)
  • Install the driver in Windows to recognize the device

Can I use Zadig?

I tried but no Virtual COM has been detected

  • Flashing the software using dedicated tool.

Thank you a lot for your support.

MP

Parents Reply
  • Hello Vidar,

    Thank you for feedback.

    I load your example where I added my board:

    But, during compilation I found some errors.

    In prj.conf

    In mcuboot.overlay

    Do you know the possible root cause?

    Thank.

    MP

Children
  • Hello,

    Did you build the project with an older SDK version? I tested it with v2.2.0, but v2.3.0 should work too. 

    Best regards,

    Vidar

  • I tried with version 1.9.

    Then, I will test it with newer version (2.2.0 I think) and I back.

    MP

  • Thanks for the update. Yes, this makes sense, the Kconfig symbol was not defined in SDK 1.9. 

  • Hello,

    Finally, I'm able to build using SDK 2.2.0.

    Then, I back on the current task and I build  the example shared to print "Hello World" after flashing.

    Based on this consideration, which software should be already uploaded in my device?

    Could be  USB CDC ACM Sample Application ?

    I suppose that, to perform the software update procedure , my device should be detected.

    Are correct my assumptions?

    Thank you again.

    MP

  • Hello,

    The USB interface will get enabled when the Bootloader enters the Serial recovery / DFU mode on startup. But you need a way to signal the bootloader to enter DFU mode. Otherwise, it will just proceed to boot the application as normal when you reboot the device.

    Do you have a button on your Board you can use to enter DFU mode? If you do, you can assign the button by adding and editing the following Kconfig symbols in child_image/mcuboot.conf:

    # Enter DFU mode if P0.23 is pulled low on startup
    CONFIG_BOOT_SERIAL_DETECT_PORT="GPIO_0" 
    CONFIG_BOOT_SERIAL_DETECT_PIN_VAL=0

    Here is where the bootloader decides whether to enter serial recovery mode or not:

    https://github.com/nrfconnect/sdk-mcuboot/blob/main/boot/zephyr/main.c#L574