You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Merge branch 'feature/add_ota_resumption_feature_in_advanced_ota_example' into 'master'
feat(app_utils): add ota resumption feature in advanced_ota_example
Closes IDF-2455, IDF-10421, and IDFGH-12065
See merge request espressif/esp-idf!32927
* @brief Resume an interrupted OTA update by continuing to write to the specified partition.
109
+
*
110
+
* This function is used when an OTA update was previously started and needs to be resumed after an interruption.
111
+
* It continues the OTA process from the specified offset within the partition.
112
+
*
113
+
* Unlike esp_ota_begin(), this function does not erase the partition which receives the OTA update, but rather expects that part of the image
114
+
* has already been written correctly, and it resumes writing from the given offset.
115
+
*
116
+
* @param partition Pointer to info for the partition which is receiving the OTA update. Required.
117
+
* @param erase_size Specifies how much flash memory to erase before resuming OTA, depending on whether a sequential write or a bulk erase is being used.
118
+
* @param image_offset Offset from where to resume the OTA process. Should be set to the number of bytes already written.
119
+
* @param out_handle On success, returns a handle that should be used for subsequent esp_ota_write() and esp_ota_end() calls.
120
+
*
121
+
* @return
122
+
* - ESP_OK: OTA operation resumed successfully.
123
+
* - ESP_ERR_INVALID_ARG: partition, out_handle were NULL or image_offset arguments is negative, or partition doesn't point to an OTA app partition.
124
+
* - ESP_ERR_NO_MEM: Cannot allocate memory for OTA operation.
125
+
* - ESP_ERR_OTA_PARTITION_CONFLICT: Partition holds the currently running firmware, cannot update in place.
126
+
* - ESP_ERR_NOT_FOUND: Partition argument not found in partition table.
127
+
* - ESP_ERR_OTA_SELECT_INFO_INVALID: The OTA data partition contains invalid data.
128
+
* - ESP_ERR_INVALID_SIZE: Partition doesn't fit in configured flash size.
129
+
* - ESP_ERR_FLASH_OP_TIMEOUT or ESP_ERR_FLASH_OP_FAIL: Flash write failed.
Copy file name to clipboardExpand all lines: components/esp_https_ota/include/esp_https_ota.h
+2Lines changed: 2 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -64,6 +64,8 @@ typedef struct {
64
64
boolpartial_http_download; /*!< Enable Firmware image to be downloaded over multiple HTTP requests */
65
65
intmax_http_request_size; /*!< Maximum request size for partial HTTP download */
66
66
uint32_tbuffer_caps; /*!< The memory capability to use when allocating the buffer for OTA update. Default capability is MALLOC_CAP_DEFAULT */
67
+
boolota_resumption; /*!< Enable resumption in downloading of OTA image between reboots */
68
+
size_tota_image_bytes_written; /*!< Number of OTA image bytes written to flash so far, updated by the application when OTA data is written successfully in the target OTA partition. */
67
69
#ifCONFIG_ESP_HTTPS_OTA_DECRYPT_CB||__DOXYGEN__
68
70
decrypt_cb_tdecrypt_cb; /*!< Callback for external decryption layer */
69
71
void*decrypt_user_ctx; /*!< User context for external decryption layer */
0 commit comments