esp_ota_write_with_offset() function
Write OTA update data to partition at an offset This function can write data in non-contiguous manner. If flash encryption is enabled, data should be 16 bytes aligned.
Arguments
handle
Handle obtained from esp_ota_begin
size
Size of data buffer in bytes
offset
Offset in flash partition
Return value
- ESP_OK: Data was written to flash successfully. - ESP_ERR_INVALID_ARG: handle is invalid. - ESP_ERR_OTA_VALIDATE_FAILED: First byte of image contains invalid app image magic byte. - ESP_ERR_FLASH_OP_TIMEOUT or ESP_ERR_FLASH_OP_FAIL: Flash write failed. - ESP_ERR_OTA_SELECT_INFO_INVALID: OTA data partition has invalid contents
Notes
While performing OTA, if the packets arrive out of order, esp_ota_write_with_offset() can be used to write data in non-contiguous manner. Use of esp_ota_write_with_offset() in combination with esp_ota_write() is not recommended.