Header Ads

How to Flash ESP-01 Firmware to the Improved SDK v2.0.0



Despite the difficulty of updating the firmware in modules like the ESP-01, the ESP8266 microcontroller with built-in Wi-Fi has become extremely popular among electronic designers. Now, thanks to more information and better tools, the flashing process is significantly easier, and SDK v2.0.0 adds new capabilities.
how to flash esp8266,how to flash esp8266 with arduino,how to flash esp8266 12e,how to flash esp-01,how to flash esp32,how to flash esp8266 firmware,how to flash esp8266 01,how to flash esp8266 using arduino ide,how to flash esp8266 nodemcu,how to flash esp8266 12f,a flash español,how to use esp flash download tool,how to flash esp 01,how to flash esp8266 with arduino uno,how to flash esp8266 using ftdi,

Introduction

The success of the ESP8266 from Espressif Systems is undeniable. It is a powerful microcontroller with built-in Wi-Fi capabilities and is readily adaptable to a multitude of uses in the rapidly growing IoT (Internet of Things). One of the few difficulties to using the IC has been updating the firmware in the thousands and thousands of development modules that have permeated the market. Judging by the large number of comments posted, this article on All About Circuits has been a help to many. However, the passage of time has revealed some corrections and improvements needed in the information that was provided in October of 2015, and presenting that information is the goal of this article.
Specifically, the following improvements will be addressed:
  • a better flashing circuit
  • an easier-to-use terminal program
  • a revised Flash Download Tool
  • updated SDK v2.0.0 ESP8266 firmware
Taken collectively, and supported by better documentation from Espressif, these changes will streamline the firmware flashing process, and increase the ESP8266's usability to both hobbyists and professional designers.
As a note, this article is a successor to a previous version that was published in October of 2015. You may want to peruse that article for some worthwhile background information.

The Flashing Circuit

An improved flashing circuit for the ESP-01 module is shown in the following schematic diagram; several changes have been made to the original design:
  1. The 3.3VDC power is no longer taken from the USB-to-TTL converter. Some converters do not provide sufficient current to properly drive the ESP8266, especially when it is in the Wi-Fi transmitting mode. A separate, well-filtered and regulated 3.3VDC supply capable of supplying at least 500mA should be used.
  2. Capacitors C1 and C2 have been added to provide noise reduction on the power bus. They should be located as close as possible to the Gnd and Vcc pins on the ESP8266.
  3. R2 and R3 are pullup resistors that were added to ensure that the GPIO2 and GPIO0 pins on the ESP8266 are never allowed to float.
These changes do not indicate that the original flashing circuit was nonfunctional; the fact is that it did work for the author and for many other users. However, its shortcomings were such that the circuit could and did fail for some users at least some of the time. These failures could have been due to differences in environmental factors, power supply quality, and/or component tolerances. The improved circuit should eliminate those weaknesses.

Click to enlarge

The improved flashing circuit is shown built on a solderless breadboard in the following photographs. The first photo shows the entire circuit with the ESP-01 module in place; the second photo shows the circuit with the ESP-01 module removed in order to reveal the locations of C2, R2, and R3. Note that the wire colors in the breadboard assembly correspond to the color designations in the schematic drawing.


The PCB assembly at the right side of the breadboard is a well regulated and filtered 3.3VDC power supply. For complete information on building a copy of this power supply, see this article on AAC. Otherwise, you may use any power source with similar capabilities.
The PCB assembly in the upper left corner of the breadboard is the USB-to-TTL converter. As you see, it is inserted directly into the solderless breadboard using six Dupont style header pins that protrude down from the bottom of the PCB. You can modify your USB-to-TTL converter to work in that very convenient way, or you can use discrete wires to make the connections. Whichever you choose, be certain to follow the pinout sequence as shown in the schematic drawing and the photographs. Note that only three connections are required: RxD from the converter to TxD on the ESP-01, TxD on the converter to RxD on the ESP-01, and common ground.
Even though the USB-to-TTL converter is not being used to power the ESP-01, be sure that the converter is set to 3.3VDC so that the signal voltage levels will not exceed the input range of the ESP8266. Any voltage higher than 3.3VDC connected to the ESP8266 may damage it beyond repair.


In the photo immediately above, the ESP-01 module has been removed from the assembly revealing the author's home-built breadboard adapter for the ESP-01. In the photo just below, the home-built adapter is shown on the left, as well as an almost identical professionally built adapter from Addicore on the right. They work identically and make it much easier to use an ESP-01 module in a solderless breadboard or any similar device with connectors on 0.1 inch (2.54 mm) centers.


