ESP32 ADC Wake Up Read Problem

Hi All,

i'm programming esp32 and i have a strange problem.
When my device exit from wake up all the GPIO stay pulled
down and ADC read alway 0. Here a piece of the code:

{
esp_sleep_enable_ext0_wakeup(GPIO_NUM_25,1);
rtc_gpio_pullup_en(TX_PIN_NUMBER);
rtc_gpio_pullup_en(AP_PIN_NUMBER);
esp_deep_sleep_start();
}

When the system is restarted by GPIO_NUM 25, the ADC
seem to stay configured in pull down.

Please can help?

Upon wake up from deep sleep the ESP32 will reset and setup() will run. The rtc settings ran, just before deep sleep start, will be lost. If you want the pins with pull ups, use gpio_set_pull_mode GPIO & RTC GPIO - ESP32 - — ESP-IDF Programming Guide latest documentation in setup() as well as keep the rtc settings.

What does "ADC read away 0" mean?

Idahowalker:
What does “ADC read away 0” mean?

It means that when i read the GPIO_NUM_25 ADC, the result of the reading is about zero. This behavior only occurs when i wake up from the pin. I add that from the tests performed today, it seems that if i don’t call the function:

rtc_gpio_pullup_en (TX_PIN_NUMBER);

before sleep

esp_deep_sleep_start ();

I can’t even read correctly the pins state with the usual digitalRead interface functions (…).