ESP32 Strapping Pins: Boot Mode, Flash Voltage & UART Output Explained
The ESP32 has 5 strapping pins: GPIO0, GPIO2, GPIO5, GPIO12, and GPIO15. These pins are sampled at power-on reset to determine critical chip configuration — including boot mode, flash voltage, and UART boot output.
Understanding strapping pins is essential because connecting external components to these pins can prevent your ESP32 from booting correctly or make it impossible to upload new code.
ESP32 Strapping Pin Table
| GPIO | Strapping Function | Strapping Name | Logic at Boot | Effect |
|---|---|---|---|---|
| GPIO0 | Boot Mode | GPIO0 | HIGH (1) = Normal boot LOW (0) = Flash mode |
☑ HIGH: Run program from flash ☐ LOW: Wait for serial upload |
| GPIO2 | Boot Mode | GPIO2 | LOW (0) = Enter bootloader | Must be LOW or floating during flashing. Onboard LED on some boards pulls it LOW. |
| GPIO5 | Boot Output | GPIO5 | HIGH (1) = Enabled | Controls whether UART boot messages are output. State is sampled at boot. |
| GPIO12 | Flash Voltage (VDD_SDIO) | MTDI | LOW (0) = 3.3V flash HIGH (1) = 1.8V flash |
Most dangerous. Pulling HIGH sets flash to 1.8V — may permanently brownout 3.3V flash modules. |
| GPIO15 | UART Boot Output | MTDO | HIGH (1) = Enabled LOW (0) = Disabled |
Controls ROM boot log output on UART. Disabling frees the pin but hides debug info. |
Boot Mode Selection (GPIO0 + GPIO2)
The combination of GPIO0 and GPIO2 at power-on determines the boot mode:
| GPIO0 | GPIO2 | Boot Mode |
|---|---|---|
| 1 (HIGH) | X (don't care) | Normal boot — run program from flash memory |
| 0 (LOW) | 0 (LOW) | UART flashing mode — wait for serial upload via esptool |
| 0 (LOW) | 1 (HIGH) | SDIO slave boot — rarely used |
How Each Strapping Pin Affects Your Project
GPIO0 — The Upload Pin
This is the pin that matters most for everyday ESP32 use. If your ESP32 won't upload code:
- Check that GPIO0 is not being pulled LOW by a button, sensor, or pull-down resistor during boot
- Some I2C LCD modules connected to GPIO0 can pull it LOW and prevent uploading
- Solution: Add a 10kΩ pull-up resistor to 3.3V on GPIO0, or disconnect peripherals during upload
GPIO12 (MTDI) — The Flash Voltage Pin
This is the most dangerous strapping pin on the ESP32. Its state at boot sets the flash memory I/O voltage:
- Pulled LOW (default): Flash runs at 3.3V — normal operation for ESP32-WROOM modules
- Pulled HIGH: Flash runs at 1.8V — will cause brownouts, crashes, and potentially permanent damage to 3.3V flash chips
GPIO12 has a built-in pull-down resistor, so it defaults to LOW if unconnected. Never connect GPIO12 to VCC through a button or jumper without understanding this risk.
GPIO15 (MTDO) — UART Boot Messages
Controls whether the ESP32 prints bootloader diagnostics to UART0. If your project needs this pin for I/O, you can pull it LOW at boot to disable boot messages — but you'll lose debugging information.
Safe Circuit Design with Strapping Pins
If you must use strapping pins in your project, follow these guidelines:
- GPIO0: Use as a digital input or open-drain output. Add an external 10kΩ pull-up to ensure a safe HIGH during boot.
- GPIO2: Safe as a push-pull output if driven HIGH during boot. Avoid capacitive loads that delay voltage rise.
- GPIO5: Safe as an output. The strapping effect is transient and happens only during the first milliseconds of boot.
- GPIO12: Only use with a pull-down resistor (or leave unconnected). Never connect to 3.3V directly.
- GPIO15: Safe with a pull-up or as an output. Pulling LOW disables boot messages but is otherwise safe.
🔧 See Strapping Pins on the Interactive Pinout
Our tool labels strapping pins with clear warnings. Select any pin to see its boot-time behavior.
Open Interactive PinoutFrequently Asked Questions
Can I disable the strapping pin behavior?
Yes, for some pins. GPI12's strapping function can be disabled by burning an eFuse (EFUSE_VDD_SDIO_AS_GPIO). This is a one-time irreversible change. Other strapping pins cannot be disabled.
Why does my ESP32 upload fail intermittently?
If GPIO0 is floating or weakly pulled, noise can cause it to read HIGH when you want LOW (or vice versa). Add a 10kΩ pull-up resistor on GPIO0 for reliable flashing.
Do ESP32-S3, C3, C6 have strapping pins?
Yes, but the pin assignments differ. For example, ESP32-S3 strapping pins include GPIO0, GPIO3, GPIO45, and GPIO46. Always check the datasheet for your specific chip variant.