Code: Select all
esp_err_t esp_ota_set_boot_partition(const esp_partition_t* partition);
This is our partition table:
Code: Select all
# Name, Type, SubType, Offset, Size
nvs, data, nvs, 0x9000, 0x4000
otadata, data, ota, 0xd000, 0x2000
phy_init, data, phy, 0xf000, 0x1000
ota_0, app, ota_0, 0x10000, 0x80000
ota_1, app, ota_1, , 0x360000
storage, data, fat, , 0x10000
The big partition contains code that can download new firmware from Wifi or Bluetooth into the SD card and also update the small partition binary.
But we always want the small partition to boot first and check for new firmware, in case we get a brick on the big partition which prevents it from changing the boot partition back to the small one. This way the user could unbrick the device simply by inserting the new firmware in the SD card.
Is this possible? I was looking into the bootloader functions in
esp-idf/components/bootloader_support/include_priv/bootloader_utility.h
but it seems that they are not accessible to use.
Thank you