ESP-12 bootloader modes and GPIO state at startup

Since I encountered some initial difficulties in programming the ESP-12 version of the ESP8266 module using the Arduino IDE, let me here summarise some findings based on information from [1,2,3].


The ESP-12 module exposes 11 GPIOs. Three of them are especially relevant, as they determine the bootloader mode at startup or following reset.

                                  | GPIO 0 | GPIO 2 | GPIO 15
Flash Startup (Normal)            |   1    |   1    |   0
UART Download Mode (Programming)  |   0    |   1    |   0
SD-Card Boot                      |   0    |   0    |   1

Furthermore, CHPD should be pulled up and RESET should be pulled up or should be floating. If you connect RESET to ground, the module resets.

I have not yet figured out what the SD-Card boot means, so in my applications GPIO 2 should always be pulled up and GPIO 15 should always be pulled down. I am using 10k resistors, but smaller values (e.g. 3.3k) should also work.

To facilitate development, I connected two push button switches to the GPIO 0 and RESET pins, shorting them to ground when pressed. When the buttons are not pressed, they are both pulled up to 3.3V using a 10k resistor.

This allows me to do the following two-finger-action to restart in programming mode and allow the Arduino IDE to upload a new firmware:
– press reset button
– press programming button
– release reset button
– release programming button



9 thoughts on “ESP-12 bootloader modes and GPIO state at startup

  1. Pingback: ESP-12 NodeMcu ESP8266 | 으잉 >_<

  2. Pingback: Consolidación de links para ESP8266 (y ESP32) | codesect

  3. Rodrigo Mendoza

    THANKYOU SO MUCH. I have to make a note that ch_pd, gpio15 & gpio 2 can be connected directly to gnd and source respectivelly. But the pull up and down on reset and gpio 0 are essential.

  4. Pingback: Home Status Display – Qetesh's Workbench

  5. Pingback: WiFi Motion Detector – Qetesh's Workbench

  6. Pingback: Project HiveSUMMary | zeitwesentech blog

    1. Robert Post author

      I would not expect that. OTA flash would first involve an upload of the new firmware to (unused) EEPROM, then a reboot after which it the new firmware would have to be copied to the final location. Neither of those involves interaction over the serial interface.


Leave a Reply

Your email address will not be published. Required fields are marked *