Once you have completed construction of your flashing circuit, it's almost time for testing. But before attaching the USB cable or applying power, recheck the wiring—especially the power wiring. It's better to take a few extra minutes now than to damage something because of incorrect wiring.
First, connect the USB cable from the PC to the USB-to-TTL converter. A positive indication is when the red LED at the corner of the PCB close to the USB connector lights, and the PC recognizes the converter. At that point, note what COM port number has been assigned to the converter. As you can see in the photos, COM4 has been assigned to the converter shown, and a label has been attached to identify the relevant COM port.
Next, apply 3.3VDC power to the flashing circuit. You should see a couple of flashes from a blue LED on the ESP-01 module, and a red LED on the module should be steadily illuminated. No smoke or odd smell should be coming from the circuit.
Now, press and release SW1 (the reset switch); the blue LED should flash. Then, press and release SW2 (the flash switch); nothing noticeable should happen.
If all that went according to plan, your flash circuit is probably wired correctly. It's time to perform the definitive check: will the ESP8266 answer when you call it to attention?

Parts List

The parts for the flashing circuit are shown in the following table. In addition, you may need assorted wire, solder, and a well-regulated and filtered 3.3VDC power supply.

Part Ref.DescriptionSourceItem No.
C1Capacitor, Ceramic, 0.1µF, 50VDigi-Key399-9797-ND
C2Capacitor, Aluminum Electrolytic, 220µF, 16VDigi-Key493-1041-ND
R1-R4Resistor, ¼ W, 10kΩDigi-Key10KQBK-ND
N/ABreadboard, Solderless, 400 ContactDigi-Key377-2094-ND
N/AAdapter, Breadboard, DIP8, for ESP-01 & nRF24L01AddicoreBB-ADTR
N/AModule, ESP8266, ESP-01Digi-Key1568-1235-ND
SW1-SW2Switch, Tactile, Momentary, Normally Open, SPST, Pushbutton, 2-Pinon-line*N/A
N/AConverter, USB-to-TTL, with 3.3V Capabilityon-line*N/A
*All parts are readily available from a variety of suppliers with the possible exception of the USB-to-TTL converter, and SW1-SW2, which may have to be located via online searches. SW1 and SW2 are ordinary tactile, momentary, normally open, SPST pushbutton switches, but with only two pins on the bottom. Because the pins are on 0.2" centers, they work well in solderless breadboards; see the photo in this article.

Getting Started with Termite

PuTTY was the recommended terminal program in the original article on flashing ESP8266 ICs, and if that is what you have and want to use, it works fine. However, Termite is somewhat more user-friendly in this application and will be used in the step-by-step instructions that follow. Termite is free for both personal and commercial use.
The following instructions assume that the ESP-01 module is programmed just as it is normally received from a supplier. If you (or someone else) has made changes to the default program settings, you will need to experiment to find the current settings for your ESP-01 module.
After checking your ESP-01 flashing circuit as previously described, power it up. Start Termite on your PC and click the Settings button; you should see a window similar to the one below. Be certain that the COM port to which the USB-to-TTL converter is connected is correctly selected in the Serial port settings window. Adjust all other settings as shown in the Serial port settings window below, and click OK to close the Serial port settings window.


At this point, the cursor should be flashing in the bottom section of the Termite window; if not, click on the bottom section of the Termite window to position the cursor there. Type AT and press Enter on your keyboard; if all is well, the ESP-01 will respond with OK in the Termite window. If it does, breathe a big sigh of relief because you have just cleared a major hurdle.
Next, type AT+GMR and press Enter. The ESP-01 should respond with something very similar to the window below.


The AT+GMR command tells the ESP8266 to report what version of the AT command set it contains, what SDK (Software Development Kit) has been loaded on it, what company built the ESP module, and when the SDK was loaded on the module. Finally, as usual, the ESP8266 concludes its transmission with OK.
If the ESP-01 responded correctly, you are finished with Termite (unless you want to play some more). You will use it again in this project to confirm a successful firmware flash.

ESP8266 Downloads

All the necessary documentation and tools for flashing the firmware on ESP8266 chips are available online, and much of it resides at the Espressif website. As a convenience to AAC readers, much of it is also available here. The Flash Download Tool and the Software Development Kit are absolutely essential. Not all the documents are required, but they are all potentially helpful. Please download the files and store them on your computer in a directory where you can find them, so that you can perform an ESP8266 firmware flash as described just ahead in this article.

