Hi,
I have an application that uses multiple CDC ACM instances, please see devicetree excerpt below:
&zephyr_udc0 { // NUS cdc_acm_uart0 { compatible = "zephyr,cdc-acm-uart"; }; // console cdc_acm_uart1: cdc_acm_uart1 { compatible = "zephyr,cdc-acm-uart"; }; // mcumgr cdc_acm_uart2: cdc_acm_uart2 { compatible = "zephyr,cdc-acm-uart"; }; };
As can be seen I use the NUS (Nordic Uart Service) port for the first instance, general debug info for the second and Mcumgr for the third. All of the USB instances are working, my problem is to easily detect which is which. Then enumeration of the COM ports are not in order always so I cannot use that. Ideally if I could use different product strings for each port that will work great (ex. CONFIG_USB_DEVICE_PRODUCT="Pager Dongle"). Is there a way to assign different product strings to each COM port programmatically in Zephyr? I have also tried using the command in the cmdline (Windows 11): reg query HKLM\HARDWARE\DEVICEMAP\SERIALCOMM. Although I get USBSER000 to USBSER002 it is still not guarenteed to be in the order as my devicetree (differs between devices). Only thing that potential can work is the PID info, there seems to be an underscore _00,_03,_05, etc. But I have not checked if it works across multiple devices.
I know about inf files, but is there any other way to get the associated CDC port to a COM port? (Preferably somthing you can change in the firmware in Zephyr to identify which COM port is which, does not neccessarily have to be in the Device Manager string).
Thanks in advance.
Kind Regards
Julian