ESP32 wakes up immediately from deep sleep indicating GPIO change

ddenker
Posts: 1
Joined: Sat Aug 19, 2023 12:25 am

ESP32 wakes up immediately from deep sleep indicating GPIO change

Postby ddenker » Sat Aug 19, 2023 12:44 am

Hi I am having a problem that when I go into deep sleep, the ESP32 immediately wakes up saying that a pulled down I/O pin connected to as push button has gone high when it has not. I have written test code with a standard interrupt routine to make sure the external hardware is acting properly and it is. Below is the code I use to go into deep sleep. Note that I want to wake up when the timer expires or the button is pushed. Also, note that while the ESP32 is awake I read from the pin to detect a long press. Thanks for any help you can give. This is on an ESP32 Devkit C.

Code: Select all

#define DEFAULT_WAKEUP_PIN (35)
void do_deep_sleep(int64_t time_to_sleep_in_us)
{
int result;
gpio_config_t config;
printf("Going to sleep for %lld us\n",time_to_sleep_in_us); fflush(stdout);
result = esp_sleep_enable_timer_wakeup(time_to_sleep_in_us);
uart_wait_tx_idle_polling(CONFIG_ESP_CONSOLE_UART_NUM);
reset_gpio(DEFAULT_WAKEUP_PIN);
uint64_t mask = 1;
mask <<= DEFAULT_WAKEUP_PIN;
config.pin_bit_mask = mask;
config.mode = GPIO_MODE_INPUT;
config.pull_up_en = GPIO_PULLUP_DISABLE;
config.pull_down_en = GPIO_PULLDOWN_DISABLE;
config.intr_type = GPIO_INTR_DISABLE;
ESP_ERROR_CHECK(gpio_config(&config));
ESP_ERROR_CHECK(esp_sleep_enable_ext0_wakeup((gpio_num_t)DEFAULT_WAKEUP_PIN,1));
/* Enter sleep mode */
if (result == ESP_OK)
    esp_deep_sleep_start();
esp_sleep_disable_wakeup_source(ESP_SLEEP_WAKEUP_TIMER);
}

jjones7432
Posts: 15
Joined: Thu Jul 07, 2022 7:22 pm

Re: ESP32 wakes up immediately from deep sleep indicating GPIO change

Postby jjones7432 » Fri Nov 29, 2024 6:14 pm

We have a similar issue and maybe support can provide a solution or explanation.

Did you find the problem?

We have implemented a ESP_SLEEP_WAKEUP_EXT0 for a motion detector while in deep sleep. Using the same motion detector evaluation board (with pull-up resistors and filtering capacitors for stable signals) and same firmware (with pull-up enabled) from ESPRESSIF IDF, our in-house developed custom boards using the ESP32-S3-WROOM-1 behave well while using the ESP32-S3-DEVKIT-C evaluation board does not, generating lots of false ESP_SLEEP_WAKEUP_EXT0 interrupts.

We use GPIO10 as the external interrupt input. Our custom boards are battery powered only. We've used the USB and battery power for the ESP32-S3-DEVKIT-C evaluation board with the same bad behaviors as before.

We have implemented the motion detector and support circuitry in our custom boards with very good and stable detection but are concerned that there may be a problem lurking.

Who is online

Users browsing this forum: No registered users and 29 guests