Update Firmware on an ESP8266-01
![]() L14.3mm W24.8mm H3mm |
So below you see the three versions of ESP8266-01 modules that are manufactured by Ai-Thinker company.
The first pcb (blue) is obsolete. This pcb was the first of the kind, and it had an external eeprom of 512kb of memory which wasn't enough to perform OTA update.
Nowdays (2020) the other two are available on e-shops, with the pcb on the right labeled as "S-Series" to be the latest and most improved version of all ESP-01 pcb's.
According Ai-Thinker, "S-Series" pcb's were re-designed to accompish greater stability, and maximize the strength of the antenna, which reaches approx 40meters.
The new pcb also misses the power led, (which finds me accordant), and there is a silkscreen pinout connection at the back of the pcb which can be very helpful,
when you are not familiar with that type of pcb.
Finally these two pcb's are equiped with a 1MB(8Mbit) of SPI Rom, where can be upgraded to 4MB(32Mbit) by simply de-soldering the old Rom chip and solder the
new one. (Like the W25Q32 from Winbond). This gives you the ability to load custom webpages, SPIFFS (Serial Peripheral Interface Flash File System) to the onboard
memory, so to work it as a standalone module, without the need of a microcontroller.
If the onboard markings makes you unable to identify the size of the Rom, later on i will show you how it can be identified by the official ESP flashing tool.
![]() |
![]() (Click to enlarge) |
Now lets make a small analysis of the ESP8266-01 module pins.
This is the positive power supply pin. Nominal voltage is 3.3V to 3.6V(Max) | |
Driving this pin LOW it causes the module to Reset. | |
Chip power down pin.(AKA Enable pin.) This pin should be pulled high in order to operate and accept commands. | |
This is the Transmit pin of the serial communication. (TTL Logic level 3.3V) Logic shifter for 5V. | |
This is the Ground of the module. | |
General purpose Input / Output (2) | |
General purpose Input / Output (0) (Also used when updating the firmware) | |
This is the Receive pin of the serial communication. (TTL Logic level 3.3V) Logic shifter for 5V. |
![]() (Click to enlarge) |
When you buy this module, it comes pre-programmed with an AT command Set Firmware on it.
This tutorial will guide you of how to update this kind of AT command set firmware, to a latest version.
Firstly you will need a USB-to-TTL Serial converter (Fig4) on the right. (Make sure to have placed the jumper to 3.3v)
That is because these days computers don't have a COM port available on their hardware, on which will be needed to communicate
with the module so to update it's firmware.
So by using a USB-to-TTL converter you create a VCP (Virtual Com Port) to your computer, which is used to convert
USB data to TTL-level UART serial data and vice versa.
I strongly recommennd you to buy a module which has an FTDI 232 chip on it.
FTDI company is specialising in USB technology, and it develops, manufactures, and supports devices and their related software
drivers for converting RS-232 or TTL serial transmissions to USB signals, and again vice versa.
![]() (Click to enlarge) |
This is the connection i did, and you need to do, to update an ESP8266-01 firmware.
After that, once you power the circuit the ESP enters the programming mode. (Pretty simple... pretty easy...)
(A note for the power supply...) The power supply should be capable of delivering at least 1A of current to the circuit.
Now let's have a look of the software that we will use for the update.
Espressif systems has relesed a software that connects to ESP82xx and ESP32 devices which flashes the ROM to a latest version.
This program is named as "Flash Download Tools (ESP8266 & ESP32)" and here is the official >>> LINK <<< if you want to download it.
You will also need the latest version of the AT command set Firmware that is going to be flashed in the eeprom memory where it can be also
downloaded from Espressif official site >>> LINK <<< Just select the firmware for ESP8266ex and not for ESP32
During flashing procedure i came accross with an unexpected error !!!.
It was so diffucult for me to figure out what went wrong, since all my setting were made according Espessif's flashing documentation.
As you can see from below at the end of the flashing procedure i received an error notification message, without analyzing anything more.
After a loooooot of trial and error, i made a thought that came true!!!. As strange as it might hears, the problem was occuring because of
the USB to TTL converter. Although both have FTDI chips on them, as many tries i did, i never succeeded flashing one of the ESP8266 modules.
I tried to spot differences between the modules, and what i found is that one of the modules has tantalum capacitors, which this is the
module that succeded flashing ESP and the markings on the FTDI chips are different which might mean different chip manufacturer.
(And perhaps not standarized materials) I will do some changes and i will post again my results.
Ai-thinker has created a table of the current production ESP-01 modules (2020) which can be revised, in order to select an appropriate module for your application.
I have found some F.A.Q that i would like to share with you since this can be very helpful to overcome problems that you might face when you experimenting
with the ESP8266. Whenever i find new F.A.Q i will upload them here.
(Question)
In the Download Tool V3.4.4 what is:
(a) Device Master Key ?
> You may ignore the field (leave it as it is) right now. It is not a functional official feature as of right now. We will update on it soon.
(b) the correct setting for the SPI Mode on the WROOM-02 ?
> You may go for QIO mode on this one. DIO will work on pretty much every module.
(c) the Xtal frequency and SPI speed on the WROOM-02 ?
> The crystal frequency is 26 MHz
(Question)
In the ESP8266 NONOS_SDK V2.0.0_16_08_10
(a) There are 2 folders "at" and "at_sdio". I assume at_sdio uses the SIO port for I/O instead of the UART ?
> Yes, at is for UART based communication, and at_sdio for SDIO based systems.
(b) Where is the documentation about how to use the SIO port for AT commands ?
> The SDIO based system uses the same commands as the UART mode. The SDIO interface is an international standard and therefore,
there is no specific
device-level documentation required. You may refer to standard SDIO rev.2.0 documentation.
(c) In the file at/readme.md it says #BOOT MODE and #NON-BOOT MODE. What is the difference between these modes ?
> Boot mode is when you use user1.bin and user2.bin and that helps implement online updates for ESP8266. In non-boot mode, there is no provision for supplying
online updates to firmware over WiFi. Please refer to the FAQ and Getting Started Guide for more information: www.espressif.com/products/hardware/esp8266ex
(d) In the file at/readme.md it shows how it can be flashed OTA. How do you tell it which of at or at sdio you want to be flashed ?
> Please use the UPDATE AT command for updating the flash OTA. The firmware knows which type it is (set at the time of compiling) and boot.bin handles
the stuff that determines how to proceed with flashing an update.
(e) When using the flash tool, the 4 files mentioned i.e. boot,,,, user,,,, esp_init.... blank.... are sufficient to flash the device ?
> Yes, boot BIN manages booting and flash updates. User BIN is the main application BIN (user1 and user2 are updated alternatively, so that the device is not
bricked
if a flash update fails without properly completing. One of the BINs is definitely reliable at all times).
Init BIN contains initialization parameters and blank BIN is used to erase some sectors that store application information.
(Question)
What does "busy" , "busy s..." and "busy p..." means ?
> "busy" means that the previous AT command is not finished yet, so we cannot accept the next AT command.
> "busy p" means command is doing.
> "busy s" means sending data is doing.
(Question)
What is is the required time between each packets transmition ?
> We need to wait 20ms between each packets .
(Question)
What is is the maximum transmition byte length ?
> Maximum length is 2048 bytes per packet.
(Question)
What is is the difference between "at" and "at_sdio" ?
> "at" uses UART to send AT commands.
> "at_sdio" uses SDIO.
(Question)
After a change on UART speed i can't get any response of the ESP8266. Is it possible to have it bricked ?
> We suggest when using "UART_CUR" which would not be saved in flash to try the new configuration first, if it can not work,
you can just power off and power on to recover.
The last parameter "3" means UART flow control which needs your UART hardware to support flow control.
Maybe you could try to connect the CTS、RTS, and enable the flow control on your UART tool, and try again.
If it does not work, you need to re-download AT firmware to your module to recover.
(Question)
What is SSPIFFS ?
> SSPIFFS stands for SPI Flash File System
It's a light-weight file system for microcontrollers in an SPI flash chip. The on-board flash of ESP8266 has plenty of space for our webpages, especially the 4MB version.
For those who have played with ESP8266 will know that our webpages are stored as strings in our code or data words for each pair of 2 bytes of 8bit length.
This makes the code to be very hard to read, and soon you'll run out of mcu memory.
SPIFFS let's you access the flash memory as if it was a normal file system like the one on your computer (but much simplier) as a result to read, write files and create
folders in the flash memory.