feat(bootloader): Support v2 firmware updates to v3 by OTA

This commit is contained in:
Dong Heng
2018-11-09 19:54:17 +08:00
parent ef79175caf
commit 11db1b0daf
18 changed files with 752 additions and 15 deletions

View File

@ -512,6 +512,13 @@ bool bootloader_utility_load_partition_table(bootloader_state_t* bs)
esp_err_t err;
int num_partitions;
#ifdef CONFIG_ESP8266_OTA_FROM_OLD
if (esp_patition_table_init_location()) {
ESP_LOGE(TAG, "Failed to update partition table location");
return false;
}
#endif
#ifdef CONFIG_SECURE_BOOT_ENABLED
if(esp_secure_boot_enabled()) {
ESP_LOGI(TAG, "Verifying partition table signature...");
@ -605,6 +612,14 @@ bool bootloader_utility_load_partition_table(bootloader_state_t* bs)
bootloader_munmap(partitions);
#ifdef CONFIG_ESP8266_OTA_FROM_OLD
ESP_LOGI(TAG, "Copy firmware ...");
if (esp_patition_table_init_data(bs)) {
ESP_LOGE(TAG,"Failed to update partition data");
return false;
}
#endif
ESP_LOGI(TAG,"End of partition table");
return true;
}