[USB HWCDC] 'connected' state isn't reset leaving port in limbo state after ~2 minutes
Board
ESP32-C3 (but also tested on C6/C61/S3)
Device Description
Hardware Configuration
Using USB HW-CDC port
Version
latest master (checkout manually)
Type
Bug
IDE Name
VS-code + WSL2
Operating System
Windows 11
Flash frequency
PSRAM enabled
no
Upload speed
Description
With the latest IDF/Arduino (IDF 5.5.4) code the HWCDC port gets into an undefined state after ~2 minutes not being 'connected'.
The port still reports being 'plugged', but the call to HWCDC::isCDC_Connected() never gets return true again, even when you connect a serial terminal/console to the port again.
N.B. this happens on 'never connected since boot' if you don't connect to it within the first 2 minutes, as well as when it was connected, but disconnected for > 2 minutes.
When calling flush() on the port, each call to HWCDC::isCDC_Connected() takes upto 2 full seconds untill there is a connection made again.
With the Arduino/IDF code from ~ 2 months ago (end of May) this didn't happen.
I couldn't find any likely related recent commit in the Arduino repo, however I did find this one in the ESP-IDF repo: https://github.com/espressif/esp-idf/issues/18887
And (maybe related??) pending PR: https://github.com/espressif/esp-idf/pull/18706/changes
Sketch
-Debug Message
-Other Steps to Reproduce
No response
I have checked existing issues, online documentation and the Troubleshooting Guide
- I confirm I have checked existing issues, online documentation and Troubleshooting guide.
Source: espressif/arduino-esp32