mirror of
https://github.com/espressif/ESP8266_RTOS_SDK.git
synced 2025-09-27 09:24:45 +08:00
feat(bootloader): Support v2 firmware updates to v3 by OTA
This commit is contained in:
@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user