esp_sleep_enable_ext0_wakeup not working

pablopabota
Posts: 4
Joined: Fri Jan 06, 2023 6:54 pm

esp_sleep_enable_ext0_wakeup not working

Postby pablopabota » Wed Oct 25, 2023 5:16 am

Hi,

I'm trying to wake up my ESP-32 WROVER-E from an external source using the esp_sleep_enable_ext0_wakeup() function:

Code: Select all

void go_to_sleep(uint32_t useconds)
{
	esp_wifi_stop();
	esp_sleep_enable_ext0_wakeup(GPIO_NUM_4, 0);
	esp_deep_sleep(useconds);
}
I call that function in order to send my device to sleep, but as soon as it "power down" it wakes up immediately, I tried wake up on "high" level and "low" yet the same behaviour.

I tried the power domain function, the pull ups and down and nothing worked.

If I comment the wakeup source line the device go to sleep the time setted, and the GPIO 4 stays "high" for the whole sleeping period.

esp_sleep_get_wakeup_cause() returns ESP_SLEEP_WAKEUP_EXT0 and GPIO_NUM_4 is the only setted wake up source.

Did I missed something? Any idea?

Regards,
P

PS:
1) I run 'rtc_deinit' the GPIO pin when device wakes up.
2) I'm using ESP-IDF 4.4.5
3) Chip is ESP32-D0WD-V3 (revision v3.0)

chegewara
Posts: 2364
Joined: Wed Jun 14, 2017 9:00 pm

Re: esp_sleep_enable_ext0_wakeup not working

Postby chegewara » Tue Mar 19, 2024 4:35 pm

Code: Select all

        esp_sleep_pd_config(ESP_PD_DOMAIN_RTC_PERIPH, ESP_PD_OPTION_ON);
        esp_sleep_enable_ext0_wakeup((gpio_num_t)BUTTON_PIN, 0);
        esp_deep_sleep_start();
        

Who is online

Users browsing this forum: No registered users and 110 guests