The ESP8266 is a remarkable system on a chip (SoC), for its features and price. It can be used in multiple modes. E.g. :

In this post we are focusing on the first use case: i.e. using the ESP8266 board with the AT Commands firmware. We are going to upload (flash) the latest official firmware from Espressif (the manufacturer of the ESP8266 chip).

HINT We recommend to upload the latest firmware right after buying an ESP8266 board. Older versions (official or forks), are not really 100% compatible with the specs, and may even contain errors in the AT command syntax.

SEE ALSO This post, for instructions on how to communicate with the ESP8266 from the PC, with PuTTY.

Hardware Used

  • ESP8266 based board (e.g. ESP-01 or ESP-201)
  • 3.3V FTDI programmer or 5V FTDI programmer and voltage regulator
  • 3.3KOhm or 4.7KOhm resistor (pull-up resistor for CHIP_EN pin)
  • Breadboard and jumper wires

Wiring

ESP8266-pc-generic_bb

As depicted in the diagram, the 2 wires at the bottom (IO0, IO2) are needed only when uploading the firmware. For normal communication via serial interface (e.g. from within Putty, or Arduino), these 2 wires should be removed.

REMARK ON POWER If the ESP8266 chip behaves strangely (e.g. garbage output at serial, random resets, repeated unsuccessful firmware updates, etc.), then it’s probably related to the power supply. In this case we recommend to use a step down voltage regulator, connected to a relatively powerful (e.g. 500 mA) power source (e.g. an USB port instead of the FTDI output or an external power supply). This post addresses various problems that may appear when using the ESP8266 module.

Below, we have particularized the fritzing diagram for the popular ESP-01 module:

ESP8266-pc-examples-01_bb… and for the ESP-201 module. Please note that in the diagram, the pin headers on the ESP8266 boards are on the other side of the board. Keep this in mind while connecting the jumper wires, if you hold the board facing the pin header side towards you.

ESP8266-pc-examples-201_bb

Download Software

  1. Download the latest Flash Download Tools (v2.4_150924 at the time of writing) from here.
  2. Download the latest AT release (v0.50 at the time of writing) from here.

Flashing Procedure

1 Power on the circuit.

2 Detect module parameters. Start ESP Flash Download Tool, set the COM port corresponding to your FTDI programmer, then click the START button in order to detect the specs of the board. After detection, you should see something like this:
esp_flash_download_tool_01

3 Gather information. Make a note of the flash memory size. In this example, we have a 4Mbit flash. The size is shown in the “DETECTED INFO” text area, in the “flash” section (e.g. QUAD;4Mbit).

From the AT release folder, open the readme.txt (e.g. esp_iot_sdk_v1.4.0\bin\at\readme.txt) file containing the information for flashing the firmware. Inside the file, there should be a “NON-BOOT MODE” section, as follows:

***********************NON-BOOT MODE***********************
download
eagle.flash.bin 0x00000
eagle.irom0text.bin 0x40000
blank.bin
Flash size 4Mbit: 0x3e000 & 0x7e000
Flash size 8Mbit: 0x7e000 & 0xfe000
Flash size 16Mbit: 0x7e000 & 0x1fe000
Flash size 16Mbit-C1: 0xfe000 & 0x1fe000
Flash size 32Mbit: 0x7e000 & 0x3fe000
Flash size 32Mbit-C1: 0xfe000 & 0x3fe000
esp_init_data_default.bin (optional)
Flash size 4Mbit: 0x7c000
Flash size 8Mbit: 0xfc000
Flash size 16Mbit: 0x1fc000
Flash size 16Mbit-C1: 0x1fc000
Flash size 32Mbit: 0x3fc000
Flash size 32Mbit-C1: 0x3fc000
*NOTICE*:
UPDATE is not supported in non-boot mode
***********************************************************

4 Indicate firmware files & addresses. The firmware is broken down into several files (e.g. 3). They need to be provided to the ESP Flash Download Tool, together with the corresponding addresses (offsets) found in the readme.txt file above. So, in ESP Flash Download Tool, fill in (browse for) the files indicated in the non-boot section of the readme.txt file, and their corresponding offsets.

  • eagle.flash.bin, e.g. from esp_iot_sdk_v1.4.0\bin\at\noboot
  • eagle.irom0text.bin, e.g. from the same location
  • blank.bin, e.g. from esp_iot_sdk_v1.4.0\bin. This file appears twice, with 2 different offsets.

After filling in the paths and offsets, you should have something similar to this:

esp_flash_download_tool_02

NOTE Your readme.txt may differ from the section pasted above. Please use the addresses/offsets from your file!

5 Then, click the START button and wait until the flashing process is over.