Using Arduino UNO to flash firmware on ESP-01

Hello,

I was originally trying to change the baud rate of my ESP-01 permanently from its default 115200 to 9600. In Arduino IDE Serial Monitor, i typed AT and got a response OK.
I tried AT+UART_DEF=9600,8,1,0,0 and AT+UART=9600,8,1,0,0 and got error in both cases.
I then typed AT+IPR=9600 and did not get any response. But after that, no AT commands are working.

I figured that the only option is to flash the official Espressif firmware and then try again to change the baud rate. This is the guide that i have followed: How to Update Flash ESP8266 Firmware - Flashing Official AT Firmware

I get red boxes instead of the green boxes with hex codes:


I reset the ESP-01 again while reading the Serial Monitor and i got the following text only at baud rate of 74880, which is odd to say the least:

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

did you fill in the addresses?
the AT 1.7 is for 2 MB flash, but the second megabyte is used only for OTA upload
select 16 Mbit-C1

0x0 boot_v1.7.bin
0x01000 at/1024+1024/user1.2048.new.5.bin
0x1fb000 blank.bin
0x1fc000 esp_init_data_default_v08.bin
0xfe000 blank.bin
0x1fe000 blank.bin

I'm using the ESP8266 AT Bin V1.5.1: https://www.espressif.com/sites/default/files/ap/esp8266_at_bin_v1.5.1.zip and the latest Flash Download Tools (ESP8266 & ESP32) V3.6.8
From the ESP8266EX Resources page, i guess i could use the latest AT firmware (ESP8266 NonOS AT Bin V1.7.1) but i don't want to risk it for now since the guide linked in my first post above uses AT firmware 1.5.1.

Anyway, the flashing seems like it went through:

Afterwards, in Arduino Serial Monitor, i reset the ESP and this is what i see:

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: 16Mbit(512KB+512KB)
jump to run user1 @ 1000

rf cal sector: 507
freq trace enable 1
rf[112] : 03
rf[113] : 00
rf[114] : 01

SDK ver: 2.1.0(ace2d95) compiled @ Oct 24 2017 12:04:16
phy ver: 1134_0, pp ver: 10.2

I typed AT and no response.

Edit: I fixed my mistake. Under 'FLASH SIZE', i had selected 16Mbit instead of 16Mbit-C1. I also used the newer AT firmware 1.6.2.
Here is the output from Serial Monitor after resetting the ESP-01:

ready
AT

OK
AT+GMR
AT version:1.6.2.0(Apr 13 2018 11:10:59)
SDK version:2.2.1(6ab97e9)
compile time:Jun  7 2018 19:34:29
Bin version(Wroom 02):1.6.2
OK

the detected flash size is 4Mbit. use addresses for 4 Mbit

0x00000
0x10000
blank.bin 0x78000
esp_init_data_default.bin 0x7C000
blank.bin 0x7A000
blank.bin 0x7E000

Do you mean?

0x000000     boot_v1.7.bin
0x010000     at/1024+1024/user1.2048.new.5.bin
0x1fb000     blank.bin
0x1fc000     esp_init_data_default_v08.bin
0xfe0000     blank.bin
0x1fe000     blank.bin

Juraj:
the detected flash size is 4Mbit. use addresses for 4 Mbit

0x00000
0x10000
blank.bin 0x78000
esp_init_data_default.bin 0x7C000
blank.bin 0x7A000
blank.bin 0x7E000

I suppose you came to this conclusion from this error line?

SPI Flash Size & Map: 16Mbit(512KB+512KB)

I am still unsure about the following:

  1. The flash size for my ESP-01 model is 0.5 MB or 4 Mbit? Am i correct?
  2. But in the flash tool settings, i already chose 16Mbit-C1 and it seems to be working. Will this cause any issues in my ESP programming or usage of the ESP-01 eventually? I plan to use it with the Arduino UNO to add Wi-Fi functionality to the latter.
  3. Why have you given hex codes for 3 blank.bin files? There is only one blank.bin file in the AT firmware download folder and the hex code i used for it is: 0xFE000

juraj is the expert.

I have several ESP-01 and I followed the tutorial : https://www.allaboutcircuits.com/projects/flashing-the-ESP-01-firmware-to-SDK-v2.0.0-is-easier-now/ . It seemed to work fine.

.

So, i re-flashed the ESP-01 as per the most recent suggestion and this time i used the very latest ESP8266 NonOS AT Bin V1.7.1:

I reset the ESP and got the following on Serial Monitor only at baud rate 74880:

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

mismatch map 5,spi_size_map 0
system param partition error
--- The partition table size is larger than flash size 0x80000 ---
please check partition type 6 addr:1fd000 len:3000
system_partition_table_regist fail

I re-flashed with a flash size of 8Mbit, reset and got the following:

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: 8Mbit(512KB+512KB)
jump to run user1 @ 1000

mismatch map 5,spi_size_map 2
system param partition error
--- The partition table size is larger than flash size 0x100000 ---
please check partition type 6 addr:1fd000 len:3000
system_partition_table_regist fail

Re-flashing with 16Mbit setting and reading from Serial Monitor at baud rate of 74880:

 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: 16Mbit(512KB+512KB)
jump to run user1 @ 1000

mismatch map 5,spi_size_map 3
system_partition_table_regist fail

Re-flashing with 16Mbit-C1 at reading from Serial Monitor at correct baud rate of 115200:

AT

OK
AT+GMR
AT version:1.7.1.0(Jul 15 2019 16:58:04)
SDK version:3.0.1(78a3e33)
compile time:Jul 15 2019 18:12:41
Bin version(Wroom 02):1.7.1
OK

I think you need the 512+512 bin file.

So, these settings worked for my ESP-01. I hope it helps others. :slight_smile:

And the latest AT commands work great!

AT

OK
AT+UART_DEF=9600,8,1,0,0

OK

so I can't imagine how 1.7.x can work on 512 kB (4Mb) flash.
some reading and links