Flashing ESP8266 using FTDI and Arduino IDE

ESP8266 flashing mode FTDI

This guide quickly explains how to flash a program on ESP8266 using Arduino IDE, in less than 5 minutes. First of all, you need to install the ESP8266 board in Arduino IDE, following the 2 steps below: add the repositories link inside File -> Properties (http://arduino.esp8266.com/stable/package_esp8266com_index.json), and then add the board, using Board Manager.

Then, connect the FTDI (USB to Serial) adapter, to the ESP8266, as below. As power voltage, be sure to use 3.3V (and not 5V!), to avoid destroying the board. I suggest using a breadboard, as I did below. RX and TX wires can be connected directly. The 3.3V pin of the FTDI adapter should be connected to both VCC and CH_PD, while 0V pin should be connected to both GND and GPIO0, in order to set the ESP8266 into "bootloading" mode. RST and GPIO2 pins can be left floating.

As a simple test, you can use the following sketch. What is does is to turn ON/OFF the integrated blue LED connected to GPIO1.

Flash the board using the following parameters.

At the end of the flashing, the following message appears. It takes about 30 seconds - 1 minute to complete the flashing. After flashing, the program execution starts automatically (ESP8266 exits "bootloading" mode and enters "usage" mode). However, if you disconnect the 3.3V and reconnect again, in order to avoid booting in "bootloading" mode again, you should connect the GPIO0 pin to 3.3V, so that ESP8266 starts in "usage" mode.

And finally, this is how the program looks like. The LED blinks at 1 second periods (500ms ON, 500ms OFF).

Author: Davide Cavaliere

I am an Italian Electrical Engineer graduated at Politecnico di Milano. My interests are motorcycles and cars, electronics, programming, Internet of Things, and Japanese culture.

2 thoughts on “Flashing ESP8266 using FTDI and Arduino IDE”

  1. hello, nice to meet you, I tried to make your example and it does not work for me, the error is:

    warning: espcomm_sync failed
    error: espcomm_open failed
    error: espcomm_upload_mem failed
    error: espcomm_upload_mem failed
    Thank you!!!

    1. Hello Gabriel, I am sorry but a long time passed since I used this code. From your errors, I guess that it is a connection problem when trying to upload the code. Is that possible?

Leave a Reply

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