Re: OTA clarification
Posted: Fri Feb 24, 2017 12:30 am
Hi Angus,
Even if the ota image is not present at all and you set the OTA data to say boot from that OTA image - the bootloader will attempt to boot from it and then fail verify and then do nothing. As long as the partition table has the OTA partitions that is...
So I've added a bit of code in the bootloader so that if the return is 0 - it will then attempt to load factory image
and Ive also added a failsafe option so if a button is held down for 10 seconds on bootup the bootloader will load the factory image.
So in the meantime how can I keep my bootloader changes since it is part of the IDF ? I really dont want to have my own repository for this.
Thanks
Imtiaz
Even if the ota image is not present at all and you set the OTA data to say boot from that OTA image - the bootloader will attempt to boot from it and then fail verify and then do nothing. As long as the partition table has the OTA partitions that is...
Code: Select all
if (err != ESP_OK) {
ESP_LOGE(TAG, "Failed to verify app image @ 0x%x (%d)", partition->offset, err);
return 0;
}
Code: Select all
if(unpack_load_app(&load_part_pos) == 0)
{
ESP_LOGE(TAG, "Trying to boot to factory");
load_part_pos = bs.factory;
if(unpack_load_app(&load_part_pos) == 0)
{
ESP_LOGE(TAG, "CATOSTROPHIC FAILURE - Factory image failed verify"); //cant do anything if factory image has failed
}
}
So in the meantime how can I keep my bootloader changes since it is part of the IDF ? I really dont want to have my own repository for this.
Thanks
Imtiaz