Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Firmware Image Format
Firmware image format
Note: Currently this document refers to ESP8266 only. ESP32 has some additional headers.
This is technical documentation for the firmware image format used by the ROM bootloader. These are the images created by
The firmware file consists of a header, a variable number of data segments and a footer. Multi-byte fields are little-endian.
|1||Number of segments|
|2||SPI Flash Interface (
|3||High four bits:
esptool overrides the 2nd and 3rd (start from 0) bytes according to the SPI flash info provided through command line option, regardless of corresponding bytes from the input .bin file that will be written to address 0x00000. So you must provide SPI flash info when running
esptool write_flash command. For example
esptool write_flash -ff 80m -fm qio -fs 8m 0x00000 boot.bin 0x01000 user1.bin
The file is padded with zeros until its size is one byte less than a multiple of 16 bytes. A last byte (thus making the file size a multiple of 16) is the checksum of the data of all segments. The checksum is defined as the xor-sum of all bytes and the byte