ESP8266 Standalone Module -- 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 the binaries here and use the README to find the appropriate memory locations to flash. For convenience, the appropriate files for 8Mbit flash size are listed below:
    • esp8266_nonos_sdk_v2.0.0_16_08_10\ESP8266_NONOS_SDK\bin\boot_v1.2.bin
    • esp8266_nonos_sdk_v2.0.0_16_08_10\ESP8266_NONOS_SDK\bin\at\512+512\user1.1024.new.2.bin
    • esp8266_nonos_sdk_v2.0.0_16_08_10\ESP8266_NONOS_SDK\bin\esp_init_data_default.bin
    • esp8266_nonos_sdk_v2.0.0_16_08_10\ESP8266_NONOS_SDK\bin\blank.bin
  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

/media/uploads/sarahmarshy/pin_map.jpg

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

Standalone module

Wire the ESP8266 device to be in firmware update mode.

ESPmbed
GPIO0GND
GPIO23.3V
CH_PD3.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.

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.bin0xFC000
blank.bin0x7E000
blank.bin0xFE000

/media/uploads/sarahmarshy/esp_tool_files.png

Specify the Flash size as 8 Mbit.

/media/uploads/sarahmarshy/esp_tool_flash.png

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

/media/uploads/sarahmarshy/esp_tool_baud.png

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

Standalone module

Wire the ESP8266 device for boot mode.

ESPmbed
GPIO03.3V
GPIO23.3V
CH_PD3.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.

Note: If this doesn't seem to reset the device, simply make the above connections and remove the VCC connection, then make the connection again.

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.


1 comment on ESP8266 Standalone Module -- Firmware Update:

19 Dec 2023 This post is awaiting moderation

HI, I'm wondering if the ESP8266 driver from the latest Mbed OS compatible with the Espressif firmware of RTOS version?

Please log in to post comments.