-
Notifications
You must be signed in to change notification settings - Fork 7.6k
ESP32-S3 native USB CDC stops working after light sleep #6581
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
Comments
@SuGlider Can you please help with triage? Maybe it's a duplicate of already opened USB CDC issues? Thanks |
It's similar to this issue #6264, but I failed to fix it using |
What happens if you sleep for a shorter time? What probably happens is that your computer fails to communicate with the ESP during light sleep, so it stops asking it for data (with USB, it's the HOST that asks the questions, the DEVICE can not just send data on it's own). When you hard-reset the ESP, the USB is re-enumerated and starts working again. The solution might be to call an extra function in the future, or another Arduino functions that will re-enumerate the USB on wakeup from light sleep. |
This is months old now and I don't know if this is relevant anymore, but I actually had this same issue with an STM32-board using USB-CDC and it was caused by, indeed, what @me-no-dev there said. What worked for me was as simple as stopping the USB-peripheral, pulling both USB-data lines down to GND for a couple of milliseconds, then restarting the USB-peripheral. I would assume the same would work on the ESP32-S2/-S3/-C3. |
Found this in USB Serial/JTAG Controller Console chapter of Espressif documentation: |
Closing the issue as per the description in the documentation. This is a limitation od the USB and deep/light sleeping. |
@WereCatf did you find a way to do this purely on the software / firmware side? I can replicate your workaround (touching ground to D+ alone seems to do it in my case) but when I tried to use the following snippet it didn't work. Do I also have to change the io_mux or other settings?
I was able to get it to work by using GPIOs to pull down the usb data lines (by soldering a small wire to the pads) but I'd very much prefer to reset usb without any hardware modifications. |
This reset the USB bus by pulling D+ to the ground.
|
This is also an issue for the ESP32-C3 with "USB CDC On Boot: Enabled" (when using a Windows10 PC). The best(?) solution I have found is to do:
This causes the Arduino-Serial-Monitor to be disconnected at " This works because recent versions of github.com/espressif/arduino-esp32 (eg. v23Sep24) for the ESP32-C3 have changed something in " |
Board
ESP32-S3-WROOM-1 N8R2
Device Description
Custom PCB https://oshwlab.com/Miraculix200/esp32-s3-mini_copy
Hardware Configuration
GPIO 19 and 20 are connected to USB connector
Version
2.0.3-RC1
IDE Name
Arduino IDE
Operating System
Windows 10
Flash frequency
80MHz
PSRAM enabled
yes
Upload speed
115200
Description
When using the Arduino IDE serial monitor or Putty connected to USB (with Hardware CDC and JTAG enabled) at 115200 baud, ESP_LOGD output will stop after light sleep. Doing ESP.restart() will not enable the output again. Only after a hard reset the ESP32-S3 outputs data over USB again.
Sketch
Debug Message
Other Steps to Reproduce
No response
I have checked existing issues, online documentation and the Troubleshooting Guide
The text was updated successfully, but these errors were encountered: