68 if (update_partition == NULL) { |
68 if (update_partition == NULL) { |
69 ESP_LOGE(TAG, "No update partition"); |
69 ESP_LOGE(TAG, "No update partition"); |
70 esp_http_client_cleanup(client); |
70 esp_http_client_cleanup(client); |
71 goto updateerr; |
71 goto updateerr; |
72 } |
72 } |
73 ESP_LOGI(TAG, "Update to partition subtype %d at offset 0x%x", update_partition->subtype, update_partition->address); |
73 ESP_LOGI(TAG, "Update to partition subtype %d at offset 0x%x", update_partition->subtype, (unsigned)update_partition->address); |
74 |
74 |
75 err = esp_ota_begin(update_partition, OTA_SIZE_UNKNOWN, &update_handle); |
75 err = esp_ota_begin(update_partition, OTA_SIZE_UNKNOWN, &update_handle); |
76 if (err != ESP_OK) { |
76 if (err != ESP_OK) { |
77 ESP_LOGE(TAG, "esp_ota_begin failed (%s)", esp_err_to_name(err)); |
77 ESP_LOGE(TAG, "esp_ota_begin failed (%s)", esp_err_to_name(err)); |
78 http_cleanup(client); |
78 http_cleanup(client); |