mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-05 13:44:32 +02:00
Update native_ota_example.c
* assert(update_partition) should be before trying to use update_partition in ESP_LOGI(). * if we show detailed description about the error ESP_ERR_OTA_VALIDATE_FAILED, why show it again using esp_err_to_name() ? Merges https://github.com/espressif/esp-idf/pull/6623 Signed-off-by: Shubham Kulkarni <shubham.kulkarni@espressif.com>
This commit is contained in:
@@ -132,9 +132,9 @@ static void ota_example_task(void *pvParameter)
|
|||||||
esp_http_client_fetch_headers(client);
|
esp_http_client_fetch_headers(client);
|
||||||
|
|
||||||
update_partition = esp_ota_get_next_update_partition(NULL);
|
update_partition = esp_ota_get_next_update_partition(NULL);
|
||||||
|
assert(update_partition != NULL);
|
||||||
ESP_LOGI(TAG, "Writing to partition subtype %d at offset 0x%x",
|
ESP_LOGI(TAG, "Writing to partition subtype %d at offset 0x%x",
|
||||||
update_partition->subtype, update_partition->address);
|
update_partition->subtype, update_partition->address);
|
||||||
assert(update_partition != NULL);
|
|
||||||
|
|
||||||
int binary_file_length = 0;
|
int binary_file_length = 0;
|
||||||
/*deal with all receive packet*/
|
/*deal with all receive packet*/
|
||||||
@@ -234,8 +234,9 @@ static void ota_example_task(void *pvParameter)
|
|||||||
if (err != ESP_OK) {
|
if (err != ESP_OK) {
|
||||||
if (err == ESP_ERR_OTA_VALIDATE_FAILED) {
|
if (err == ESP_ERR_OTA_VALIDATE_FAILED) {
|
||||||
ESP_LOGE(TAG, "Image validation failed, image is corrupted");
|
ESP_LOGE(TAG, "Image validation failed, image is corrupted");
|
||||||
|
} else {
|
||||||
|
ESP_LOGE(TAG, "esp_ota_end failed (%s)!", esp_err_to_name(err));
|
||||||
}
|
}
|
||||||
ESP_LOGE(TAG, "esp_ota_end failed (%s)!", esp_err_to_name(err));
|
|
||||||
http_cleanup(client);
|
http_cleanup(client);
|
||||||
task_fatal_error();
|
task_fatal_error();
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user