Using SMP Server & MCUMgr for Serial DFU with USB CDC_ACM as the backend

Greetings,

I am currently working on our new product using nRF52840 and have succesfully inluded SMP Server in our application for the purpose of performing DFU using Serial and BLE OTA with great success (using this guide).

Now I would like to use the USB CDC_ACM as the physical layer/backend for the serial DFU so that instead of connecting via the UART RX/TX pins I can connect via the MCU USB port.

I have followed the documentation of SMP Server (selected the USB CDC_ACM tab and copied the contents of the overlay-cdc.conf & the usb.overlay files  to my projects prj.conf and cutom-board.dts) and the application builds with no errors but when flashed connecting a USB cable between our custom board and the PC it is not recognised as a device in Windows Device Manager.

Is there something I am missing regarding configuration options or the device tree.

Below I have provided code snippets of the .conf and .dts files of our application and the lines I added according to the Zephyr documentation of the SMP Server linked above (all other configuration options for the use of SMP Server are included in my files but I have not included them here because they are .

prj.conf

Fullscreen
1
2
3
4
5
6
# Enable USB subsystem
CONFIG_USB_DEVICE_STACK=y
CONFIG_SERIAL=y
CONFIG_UART_LINE_CTRL=y
# USB backend is serial device
CONFIG_MCUMGR_SMP_UART=y
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

custom-board.dts

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
/ {
chosen {
zephyr,uart-mcumgr = &cdc_acm_uart0;
};
};
zephyr_udc0: &usbd {
compatible = "nordic,nrf-usbd";
status = "okay";
};
&zephyr_udc0 {
cdc_acm_uart0: cdc_acm_uart0 {
compatible = "zephyr,cdc-acm-uart";
};
};
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Thank you very much for your time and I look forward to hearing from you.

Best regards,

Stavros Filippas

Parents
  • Hi Amanda,

    I am not looking for MCUBoot with serial recovery as I cannot enter bootloader mode using the serial recovery on our product/custom board as it does not have an reset button.

    I need to be able to perform DFU without entering bootloader mode via serial recovery, this is the reason we are currently using the SMP Server that is already integrated in our application and can perform Serial DFU (without entering bootloader mode using button presses) over the TX/RX lines while running the application.

    But I would like to use the USB CDC_ACM backend instead and not Serial UART TX/RX pins. Is this possible??

    The example you provided configures the MCUBoot itself to communicate via USB CDC_ACM not the SMP Server on my application.

    The configuration of the USB CDC_ACM should be on the .conf file of the application not the child_image mcuboot.conf file.

    Regards,

    Stavros

  • Hi Amanda,

    As I mentioned in my first message I have already tried those configurations, specificaly on how to build the application with USB CDC_ACM configs ( I have attached the same link that you sent me as well ).

    I have followed the documentation of SMP Server (selected the USB CDC_ACM tab and copied the contents of the overlay-cdc.conf & the usb.overlay files  to my projects prj.conf and cutom-board.dts) and the application builds with no errors but when flashed connecting a USB cable between our custom board and the PC it is not recognised as a device in Windows Device Manager.

    Is there any thing else I have to do to achieve this ? Any missing configuration options not mentioned in the documentation above that need to be enabled? What could cause this not to work?

    Thank you

    Regards,

    Stavros F.

  • Hi, 

    Which port do you connect the board and PC? nRF52840 has two USB ports, but only one has the CDC UART function. For example, the nRF USB port (J3) on nRF52840 DK only has the USB function instead of the CDC, you would use the USB port (J2) for CDC UART. 

    Regards,
    Amanda H.

  • Hello, I guess clockis wants to do his upgrade over USB with his custom board. Then it will be similar to nRF52840DK with only the J3 USB available. Could you explain how to do a buttonless upgrade over that J3 USB-interface?

Reply
  • Hello, I guess clockis wants to do his upgrade over USB with his custom board. Then it will be similar to nRF52840DK with only the J3 USB available. Could you explain how to do a buttonless upgrade over that J3 USB-interface?

Children
  • Hi, 

    See this  Device Firmware Update (DFU) with MCUBoot bootloader , but it's created by v1.4.1. It might be a little different from the new version of NCS. 

    -Amanda H.

  • Hi, the upgrade in the link you sent is still going over the J2 usb-to-serial interface, not over the J3 USB interface. Do you have an example of mcuboot dfu over the J3 USB interface?

  • Hi, really sorry for such a late reply unfortunately it was an extremelly busy period for me and wasnt able to respond, but after checking the SMP Server Sample again with an nRF52840DK and our custom board I was missing the usb_enable(); 

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    if (IS_ENABLED(CONFIG_USB_DEVICE_STACK)) {
    int rc = usb_enable(NULL);
    if (rc) {
    LOG_ERR("Failed to enable USB");
    return;
    }
    }
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    after adding this to our application everything worked smoothly as expected through the nRF52840 USB (the MCU USB not the USB-to-UART of the DK).

    Thank you very much for the support on this and again sorry for the inconvienience!

    Best regards,

    Stavros

  • I tried this Clockis and now the usb com appear. But mcumgr doesn't work.