esp-idf flash layout - space before bootloader

nasq86
Posts: 3
Joined: Mon Mar 17, 2025 8:40 pm

esp-idf flash layout - space before bootloader

Postby nasq86 » Tue Jan 13, 2026 10:39 am

Hey,

According to the ESP-IDF documentation, the esp-idf bootloader is loaded from the following flash offsets:

0x1000 - ESP32, ESP32-S2
0x0 - ESP32-S3, ESP32-H2, ESP32-C61, ESP32-C6
0x2000 - ESP32-C5, ESP32-P4

On those MCUs which do not load the bootloader from the beginning of the flash: what is from 0x0-0x1000 or 0x0-0x2000 respectively?

Does anyone know? I'm just curious.

Sprite
Espressif staff
Espressif staff
Posts: 10593
Joined: Thu Nov 26, 2015 4:08 am

Re: esp-idf flash layout - space before bootloader

Postby Sprite » Wed Jan 14, 2026 12:21 am

It's for SecureBoot key information; it contains key material for when that is enabled.

dmitrij999
Posts: 100
Joined: Sat Mar 02, 2019 8:06 pm

Re: esp-idf flash layout - space before bootloader

Postby dmitrij999 » Sun Jan 18, 2026 7:04 am

As I remember, every ESP32x MCU actually starts execution from 0x1000, because every executive binary (application or bootloader) must have metadata (such as magic, app version, sha hashsum, etc.) that fit into 4096 bytes (in case of bootloader, meta starts from 0x0), the flash page size.

ESP_igrr
Posts: 2076
Joined: Tue Dec 01, 2015 8:37 am

Re: esp-idf flash layout - space before bootloader

Postby ESP_igrr » Wed Jan 21, 2026 11:27 am

That's not the case; image metadata is part of the binary image itself. You can find out more about the binary image format over here: https://docs.espressif.com/projects/esp ... ormat.html.

As Sprite wrote, in the original ESP32, the first 4k region of Flash was reserved for Secure Boot v1 digest. See point 5 in this section for more details: https://docs.espressif.com/projects/esp ... s-overview.

On the ESP32-P4 and C5, the first 8k of Flash is reserved for the Key Manager recovery data. The documentation for that feature is in progress, unfortunately I don't have any pointers for you yet.

Who is online

Users browsing this forum: Bing [Bot], Semrush [Bot] and 11 guests