-
Notifications
You must be signed in to change notification settings - Fork 7.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Invalidate specific OTA slot. (IDFGH-13982) #14808
Comments
OTA data partition contains 2 identical flash sectors each storing copies of esp-idf/components/app_update/esp_ota_ops.c Lines 490 to 504 in f420609
API May I ask if you are observing any problem due to incorrect state of the image in the OTA data partition? If yes, could you please supply the detailed console logs here? PS: you may use |
Thanks for reporting, will close due to short of feedback, feel free to reopen with more updates. |
Hi @ddomnik! |
@KonstantinKondrashov thank you for your reply.
This sounds great! |
Is your feature request related to a problem?
Let's assume we have two valid OTA partitions (ota0 and ota1) and both ota_state's are set to ESP_OTA_IMG_VALID.
Now ota1 partition gets erased and we perform this incomplete update sequence:
This would assume we have a valid image in ota1, even tho the update sequence has not been completed.
The same issue would appear if a factory partition is used to reflash ota0 that previously was marked as valid.
Describe the solution you'd like.
esp_ota_begin() should mark the to be flashed partition as ESP_OTA_IMG_INVALID.
To be more flexible and also to be able to mark specific partitions as invalid a generic function like these would be better:
esp_ota_mark_app_invalid(const esp_partition_t *partition);
esp_ota_set_state(const esp_partition_t *partition, esp_ota_img_states_t ota_state);
Describe alternatives you've considered.
Additional context.
The logic of the OTA data is quite complex to me and I am not even sure if ota_data actually behaves like this. As I think not every ota partition has a dedicated slot where the ota_state is stored? If so I may makes sense to make a function available like esp_ota_mark_app_invalid_rollback_and_reboot without the rollback and reboot part.
The text was updated successfully, but these errors were encountered: