ESP8266 V2 Firmware update

Intro

The ESP8266 is a 5$ wifi 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 taken from here.
  2. Download the flash download tool
  3. Compile / Load Serial Passthrough example to the mbed board
  4. Put ESP8266 into firmware update mode (GPIO0 ->GND) (either push button or jumper)
  5. Launch the flash download tool

mbed board as serial passthrough

Import, compile, and load the serial passthrough code onto your mbed board. The serial passthrough code will allow the computer to talk directly to the ESP8266 chip and vice versa. This will be necessary for the esptool python script to load the firmware update into the ESP8266 chips memory.

Import programSerialPassthrough

Serial Passthrough program

ESP8266 Firmare Update Wiring

Seeed Grove UART Wifi

Push the reset button untill the light goes red.

Standalone module

Wire up the ESP8266 chip to be in firmware update mode. On the ESP01 chip this involves setting GPIO0 to GND and resetting the chip. See the wiring diagram below.

ESPMBED
VCC3.3V
GNDGND
TXRX
RXTX
CH_PD3.3V
GPIO0GND

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

load firmware with Flash Download tool

Download the Download the flash download tool.

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

BinAddress
boot_v1.2.bin0x00000
user1.1024.new.2.bin0x01000
esp_init_data_default.bin0x3FC000
blank.bin0xFE000
blank.bin0x3FE000

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

/media/uploads/sarahmarshy/select_esp8266_tool.jpg

Select the files you want to download to ehs ESP8266, and specify their memory locations according to the table above.

/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!

Success

Now that you have completed updating the fimware remove the GPIO0 pin (or press the RESET button on the Seeed Grove module), the ESP will now be running communicating with the board at 115200 baud.

Example

For example, if I have a FRDM-K64F board and a ESP8266 module and I want to update the firmware for the ESP8266, I would compile and load the Serial Passthrough program onto the K64F. Then I would connect the following pins together

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

Then I would use the flash download tool to download the binaries. Once they were all downloaded I would unconnect GPIO0 from GND and restart the board. Now the board should be running in operational mode, usually this is 115200 baud. To test this I would load the program below onto the board. It has the AT+RST command already programmed, so just compile and run it and you should get valid output from the ESP Chip. If you do not get valid output, but instead a bunch of junk try changing 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 very useful resources for ESP8266 schenanigans.

TLDR;

  1. load serial passthrough onto mbed board
  2. hookup ESP8266 to serial port on mbed board and put into firmware update mode
  3. Flash all firmware files according to package instructions (may need to reset ESP8266 between each file and put into FW Update mode again)
  4. Go build awesome


Please log in to post comments.