I have been using ESP32 modules for my application that sometimes requires a certain GPIO to be pulled up during deep sleep. The only function that I have needed to call to accomplish this is gpio_pullup_en. This has worked with no issues to maintain the pin state throughout deep sleep and wakeups.
I am making an update to my design and am considering changing to a ESP32-S3 module, mainly due the USB-OTG support. I obtained a ESP32-S3 development board to test its functionality and compare to my original boards before making the change in my actual design. One major difference I immediately noticed is that gpio_pullup_en is not sufficient to maintain the pulled-up state during deep sleep. I found that gpio_hold_en was required to keep the pin high during sleep, even though I previously did not need to do this.
I don't understand the reason for this difference. I found the documentation for the gpio_hold_en function even more confusing, as it seems to imply that that the function will not work for what I'm using it for.
"Additionally, on ESP32/S2/C3/S3/C2, this function cannot be used to hold the state of a digital GPIO during Deep-sleep. Even if this function is enabled, the digital GPIO will be reset to its default state when the chip wakes up from Deep-sleep. If you want to hold the state of a digital GPIO during Deep-sleep, please call gpio_deep_sleep_hold_en."
However, based on what I'm observed, gpio_hold_en is all that is needed to keep the pin pulled up during sleep, and had no need to call gpio_deep_sleep_hold_en.
Hopefully someone can explain the difference in deep sleep between these two chips and why I am having to change my application to accommodate the ESP32-S3.
ESP32 vs ESP32-S3 Deep Sleep Behavior
-
MicroController
- Posts: 2672
- Joined: Mon Oct 17, 2022 7:38 pm
- Location: Europe, Germany
Re: ESP32 vs ESP32-S3 Deep Sleep Behavior
... which is consistent with one half of the documentation. Notice that it says "will be reset to its default state when the chip wakes up from Deep-sleep". The first sentence should probably read "cannot be used to hold the state of a digital GPIO during past Deep-sleep.""Additionally, on ESP32/S2/C3/S3/C2, this function cannot be used to hold the state of a digital GPIO during Deep-sleep. Even if this function is enabled, the digital GPIO will be reset to its default state when the chip wakes up from Deep-sleep. If you want to hold the state of a digital GPIO during Deep-sleep, please call gpio_deep_sleep_hold_en."
However, based on what I'm observed, gpio_hold_en is all that is needed to keep the pin pulled up during sleep...
Hmm. Are you sure the docs say that you don't need to use GPIO hold on an ESP32?even though I previously did not need to do this.
...
why I am having to change my application to accommodate the ESP32-S3.
Who is online
Users browsing this forum: trendictionbot and 2 guests