Hi,
I'm working on an ESP32-S2 and I'm trying to pullup several RTC GPIOs with this command:
gpio_pullup_en(GPIO_NUM_18);
which comes from this lib: #include <driver/rtc_io.h>
to have these pins staying pulled up during deep sleep.
I tried everything (different HW, pin_mode, etc. etc.), but the command works only for GPIO 18 (example above), all other (RTC) Pins from 1-21 are not being pulled up after application of this command.
Does anybody have an idea?
I’m not sure I can help without seeing exactly what you have in front of you. To assist you effectively, please provide the following:
1. Annotated Schematic: Post a detailed schematic of your setup exactly as you have it wired, showing all connections, including power, ground, and power supplies.
2. Technical Information Links: For all hardware devices in your circuit, provide links to technical information. Be aware that many items in the Arduino/Pi world may have the same name but function differently. Links to sales pages like Amazon often lack the necessary technical details, so ensure the links you provide contain the correct specifications and data sheets.
3. Be Thorough: It’s your problem, and the more precise and detailed information you provide, the faster we can help you troubleshoot. This saves everyone time and helps us give you the best possible assistance.
1 Like
@gilschultz
the schematic is very simple: it is a bare LOLIN S2-mini board: [S2 mini — WEMOS documentation]
And I'm probing the GPIO voltage with a multimeter.
There is no additional HW wired to the GPIOs on the board...
I'running this (stripped) code:
#include <driver/rtc_io.h>
void setup() {
esp_sleep_pd_config(ESP_PD_DOMAIN_RTC_PERIPH, ESP_PD_OPTION_ON);
// sample pins
gpio_pullup_en(GPIO_NUM_16); // no effect
gpio_pullup_en(GPIO_NUM_18); // OK -> GPIO18 = 3V3
gpio_pullup_en(GPIO_NUM_8); // no effect
gpio_pullup_en(GPIO_NUM_10); // no effect
delay(10);
esp_deep_sleep_start();
}
void loop() {
// put your main code here, to run repeatedly:
}
That is not an Arduino Nano ESP32 end therefore your topic has been moved to a more suitable location on the forum.
That makes it very easy to draw. I will not spend my time chasing schematics when they are easy for you to post. I also expect them to be correct not the same as except. Good designers always make a schematic first before poking in wires.
For boot loader reasons, GPIO18 on an ESP32-S2 comes with an external 10k pullup resistor mounted to the board (right next to the MCU pin 18 itself). If you download the schematic for this board you can see this as well.
Problem 2 is that when a MCU goes to sleep, pullups generally get released (i.e. cease to function). This is because pullups are not like fuses on an Atmel chip and therefore are only active when the MCU is active. So when your MCU goes to sleep only GPIO18 appears to work because there is an external pullup resistor on it. All other pins will release their pullup and become floating while the MCU is sleeping making it appear like it didn’t work for them (which technically it didn’t work for any of the pins). For ESP32 MCU’s, think of deep sleep as basically turning off the MCU.
If you need a default state for pins when the MCU is in deep sleep you will need to use external pullup or pulldown resistors to implement this correctly. And of course…before doing that, make sure you understand what each pin’s function is and that you don’t accidently change a strapping/boot pin’s default behavior.