Flash Download Tool v3.4.4

Version 3.4.4 of the Flash Download Tool is the latest version available from Espressif at the time this article is being prepared. The tool for the ESP8266 looks almost identical to the past several versions all the way back to v2.3, except that two new tools have been added to the package. One is for the ESP8285 and the other is for the ESP32, neither of which are of any use with the ESP8266. Click the button below to download v3.4.4; you will note that it contains a version for PCs and a Mac version. This article will use the PC version.



Software Development Kit 2.0.0

As of this writing, the latest available version of the ESP8266 Software Development Kit is version 2.0.0, which was released in July of 2016. While almost nothing is certain in firmware development, one might conclude that v2.0.0 is the last version that will be released. At any rate, it seems to be a stable version and will be used in this article. It is available free to download from Espressif, but to save the readers some trouble, it is also available here by clicking the button below.



ESP8266 Documentation

As is often said, "When all else fails, read the instructions," and to that end, Espressif has an impressive collection of documents pertaining to the ESP8266. There is little doubt that the answers to many questions are contained in their pages. Three of the documents used most frequently by the author are ESP8266 Quick Start Guide, version 1.3, ESP8266 SDK Getting Started Guide, version 2.7, and ESP AT Instruction Set, version 2.0.0. These three, along with several others, are included in the zip file available for download via the button below. Note that additional documents and more current documents may be available at the Espressif website.



Bits and Bytes Recollected

The amount of EEPROM on an ESP8266 module (such as the ESP-01) is a very important factor in the exact flashing procedure that is to be used. That EEPROM quantity can be expressed in a variety of different units of measurement, and the units used vary from place to place in the documentation, which can be confusing. The bullet points and the table below are included as a ready reference to minimize the muddle.
  • The abbreviation for bit is b, and the abbreviation for byte is B.
  • There are eight bits (b) in one byte (B).
  • The abbreviation for kilobit is Kb, and the abbreviation for kilobyte is KB. Likewise, megabit is abbreviated Mb, and megabyte is abbreviated MB, etc.
  • It's also good to note that most (maybe all) ESP-01 modules built on black PCBs have 1 MB of EEPROM.

Term
Byte (B)Kilobyte (KB)Megabyte (MB)Gigabyte (GB)Terabyte (TB)
Number of Bytes11,0241,048,5761,073,741,8241,099,511,627,776

The Flashing Process

Reading from Your ESP-01 Module

Install the ESP-01 module in the flashing circuit, connect the USB-to-TTL converter to a USB port on your PC, and power up the circuit with 3.3VDC. Start version 3.4.4 of the Flash Download Tool, and you should see the startup screens as shown below. The back window is where a complete activity log for the download tool is recorded. The top window is a tool selection window; because you are working with an ESP8266 module, click the ESP8266 Download Tool button.


If this is the first time the ESP8266 download tool has been used, a window like the one below will open with no data in the form fields. If the SPIDownload tab near the top of the window is not selected, select it now.


If any of the boxes have check marks in them, uncheck them all. Next, make sure that the COM port you are using and the correct BAUD rate are selected at the bottom right. Click the radio button under SPI SPEED for 40MHz, and the radio button under SPI MODE for QIO. Do not click any other radio buttons, add any check marks, or enter any data.
  1. Press and hold the Reset button (SW1) on your flashing circuit.
  2. Press and hold the Flash button (SW2) on your flashing circuit.
  3. Release the Reset button.
  4. Release the Flash button.
  5. Click the Start button at the lower left portion of the download tool window.
The download tool will work for a few seconds to read the contents of the ESP-01 module and print the results in the appropriate panels as shown below.


Here's what has happened during the download tool process time:
  1. The download tool determined the size of the EEPROM on the module as "QUAD;8Mbit," which translates to 1Megabyte.
  2. The download tool determined the crystal speed to be 26MHz.
  3. The download tool read the MAC addresses for your ESP-01 module in both the AP (Access Point) mode and in the STA (Station) mode, and entered them in Download Panel 1. (Note that the MAC addresses for your ESP-01 module will be different from the addresses shown above; record the MAC addresses of your module for future reference.)

Writing to Your ESP-01 Module

Finally, you are ready to select and write the new firmware to your module. Set SpiFlashConfig as follows:
  1. Select CrystalFreq as 26M.
  2. Click the SPI SPEED radio button for 40MHz.
  3. Click the SPI MODE radio button for QIO.
  4. Click the FLASH SIZE radio button for 8Mbit.
