-
Notifications
You must be signed in to change notification settings - Fork 7.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixes the hardware cdc jtag plugged/unplugged status and related timeout/delay #9275
Conversation
This will use a new IDF 5.1 feature to detect if the USB HW CDC is plugged or not. This can be checked testing HWCDCSerial. It also fixes issues related to timeout or delays while writing to the HW Serial when USB is unplugged.
👋 Hello SuGlider, we appreciate your contribution to this project! Click to see more instructions ...
Review and merge process you can expect ...
|
Skips the ESP32 SoC test given that it has no USB
Skips the ESP32S2 because it has no HW CDC JTAG interface
Only compiles the example in case it is using Hardware CD and JTAG mode.
modifies write and flush to do not clock in case CDC host is not connected to the CDC client from the C3/S3/C6/H2
Improves the example by adding more information about USB being plugged and CDC being connected.
Detects correctly when CDC is or not connected. Deals with USB unplugged while the sketch is printing to CDD.
Description of Change
This will use a new IDF 5.1 feature to detect if the USB calbe is plugged or not.
Testing HWCDCSerial (as bool operator) will return
true
only when CDC is connected (to a terminal application).It also fixes issues related to timeout, hanging or delays while writing to the HW Serial when USB is unplugged.
Main changes:
if(HWCDCSerial)
returnstrue
only when CDC is connectedflush
andwrite
operation will not blockHWCDCSerial == true|false
Tests scenarios
Tested with ESP32-C3, ESP32-S3, ESP32-C6 and ESP32-H2 using the new example from this same PR.
It was also tested using this example:
Related links
Fixes #9043
Fixes #9004
Fixes #8284
Fixes #7779
Fixes #7554
Fixes #6089