What happens to GPIO output pin during reboot?
Posted: Wed Nov 27, 2024 6:06 pm
Hi,
We are using a ESP32 WROOM module and the design uses a "power enable" signal to keep the power supply turned on. This is wired to GPIO21 on our ESP32.
I set this pin high at start up using a bootloader hook, to make sure that the power supply stays on. It's also set high by the main firmware when it boots up. This works well.
However, I want to be sure about what happens when the ESP32 is rebooted with "esp_restart()", which triggers a reboot with the boot reason SW_CPU_RESET. If GPIO21 goes low for more than ~1.5 microseconds, the power supply will shut down and the user will need to press the power button again. This is undesirable (e.g. when installing a firmware update).
The technical reference manual says that pin GPIO21 is set up as an input after reset (oe=0, ie=0 at reset, then oe=0, ie=1). This means I would expect the pin to briefly toggle LOW when the reset happened. However, I can't see this on my scope; it seems to remain high.
In other words, it is working OK but I would like to be sure. Would the output pin be expected to reliably hold its state while the ESP32 reboots?
We are using a ESP32 WROOM module and the design uses a "power enable" signal to keep the power supply turned on. This is wired to GPIO21 on our ESP32.
I set this pin high at start up using a bootloader hook, to make sure that the power supply stays on. It's also set high by the main firmware when it boots up. This works well.
However, I want to be sure about what happens when the ESP32 is rebooted with "esp_restart()", which triggers a reboot with the boot reason SW_CPU_RESET. If GPIO21 goes low for more than ~1.5 microseconds, the power supply will shut down and the user will need to press the power button again. This is undesirable (e.g. when installing a firmware update).
The technical reference manual says that pin GPIO21 is set up as an input after reset (oe=0, ie=0 at reset, then oe=0, ie=1). This means I would expect the pin to briefly toggle LOW when the reset happened. However, I can't see this on my scope; it seems to remain high.
In other words, it is working OK but I would like to be sure. Would the output pin be expected to reliably hold its state while the ESP32 reboots?