Contents
In the earlier articles, we have written our own program in Arduino IDE to access GPIO pins of ESP8266 or to interface sensors to ESP8266. But if we write our own program to access GPIO Pins, the existing firmware will be completely erased and the new program will be written on the ESP8266.
So in this article, we will explain how to flash the Official Espressif and NodeMCU Firmware to ESP8266. This can also be used to update to the latest ESP8266 Firmware.
Current Firmware Version
Before installing the new firmware into ESP8266, we can check the current firmware version of ESP8266 module by using Arduino IDE serial monitor.
If ESP8266 is flashed with Arduino program to access GPIO pins, then the existing firmware of ESP8266 will be completely erased and Arduino code will be uploaded to that module. So in this case we can’t check the current firmware version for that module.
In Arduino IDE, select the correct COM Port ex”: COM3″, open the Serial Monitor, set the baud rate to 115200 and select Both NL and CR option in the serial monitor.
To RESET: Press the RST Button of ESP8266 for a second and release. The ESP8266 Module will reset and display “ready” after some garbage data on the serial monitor.
To check Current firmware version: we need to type “AT+GMR” Command and click on send icon. This command will return the current firmware version of ESP8266 Module.
Download Latest Version Firmware
There are two types of Software Development Kits(SDK) for ESP8266:
- Non-OS SDK: It’s not based on any OS.
- RTOS SDK: It’s based on FreeRTOS.
The ESP8266 Module comes with an AT Command Firmware and the Firmware files are in the form of Binary Files i.e. .bin files. Here we are using Firmware Version 1.5.1, which is of the type Non-OS SDK.
Visit the official link, in order to download the AT Commands Firmware for ESP8266 or directly download from this link.
As soon as we click on download, Zip file will be downloaded and extract the file.
Flash memory addresses for Bin Files which will be flashing into ESP8266.
File | Address in Flash Memory |
---|---|
boot_v1.7.bin | 0x00000 |
user1.1024.new.2.bin | 0x10000 |
esp_init_data_default.bin | 0xFC000 |
blank.bin | 0xFE000 |
Flashing Firmware to ESP8266
Espressif Firmware
Tool Downloading
The ESP8266 is a low-cost Wi-Fi microchip produced by Espressif Systems. Espressif Systems also developed a ESP Flash Download Tool to update the firmware of ESP8266.
ESP8266 Firmware can be installed for two reasons: If we want to install the new firmware or to update the ESP8266 Firmware to its latest version.
visit the official link, in order to download the ESP Flash Download Tool, click on Tools section to select the tool or you can directly download from this link.
Tool Installation
After Downloading the tool, extracts the files and open the “flash_download_tools_v3.6.5” application file.
After opening the application file, it will display various options like ESP8266 Download Tool, ESP8285 Download Tool, ESP32 Download Tool and ESP32D2WD Download Tool. Now click on “ESP8266 Download Tool” because we are flashing the firmware to ESP8266.
Tool Settings
As soon as the ESP8266 Download Tool opens, we have to select and upload the four firmware bin files at four different addresses under “SPIDownlaod“. Select SPI SPEED as “40MHz”, SPI MODE as “QIO”, FLASH SIZE as “8Mbit”, COM as “COM3” and BAUD as “115200”.
For bin file addresses refer the above table at “Download Latest Version Firmware” section.
Now click on START icon to begin the firmware flashing to ESP8266. As soon as the flashing process starts, the tool will display two MAC Addresses as AP and STA and also displays the information about Module in the DETECTED INFO section.
While flashing firmware if we get any error, disconnect the ESP8266 connected USB, reconnect it and again click on START icon to begin the flashing.
If we didn’t get any error, the module will be updated with new firmware and “FINISH” message will be displayed on tool.
After completion of firmware flashing, close the tool, open Arduino IDE serial monitor, press RST butoon on ESP8266 and check for new firmware.
In order to check the updated firmware version, type “AT+GMR” in serial monitor and click on send icon. We will get a response with the AT Version number and the SDK Version number.
NodeMCU Firmware
NodeMCU flasher is a firmware programmer for NodeMCU DEVKIT V0.9.
Tool Downloading
Firstly we have to download the NodeMCU flasher. It’s a .exe file that we can download using one of the following links.
Flashing Firmware
Double click on the downloaded .exe file to open the flasher, Select the COM Port.
Click on “Config” icon, browse and upload the four bin files from downloaded firmware. For bin file addresses refer the above table at “Download Latest Version Firmware” section.
Click on “Flash(in Operation tab)” to start the flashing process. As soon as the flashing process starts, the tool will display two MAC Addresses as AP and STA. After the successful completion of firmware flashing process, the tool should appear a green circle with a check icon.
By this we will complete the Flashing or updating firmware of ESP8266 by using Espressif and NodeMCU Flasher.