-
Notifications
You must be signed in to change notification settings - Fork 7.3k
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
esp32c3: USB stopped working when light sleep is enabled. (IDFGH-6887) #8507
Comments
Hello, any investigation on this ? |
The same issue on v4.3 branch (v4.3.2-555-gb4ef1b80a2). |
Hi @igrr |
I have got the same problem with light sleep.
after this, the USB serial connection stops communicating. Is there any progress? |
Hi, is there anything new on this issue? ESP32 C3 should be power efficient MCU, but Power Management is not working, if I want to watch logs on USB output. |
+1, this issue makes it difficult to debug with light_sleep_enable. |
When CONFIG_PM_DFS_INIT_AUTO is set, the .light_sleep_enable setting is always false. |
@AxelLin on the last question, the CONFIG_PM_DFS_INIT_AUTO option isn't intended to cover all the use cases. |
Hi @HiFiPhile , @AxelLin , @MMucka , The USB peripherals (USB OTG, USB serial JTAG) on all ESP chips till now are not designed to be used in the sleep modes. In the sleep modes, the clock of CPU is turned off and the APB clock which is associated with the CPU clock is also turned off. The USB peripherals depends on the APB. When the clock is turned off, the peripheral will fail to return even a NAK to the host. The host will detect this, and have different abnormal actions. I think the documentation of CONFIG_RTC_CLOCK_BBPLL_POWER_ON_WITH_USB is misleading, we will correct this. |
@ginkgm So it takes several months to confirm a documentation issue? |
@alisitsyn |
@ginkgm |
Hi @ginkgm, |
I only updated the document, and I believe that this feature can't be reliable due to the clock limitation. Did you use another USB host? What we suspect that happen is:
It's possible that your device wake up fast enough before the host found this issue, or the host just ignore the error and continue working. But I think these condition are not reliable. |
…ble to work during sleep 1. Remove RTC_CLOCK_BBPLL_POWER_ON_WITH_USB Kconfig option During sleep, BBPLL clock always gets disabled esp_restart does not disable BBPLL clock, so that first stage bootloader log can be printed 2. Add a new Kconfig option PM_NO_AUTO_LS_ON_USJ_CONNECTED When this option is selected, IDF will constantly monitor USB CDC port connection status. As long as it gets connected to a HOST, automatic light-sleep will not happen. Closes espressif/esp-idf#8507
…ble to work during sleep 1. Remove RTC_CLOCK_BBPLL_POWER_ON_WITH_USB Kconfig option During sleep, BBPLL clock always gets disabled esp_restart does not disable BBPLL clock, so that first stage bootloader log can be printed 2. Add a new Kconfig option PM_NO_AUTO_LS_ON_USJ_CONNECTED When this option is selected, IDF will constantly monitor USB CDC port connection status. As long as it gets connected to a HOST, automatic light-sleep will not happen. Closes espressif/esp-idf#8507
The fix seems not helpful at all. |
@AxelLin As mentioned in #8507 (comment), this is a hardware limitation — there is no way for USB_SERIAL_JTAG to reliably work when light sleep mode is used. So the commit offers the only viable compromise, given what the hardware can do — offers an option to disable light sleep when USB is used. Of course, we can keep the Github issue option since the original problem is not fixed. But it would be a bit pointless, since there is nothing ESP-IDF project can do in the future to make the ESP32-C3 work as expected by the issue reporter. |
I am using arduino IDE and esp32c3 SEEED STUDIO. I have been struggling with the same issue :( |
Environment
git describe --tags
to find it):xtensa-esp32-elf-gcc --version
to find it):(crosstool-NG esp-2021r2-patch3) 8.4.0
Problem Description
USB stops working if
light_sleep_enable
is true inesp_pm_configure
.According to the doc:
So I set
CONFIG_RTC_CLOCK_BBPLL_POWER_ON_WITH_USB=y
alongside withCONFIG_ESP_SLEEP_GPIO_RESET_WORKAROUND is not set
&CONFIG_PM_SLP_DISABLE_GPIO is not set
Expected Behavior
USB keep working under light sleep.
Actual Behavior
USB stops working under light sleep,
Unknown USB device (descriptor request failed)
Steps to reproduce
.light_sleep_enable = true
Code to reproduce this issue
Debug Logs
From UART console, USB console no output
Other items if possible
build
folder (note this may contain all the code details and symbols of your project.)template.zip
The text was updated successfully, but these errors were encountered: