-->
Page 1 of 1

Where bootloader stores what app to load?

PostPosted: Fri Sep 27, 2019 6:18 pm
by rzajac
Hello everybody,

How does ESP8266 bootloader knows which of the app1 or app2 to load. I know it must be stored somewhere on the flash but where?

I'm using SDK 3.0.1 and bootloader boot_v1.7.bin from the SDK.

Re: Where bootloader stores what app to load?

PostPosted: Sun Oct 06, 2019 4:35 am
by eriksl
Good question, I don't think many know as it's all closed.

You might want to consider using rboot, there everything is open.

Re: Where bootloader stores what app to load?

PostPosted: Sun Oct 06, 2019 6:38 am
by Symeg
I think you can find some information in docs:
https://docs.espressif.com/projects/esp ... ables.html
Here is the summary printed for the “Two OTA definitions” configuration:

# Espressif ESP8266 Partition Table
# Name, Type, SubType, Offset, Size
nvs, data, nvs, 0x9000, 0x4000
otadata, data, ota, 0xd000, 0x2000
phy_init, data, phy, 0xf000, 0x1000
ota_0, 0, ota_0, 0x10000, 0xF0000
ota_1, 0, ota_1, 0x110000, 0xF0000
There are now two app partition definitions, ota_0 at 0x10000 and ota_1 at 0x110000
There is also a new “ota data” slot, which holds the data for OTA updates. The bootloader consults this data in order to know which app to execute. If “ota data” is empty, it will execute the ota_0 app.

ota (0) is the OTA data partition which stores information about the currently selected OTA application. This partition should be 0x2000 bytes in size. Refer to the OTA documentation for more details.

I found something about OTA in ESP-IDF docs: https://docs.espressif.com/projects/esp ... -partition

Hope it'll help you!