ESP8266 “rom” boot code is overwritten when upgrade firmware

bootloaderesp8266firmwareflashrom;

You can flash the firmware using ESPTOOL with a command like

./esptool.py write_flash 0x00000 my_app.elf-0x00000.bin 0x40000 my_app.elf-0x40000.bin

this will overwrite the SPI FLASH chip with a new contents. But if you overwrite 0x0 region is the bootloader that allows flash the chip through UART lost? or is it a real rom mask code?

Best Answer

The bootloader and the basic peripheral library is in ROM on the ESP8266 chip itself. What you write to using esptool is the external flash chip. Due to the way the content of this flash chip is loaded into RAM (either 'permanently' or only cached) this ROM image is split into segments. (There can be more segments than these two, for instance for data.)

Side note: this blogpost by me has an overview of the various ESP8266 modules.

Related Topic