Select the binary files to be downloaded from their storage locations as shown in the table below. (The files listed below are contained in the ESP8266 SDK v2.0.0 folder that you dowloaded and stored on your PC.)

Binary File NameBinary File LocationESP-01 Flash Address
blank.bin...\esp8266_nonos_sdk_v2.0.0_16_08_10\ESP8266_NONOS_SDK\bin0xFB000
esp_init_data_default.bin...\esp8266_nonos_sdk_v2.0.0_16_08_10\ESP8266_NONOS_SDK\bin0xFC000
blank.bin...\esp8266_nonos_sdk_v2.0.0_16_08_10\ESP8266_NONOS_SDK\bin0x7E000
blank.bin...\esp8266_nonos_sdk_v2.0.0_16_08_10\ESP8266_NONOS_SDK\bin0xFE000
boot_v1.6.bin...\esp8266_nonos_sdk_v2.0.0_16_08_10\ESP8266_NONOS_SDK\bin0x00000
user1.1024.new.2.bin...\esp8266_nonos_sdk_v2.0.0_16_08_10\ESP8266_NONOS_SDK\bin\at\512+5120x01000

A. Click to place a check in the first (top left) check box below Download Path Config; the entire data entry line will turn red as shown below.


B. Click the ellipsis (...) button in the first line and navigate to the location on your PC where the SDK 2.0.0 binary files are stored; select the blank.bin file. The entire file path will be entered into the box to the left of the ellipsis button.
C. Next, enter the hexadecimal address to the right of the ellipsis button where the blank.bin file is to be stored: 0xFB000 in this case.
Repeat steps A through C for each of the six binary files. The completed data will appear as shown below.


After rechecking all the file paths and hexadecimal storage locations, take the following actions:
  1. Press and hold the Reset button (SW1) on your flashing circuit.
  2. Press and hold the Flash button (SW2) on your flashing circuit.
  3. Release the Reset button.
  4. Release the Flash button.
  5. Click the Start button at the lower left portion of the download tool window.
The download tool will work for several seconds to write the binary files to your ESP-01 module. When the blue progress bar reaches the right side of the window, the flashing process is complete as shown below.


Press and release the Reset button (SW1) on your flashing circuit. Power down the flashing circuit.

Confirming a Successful Flash

To confirm that the flash process was successfully completed, power up the flashing circuit. Start Termite and check the firmware version as previously described, and as shown below. You should see the following results.


Your ESP-01 module is updated to SDK version 2.0.0, and to AT command set version 1.3.0.0. Congratulations! You are ready to put the ESP-01 to work in your IoT project.

Tags:
how to flash esp8266,how to flash esp8266 with arduino,how to flash esp8266 12e,how to flash esp-01,how to flash esp32,how to flash esp8266 firmware,how to flash esp8266 01,how to flash esp8266 using arduino ide,how to flash esp8266 nodemcu,how to flash esp8266 12f,a flash español,how to use esp flash download tool,how to flash esp 01,how to flash esp8266 with arduino uno,how to flash esp8266 using ftdi,how to flash esp8266,how to flash esp8266 with arduino,how to flash esp8266 12e,how to flash esp-01,how to flash esp32,how to flash esp8266 firmware,how to flash esp8266 01,how to flash esp8266 using arduino ide,how to flash esp8266 nodemcu,how to flash esp8266 12f,a flash español,how to use esp flash download tool,how to flash esp 01,how to flash esp8266 with arduino uno,how to flash esp8266 using ftdi,

How to Flash ESP8266 Firmware Update…
www.esp8266.com/viewtopic.php?f=15&t=12440
The latest firmware is SDK 1.3.0 but we will flash it the same version as it is the only version that support this ESP-01 with 4Mbit of flash size.
ESP-01 ESP8266 WiFi IOT Flashing…
www.youtube.com/?v=Fk-CQ7sUVRs
4 Oct 2016 ... How to update or re-flashing ESP8266 ESP-01 Ai Thinker ... ... ESP8266 ESP-01 Ai Thinker version firmware using ESP Flash Download Tool.
How to Flash ESP-01 Firmware to the Improved SDK…
www.allaboutcircuits.com/.../flashing-...asier-now
17 Mar 2017 ... Despite the difficulty of updating the firmware in modules like the ESP-01, the ESP8266 microcontroller with built-in Wi-Fi has become ...
Esp8266 Firmware Update - Instructables
www.instructables.com/.../
Make sure you download write bin file (this bin files are firmware files of different ..... Remember one thing, pull the flash pin of esp to gnd for ex: for esp 8266-01 ...
Flashing ESP8266 ESP-01 - IoT Experiments
www.iot-experiments.com/flashing-esp8266-esp01
28 Feb 2016 ... It was flashed with an old version of Expressif firmware. ... In fact, I tried to flash my ESP-01 module many times, and although all seemed to be ...
Flashing the firmware - NodeMCU Documentation
nodemcu.readthedocs.io/en/master/en/flash
Run the following command to flash an aggregated binary as is ... It might help to double check as e.g. some ESP-01 modules come ...
Flashing NodeMCU Firmware on the ESP8266 using Windows…
randomnerdtutorials.com/.../
Flashing NodeMCU Firmware into your ESP8266 using Windows is easy. You simply wire your circuit, download the flasher and hit flash. ... DOWNLOAD FREE PDF: Getting Started with ESPlorer IDE and ESP8266. If you're new to .... Other ESPs, for example, ESP version 01 comes with a firmware that uses AT commands.
ESP8266 firmware update - IOT-playground
iot-playground.com/.../35-esp8266-firmware-update
ESP8266 firmware flashing tutorial. ... Then we need program to flash ESP8266. I 'm using ... ESP8266 ESP-01 Serial WIFI Wireless Transceiver Module.
Tutorial ESPEasy Firmware Upload - Let's Control…
www.letscontrolit.com/.../
1 Mar 2017 ... To get the ESP Easy running, you need to replace the firmware with the ESP ... This can be done with a special flash upload tool that uses the ESP ... The ESP01 needs an external USB to Serial board to upload the firmware.
ESP8266 with AT Commands – Flashing/Updating the…
flower-platform.com/.../
16 Dec 2015 ... We are going to upload (flash) the latest official firmware from Espressif (the ... ESP8266 based board (e.g. ESP-01 or ESP-201); 3.3V FTDI ...
Flash ESP8266-01 with Arduino Uno –…
cordobo.com/2300-flash-esp8266-01-with-arduino-uno
11 Dec 2016 ... Eventually I managed to flash the ESP-01 firmware with pieces of information from Instructables, various blogs and youtube videos. That's why I ...
Notes on using the ESP8266 with the Arduino IDE · GitHub
gist.github.com/stonehippo/3d9eb100d4f545015515
12 Mar 2017 ... The ESP-01 is probably the most common ESP8266 module .... these tools in hand, I was able to flash the board directly with the AT firmware.
Flash AT Firmware To ESP8266 WiFi Module [EASIEST…
riktronics.wordpress.com/.../
19 Oct 2016 ... The chip first came to the attention of western makers in August 2014 with theESP-01 module, made by a third-party manufacturer, AI-Thinker.
Flashing ESP8266 firmware v1.5 using Arduino Uno - Yet…
yaab-arduino.blogspot.com/.../flashing...uino.html
27 Dec 2015 ... I have to admit that I had some bad experience when trying to flash new firmwares to my ESP-01 modules but today I have found an easy and ...
flash firmware to ESP-01 ESP8266 - Quad Me…
quadmeup.com/.../
11 Mar 2016 ... It took me better part of evening to find a working way to flash firmware, anyfirmware, to cheap ESP-01 ESP8266 WiFi modules. There are ...
Flashing and programming the ESP-01 -…
blog.quindorian.org/.../esp8266-wif...-esp-01.html
1 Jan 2015 ... To get started with the ESP8266 ESP-01 I recommend flashing and ... To get the ESP-01 in firmware flash mode we will need to connect it in a ...
Espruino - ESP8266_Flashing
www.espruino.com/ESP8266_Flashing
Update the Espruino firmware to a new version over Wifi (OTA upgrade) ... The esp-01 has barely any usable I/O, only has 512KB flash, and the RF is 10dB ...
1. Getting started with MicroPython on the ESP8266 — MicroPython…
docs.micropython.org/.../tutorial/intro.html
The main characteristic of a board is how much flash it has, how the GPIO pins are ... Currently we only support esptool.py to copy across the firmware. You can  ...
ESP8266 Quick Start Guide - Benlo Park
benlo.com/esp8266/esp8266QuickStart.html
There are several ESP8266 boards available, usually numbered ESP-01 ... The tool you will use to flash the NodeMCU firmware on your ESP8266 board is the ...
ESP8266 ESP-01How to Flash AT commands…
esp8266internetofthings.blogspot.com/.../ho...html
7 Oct 2015 ... Flash AT commands firmware in ESP8266 ESP-01 device. The module comes with AT commands firmware when buy but you can flash other ...

No comments