Running Multiple USB CDC ACM ports simultaneously

Is it possible to emulate COM 4 ports over nRF USB using CDC ACM device class? I was able to get 3 working but when I added 4th one it didn't worked out. Is there any

limitation in the hardware or software side for the same?

My dts overlay looks like,

/ {
chosen {
zephyr,console = &cdc_acm_uart0;
};
};

&zephyr_udc0 {
cdc_acm_uart0: cdc_acm_uart0 {
compatible = "zephyr,cdc-acm-uart";
label = "CDC_ACM_0";
};

cdc_acm_uart1: cdc_acm_uart1 {
compatible = "zephyr,cdc-acm-uart";
label = "CDC_ACM_1";
};

cdc_acm_uart2: cdc_acm_uart2 {
compatible = "zephyr,cdc-acm-uart";
label = "CDC_ACM_2";
};

cdc_acm_uart3: cdc_acm_uart3 {
compatible = "zephyr,cdc-acm-uart";
label = "CDC_ACM_3";
};
};

As soon as I added the definition of cdc_acm_uart3 in the overlay, it just stop working. No COM Port is visible.

 

SoC: nRF52840

OS: Windows 11

Platform: NCS v2.8.0

This is based on zephyr cdc acm example which you can find github.com/.../cdc_acm

Thanks in Advance!

Parents Reply Children
  • Hi  

    This doesn't help. Are you aware of any such limitations of emulating multiple COM ports?

    I'm using following usb conf,

    CONFIG_STDOUT_CONSOLE=y
    CONFIG_USB_DEVICE_STACK=y
    CONFIG_USB_DEVICE_PRODUCT="Zephyr CDC ACM sample"
    CONFIG_USB_DEVICE_PID=0x0001
    # CONFIG_USB_DRIVER_LOG_LEVEL_ERR=y
    # CONFIG_USB_DEVICE_LOG_LEVEL_ERR=y
    CONFIG_SERIAL=y
    CONFIG_CONSOLE=y
    CONFIG_USB_CDC_ACM=y
    CONFIG_UART_INTERRUPT_DRIVEN=y
    CONFIG_UART_LINE_CTRL=y
    CONFIG_USB_DEVICE_INITIALIZE_AT_BOOT=y

    Regards,

    Mayank

  • I changed back the console to uart, got this error output which says failed to enable usb, I think thats why I'm not able to see any COM port.

    *** Booting nRF Connect SDK v2.8.0-a2386bfc8401 ***
    *** Using Zephyr OS v3.7.99-0bc3393fb112 ***
    [00:00:00.363,525] <inf> cdc_acm_echo: Starting App...
    [00:00:00.363,586] <err> usb_nrfx: invalid endpoint index/address
    [00:00:00.363,586] <err> usb_nrfx: invalid endpoint index/address
    [00:00:00.363,586] <err> usb_nrfx: invalid endpoint index/address
    [00:00:00.363,616] <err> usb_nrfx: invalid endpoint index/address
    [00:00:00.363,616] <err> usb_nrfx: invalid endpoint index/address
    [00:00:00.363,616] <err> usb_nrfx: invalid endpoint index/address
    [00:00:00.363,647] <err> usb_nrfx: invalid endpoint index/address
    [00:00:00.363,647] <err> usb_descriptor: Failed to validate endpoints
    [00:00:00.363,647] <err> usb_descriptor: Failed to fixup USB descriptor
    [00:00:00.363,647] <err> usb_device: Failed to configure USB device stack
    [00:00:00.363,677] <err> cdc_acm_echo: Failed to enable USB

  • The hardware only have a limited number of endpoints available, but I would expect it could support more than 3, is there any other USB class than CDC?

    Kenneth

  • I'm not sure about other USB class but CDM ACM require 2 IN endpoints per instance. So max we can have is 3 only. I'm closing this ticket since I got the answer, Thanks!

Related