ESP32-S3 Delay Enumeration of 2nd USB CDC Port
Posted: Tue Sep 10, 2024 1:47 am
Hi,
I'm developing a product around an ESP32-S3 module (WROOM) that registers 2 USB CDC Ports on the attached Windows computer (industrial application, the device will always be plugged into a Windows computer).
For the sake of easily configuring software on the Windows machine, I'd like the board to make the first USB-Port visible (ie COM6), then after a configurable delay register the 2nd CDC Port (which might be called COM5, or even COM7). From what I've tried, (ESP-SDK 5.2) it appears that TinyUSB notifies windows of the existence of both CDC ports when the S3 starts the USB stack with `tinyusb_driver_install()`, before I even call `tusb_cdc_acm_init()`.
I've found that I can't rely on the lower-number COM port to be the first or second CDC instance - they appear swap randomly between eachother, or even get new COM numbers.
If I delay my call to `tusb_cdc_acm_init()`, windows can still see and open the 2 ports, but the S3 logs that its not yet read/writable until `tusb_cdc_acm_init()` has been called.
Is there a solution that will allow the devices to appear 1 before the other in device manager, so that Its just a case of knowing 'the first COM port that appears is CDC_ACM_0, and then 3s/5s/10s later when the next COM port appears, you know its CDC_ACM_1?
Any help would be greatly appreciated.
Thanks,
Hayden
I'm developing a product around an ESP32-S3 module (WROOM) that registers 2 USB CDC Ports on the attached Windows computer (industrial application, the device will always be plugged into a Windows computer).
For the sake of easily configuring software on the Windows machine, I'd like the board to make the first USB-Port visible (ie COM6), then after a configurable delay register the 2nd CDC Port (which might be called COM5, or even COM7). From what I've tried, (ESP-SDK 5.2) it appears that TinyUSB notifies windows of the existence of both CDC ports when the S3 starts the USB stack with `tinyusb_driver_install()`, before I even call `tusb_cdc_acm_init()`.
I've found that I can't rely on the lower-number COM port to be the first or second CDC instance - they appear swap randomly between eachother, or even get new COM numbers.
If I delay my call to `tusb_cdc_acm_init()`, windows can still see and open the 2 ports, but the S3 logs that its not yet read/writable until `tusb_cdc_acm_init()` has been called.
Is there a solution that will allow the devices to appear 1 before the other in device manager, so that Its just a case of knowing 'the first COM port that appears is CDC_ACM_0, and then 3s/5s/10s later when the next COM port appears, you know its CDC_ACM_1?
Any help would be greatly appreciated.
Thanks,
Hayden