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
References
[1] https://zoetrope.io/tech-blog/esp8266-bootloader-modes-and-gpio-state-startup
[2] http://www.instructables.com/id/Getting-Started-with-the-ESP8266-ESP-12/
[3] http://www.instructables.com/id/ESP8266-Using-GPIO0-GPIO2-as-inputs/
I am still playing with the ESP8266 on the ESP-01 module (http://www.tinytronics.nl/shop/Communicatie/Netwerk/ESP8266-WiFi-Module). That module has only GPIO0 and 2 exposed and both need to be high or floating (like on the ESP-12) during startup.
Good to know!
Pingback: ESP-12 NodeMcu ESP8266 | 으잉 >_<
Pingback: Consolidación de links para ESP8266 (y ESP32) | codesect
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.
Just tried that with ESP12F modules:
EN can be connected to 3v3 directly.
IO15 must be pulled via resistor or the module can’t be flashed (comes up in mode 7)
IO2 can float.
IO0 & RST must be pulled via resistor.
for me this is not working like you described.
i made it work only when i connected (programming mode)
GPIO0 -> GND
GPIO15->GND
GPIO2->3.3v
Pingback: Home Status Display – Qetesh's Workbench
Pingback: WiFi Motion Detector – Qetesh's Workbench
Pingback: Project HiveSUMMary | zeitwesentech blog
Hi,
does one need to pull up GPIO0+2 for OTA-flash?
Bye!
Marco
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.