ESP32-C3 deep sleep GPIO wakeup reason
Posted: Wed Jun 21, 2023 9:46 am
Hello all,
I'm using a deep sleep GPIO wakeup mechanism. The GPIO signal that wakes the ESP32 is a high frequency switching signal (up to 3kHz).
The wakeup works but after waking, my code relies on thefunction to return : ESP_SLEEP_WAKEUP_GPIO. This does not happen the very first wake. Instead, the function returns ESP_SLEEP_WAKEUP_UNDEFINED which causes the chip to go to sleep again, only to be awaken again by the switching GPIO. After this second wakeup, the wakeup_cause function returns the correct value.
TL;DR: The ESP32-C3 esp_sleep_get_wakeup_cause function returns ESP_SLEEP_WAKEUP_UNDEFINED when awaken by a GPIO level change the first time. After an immediate second deep sleep and wake sequence, the esp_sleep_get_wakeup_cause function returns the correct ESP_SLEEP_WAKEUP_GPIO.
What could be the cause of this?
Thanks!
I'm using a deep sleep GPIO wakeup mechanism. The GPIO signal that wakes the ESP32 is a high frequency switching signal (up to 3kHz).
The wakeup works but after waking, my code relies on the
Code: Select all
esp_sleep_get_wakeup_cause()
TL;DR: The ESP32-C3 esp_sleep_get_wakeup_cause function returns ESP_SLEEP_WAKEUP_UNDEFINED when awaken by a GPIO level change the first time. After an immediate second deep sleep and wake sequence, the esp_sleep_get_wakeup_cause function returns the correct ESP_SLEEP_WAKEUP_GPIO.
What could be the cause of this?
Thanks!