How to Upload New Firmware to ESP8266 (ESP-01S, ESP-01) (Newest 3.0.5 SDK, 1.7.5.0 AT) USE ESPTOOL.PY!

by CrazyGuyN2O in Circuits > Arduino

2304 Views, 2 Favorites, 0 Comments

How to Upload New Firmware to ESP8266 (ESP-01S, ESP-01) (Newest 3.0.5 SDK, 1.7.5.0 AT) USE ESPTOOL.PY!

20220815_172858.jpg

This was really frustrating for me, and I want to show the method that worked for me. I assume that by this point, you have gotten serial hooked up (Best is a little USB programmer dongle) because that's covered in most other guides.

Also, it's just good to update the firmware so you don't have any AT command troubles on a module you bought because they often aren't updated to the newest firmware (mine was on AT 1.1.0.0).

Supplies

ESP8266

Computer

USB to serial conversion hardware.

The Problem

Screenshot 2022-08-15 164516.png

You've probably already tried this. You put all the bins in the GUI flasher tool and hit start. It seemed like it worked, but then when you reset the ESP, it output what looks like garbage to the serial terminal and the blue LED is flashing rapidly. (actually this is debug info at 74880 baud). What I found out is that the automatic detection of the flash size may not be completely reliable (see how it says 32Mbit (which is 4MB) (which actually checks out with the 4MB ESP module I purchased (However, it seems to actually be a 1 MB module as you'll see later))). I changed the terminal baud to 74880, and it said something about the system partition not being correct.

Error message:

ets Jan  8 2013,rst cause:2, boot mode:(3,6)


load 0x40100000, len 2592, room 16 
tail 0
chksum 0xf3
load 0x3ffe8000, len 764, room 8 
tail 4
chksum 0x92
load 0x3ffe82fc, len 676, room 4 
tail 0
chksum 0x22
csum 0x22


2nd boot version : 1.7(5d6f877)
SPI Speed : 40MHz
SPI Mode : QIO
SPI Flash Size & Map: 4Mbit(256KB+256KB)
jump to run user1 @ 1000


correct flash map
mismatch map 2,spi_size_map 0
system param partition error
--- The partition table size is larger than flash size 0x80000 ---
please check partition type 6 addr:fd000 len:3000
system_partition_table_regist fail
V2
Mo
rf_cal[0] !=0x05,is 0x00

I think this is caused by the automatic detection in the GUI program thinking that the flash is bigger than it actually is and creating a partition table that has addresses beyond the actual size of the flash. (It's automatically detected as 32Mbit, but the debug readout says that it is 4Mbit (which is half of 1MB) (I have no idea why it's saying that and why setting the memory size parameter to 1MB still made it work (if the size was actually 4Mbit, it would probably still say that there is a partition error after flashing))

The Solution

Files:

esptool-master download

ESP8266_NONOS_SDK-3.0.5 download

You will need python installed for this step (make sure to click the add to path checkbox (it shouldn't be required, but it can save you some headaches in the future) ) The solution is to use esptool.py. You'll have to download the esptool.py master file from GitHub, unzip it, and add all the necessary bins (binary files (.bin)) to the directory (folder) that esptool.py is in.

They are: (all in ESP8266_NONOS_SDK-3.0.5/ESP8266_NONOS_SDK-3.0.5/bin)

boot_v1.7.bin,

user1.1024.new.2.bin (it's in at/512+512),

blank.bin,

esp_init_data_default_v08.bin

With esptool, you can manually select the memory size (1MB worked for me (but you can change it if you have a bigger flash)) instead of relying on the automatic detection. Once you've done that, open the esptool-master directory in command prompt (right click in the folder and click open in command prompt in the drop down menu (you could also just cd to it)). Command prompt will open. Now just copy this command, and it should work. (Make sure you don't have any programs using serial running in the background (arduino, cura, terminals) because it will give you a serial error)

esptool.py write_flash --flash_size 1MB 0x0 boot_v1.7.bin 0x01000 user1.1024.new.2.bin 0xfb000 blank.bin 0xfc000 esp_init_data_default_v08.bin 0xfe000 blank.bin 0x7e000 blank.bin

Yay. Hopefully Your ESP Is Unborked and Has the Latest Firmware

Good luck!

and HUGE thanks to Juraj on the Arduino forums: https://forum.arduino.cc/t/solved-esp8266-esp-01-firmware-1mb-chip/679933

That was the final key to solving this headache.

And thanks to this much more comprehensive guide: https://www.instructables.com/Flash-or-Upgrade-Firmware-on-ESP8266-ESP-01-Module/


Now you can try out some AT commands: https://docs.espressif.com/projects/esp-at/en/release-v2.2.0.0_esp8266/AT_Command_Set/Basic_AT_Commands.html