-
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
ESP32-C3 Incorrect wakeup cause with GPIO, resulting in RTC reset (IDFGH-10209) #11475
Comments
I have recently tested this issue with ESP-IDF v5.2 and it appears to function perfectly, without experiencing the incorrect wakeup cause from GPIO or RTC reset. However, for my project requirements, I need this to work with ESP-IDF v4.4 (because of Arduino framework). It would be really helpful if someone could guide me on the necessary changes to make this work with v4.4. Any advice or insights into this would be greatly appreciated. Thank you! |
@Pavelovec Hello, I am unable to reproduce your issue. I am using the release/v4.4 branch with the commit: 8b94183. |
I believe the problem might be tied to the type of button I'm using. I'm using silicone keypad buttons, which have a longer switching time compared to mechanical buttons. With mechanical buttons, the system works as expected in most cases. So I believe that the rise/fall time of the wakeup pulse has an effect on this error. But again, in ESP-IDF v5.2 it works correctly. |
@Pavelovec |
Yes, I am using the v4.4 release. I've just tried the v4.4.5 release as you suggested, but unfortunately, the problem still exists. |
I can conform that the same thing happens for me. I have tried waking up on pins #2 and #4. I am set to a LOW level wake-up. |
@bricomp hello, can you please tell me the commit you working on and the menuconfig you modified or other details, I will take action to solve this problem. |
@Pavelovec @bricomp Can you provide samples to help me reproduce the problem? Thank you. |
Hi @10086loutianhao I have found the source of the problem and I am able to work arround it. |
@10086loutianhao Apologies for the delay in responding. I hadn't noticed your question earlier. The example code is indeed in the "Steps to reproduce" section. I haven't made any modifications in menuconfig; the issue seems to be specific to the ESP-IDF version, as it works perfectly with ESP-IDF v5.2. |
Based on this commit: 1b04acf, I have implemented the changes in esp-idf v4.4. After thorough testing, it appears that these changes work perfectly and have resolved the initial issue. My hope is that they won't introduce any new complications. I believe this issue can now be closed. |
I am still experiencing this issue with the esp32c3. I've tried multiple idf versions and the issue remains. After deep sleep esp_sleep_get_wakeup_cause() will always return zero and rtc memory is lost. I've tested v5.1, v5.1.2, 5.2 and 5.3. |
I have the same issue but I think it's because I have interrupts attached to pin changes. So first wake cause is correct but then watchdog triggers reboot which cleans rtc memory. |
If you encounter any problems you wish to solve, please create a new issue and provide the necessary information for reproduction. Thank you |
Answers checklist.
IDF version.
v5.0.2
Operating System used.
Linux
How did you build your project?
Command line with idf.py
If you are using Windows, please specify command line type.
None
Development Kit.
ESP32-C3 rev v0.3 on custom board
Power Supply used.
External 3.3V
What is the expected behavior?
The ESP32-C3 board should reliably wake up from deep sleep when a connected button (with external pull-up) on GPIO5 is pressed. This should be consistently signaled with a wakeup cause of rst:0x5 (DSLEEP). The RTC time and memory should be maintained across deep sleep cycles.
What is the actual behavior?
The ESP32-C3 board does not reliably wake up from deep sleep when the connected button on GPIO5 is pressed. Occasionally, instead of waking up from deep sleep, the system performs a full power-on reset (signaled by rst:0x1 (POWERON)) which resets the RTC time and memory.
Steps to reproduce.
Debug Logs.
More Information.
The issue was observed while using the Arduino core v2.0.9 and ESP-IDF v5.0.2. The same behavior occurred with a button connected to GPIO3 with external pull-down. This issue seems to occur when the button is clicked after entering deep sleep; if the button is held before entering deep sleep, the wakeup works as expected.
In contrast, waking up the ESP32-C3 from deep sleep using the timer works perfectly, indicating that the issue is specific to GPIO wakeups.
I have tried nearly every possible workaround that I could think of and searched extensively for solutions, but none has resolved the issue. The goal is for the system to not reset RTC time or memory on wakeup.
This issue has proven to be a significant stumbling block, and I would greatly appreciate any assistance in resolving it. This behavior limits the usability of the ESP32-C3 for my project, as maintaining RTC across deep sleep cycles is a key requirement.
The text was updated successfully, but these errors were encountered: