This is part 2 of the series: How to flash firmware on ESP8266. There are many firmwares available out there.In this post, we will discuss how to flash the ESP8266 with the AT commands based firmware.
Flashing the ESP8266 is pretty simple. You need to connect the ESP as shown below.
Flashing The ESP8266 with AT commands based firmware.
Download the AT commands firmware by clicking this link. The file contains two firmware:
- v22.214.171.124 – This is the latest one
You will also need the flasher. Download it here
Load the firmware bin file
Clicking on the “Bin” tab (red box 1) opens the windows explorer from where you can search the firmware file you just downloaded. The file will have a .bin extension. Or if you know the path of the file, you can enter it directly (in red box 2).
Change the COM port
By default it takes COM1. To find out the COM port go to start>device manager
The COM number can be seen under the Ports tab. If you have multiple devices connected, you will have to check the name of the devices. In our case it is “Silicon Labs CP210x …..” Our COM port is COM3. It can have any value. Not necessarily 3.
Change COM1 to COM3 and leave the address to 0x00000.
All’s set now. Hit the “Download” button without fear. This is what you should see.
You should see the ‘Erasing flash’ message now. If you do not see it, skip to the troubleshoot section to get it moving.
Once the flashing is complete, you should see this
It shows 99% and then
Failed to leave Flash mode”
Don’t worry about this. There is probably some error in the flasher. We are good to go. We have updated the ESP with the chosen firmware.
We will now confirm if everything works fine.
Open Real term. If you don’t have it, you can download it here. Its free.. 🙂
Click on the ‘Port’ tab. The one in the red box
Change the baud rate to ‘9600’. This is the default baud rate of the firmware.
Change the port to 3. This is the same one we found out from the device manager for the flasher.
Now open the port.
Remove the GPIO from ground and press the reset button. You should get some data. Even if the initial part is junk, it should end with an “OK” or some line such as in the image below.
Complete junk means that the baud rate is incorrect. Change the baud rate to check which one works.
Now go to the “Send” tab
Enter “AT” in the user input field without the quotes. Select “+CR” and “+LF” from the EOL column. Now Hit “Send ASCII”.
You should get “OK” in reply.
The OK response means that everything is working great and we have successfully flashed the ESP8266. Now bring out the genius in you and start making awesome devices.
- ESP8266 not getting programmed.
If you are not getting the “Erasing flash” message, you should probably be getting the “Failed to connect” message.
There could be various reasons for this.
- Check that the device is connected to the USB port
- Check that the Com port is correct
- Check that the COM port is not open in any other software such as RealTerm. Only one application can make use of a COM port at any given time.
- Check that the Rx and Tx pins are connected properly.
- The GPIO0 pin should be connected to ground
- Reset the ESP after connecting the GPIO0 to ground (programming mode). I found this reason to be most annoying. If you don’t reset the ESP after putting it in programming mode, it won’t be detected by the flasher.
Do let me know your thoughts about this post in the comments section below.