ESP8266


Team for developers working on the ESP8266 WiFi SOC.

Firmware Update

Introduction

The ESP8266 is a $5 Wi-Fi module (in low quantities) that can communicate over UART by AT Commands to the host microcontroller. This page talks about the firmware update process for the ESP8266 module.

The process

To update the firmware on your ESP8266 device, please follow these steps:

  1. Download ESP8266 firmware. This zip contains only the necessary binaries for 32 MB flash size. If you have a differen flash size, download the binaries here and use the README to find the appropriate memory locations to flash.
  2. Download the flash download tool.
  3. Compile and load serial passthrough example to the mbed board.
  4. Put ESP8266 device into firmware update mode (GPIO0 ->GND) (either push button or jumper).
  5. Load firmware with flash download tool.
  6. On successful download, put ESP8266 device into boot mode.

mbed board as serial passthrough

Import, compile and load the serial passthrough code onto your mbed board. The serial passthrough code allows the computer to talk directly to the ESP8266 device and receive information from the chip. This is necessary to load the firmware update into the ESP8266 device's memory.

Import programSerialPassthrough

Serial Passthrough program

ESP8266 connection

ESP8266 firmware update wiring

To connect the ESP8266 to the mbed board, make the following connections:

ESPmbed
VCC3.3V
GNDGND
TXRX
RXTX

ESP8266 into firmware update mode

Seeed Grove UART Wi-Fi

Push the reset button until the light goes red.

Standalone module

Wire the ESP8266 device to be in firmware update mode.

ESPmbed
GPIO0GND
RST3.3V

Now, you need to reset the chip. Pull down the RST pin to GND for 1 second, and then reconnect it to 3.3V.

For a more detailed diagram, see the getting started guide in the resources section.

Load firmware with flash download tool

Download the flash download tool.

When you've launched the tool, select the ESP8266 downloader.

/media/uploads/sarahmarshy/select_esp8266_tool.jpg

From the espressif firmware you just downloaded, you need to load 4 separate files to the ESP8266 chip. You need to write the blank binary twice.

BinAddress
boot_v1.2.bin0x000000
user1.1024.new.2.bin0x01000
esp_init_data_default.bin0x3FC000
blank.bin0x7E000
blank.bin0x3FE000

/media/uploads/sarahmarshy/select_files.jpg

Specify the Flash size as 32 Mbit.

/media/uploads/sarahmarshy/specify_32mbit.jpg

Specify the COM port of your mbed board and 115200 baud.

/media/uploads/sarahmarshy/set_com_and_baud.jpg

Press START!

Progress bar indicates firmware flashing in progress. FINISH indicates successful flashing.

Note: If the download is stuck at "SYNC" verify baud rate, flash size, binaries in flash download tool. Also make sure mbed board as serial passthrough. Before restarting, make sure to put ESP8266 device in firmware update mode.

Success

Now that you have completed updating the firmware, you need to put the chip in boot mode.

Booting ESP8266

Seeed Grove UART Wi-Fi

Press the reset button until the red light goes off.

Standalone module

Wire the ESP8266 device for boot mode.

ESPmbed
GPIO03.3V
RST3.3V

Now, you need to reset the chip. Pull down the RST pin to GND for 1 second, and then reconnect it to 3.3V.

Example

For example, if you have a FRDM-K64F board and an ESP8266 device and want to update the firmware for the ESP8266, compile and load the serial passthrough example program onto the K64F. Then, connect the following pins.

ESPFRDM-K64F
VCC3.3V
GNDGND
TXD0
RXD1
GPIO0GND
RST3.3V

Now, you need to reset the chip. Pull down the RST pin to GND for 1 second, and then reconnect it to 3.3V.

Use the flash download tool to download the binaries. Once you have downloaded them, connect GPIO0 to 3.3.V, and reset the ESP8266. Now, the board runs in operational mode, which is usually 115200 baud. To test this, load the program below onto the board. It has the AT+RST command already programmed, so when you compile and run it, you receive valid output from the ESP device. If you do not receive valid output, change the baud speed of the device.

Import programSerialDeviceTerminal

This program is designed to act as a serial terminal for interfacing with serial peripherals, such as the ESP8266, that support AT Commands.

That's it! Go build awesome!

Resources

Here are some other useful resources for ESP8266 shenanigans.

Summary

  1. Load serial passthrough onto mbed board.
  2. Hook up the EPS8266 device to the serial port on the mbed board, and put the device into firmware update mode.
  3. Flash all firmware files according to package instructions. You may need to reset ESP8266 device between each file and put the device into firmware update mode again.
  4. Go build awesome.