Allow specifying known flash size during OTA to make erasing faster #561
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Thank you for your contribution!
We appreciate the time and effort you've put into this pull request.
To help us review it efficiently, please ensure you've gone through the following checklist:
Submission Checklist 📝
cargo fmt
command to ensure that all changed code is formatted correctly.cargo clippy
command to ensure that all changed code passes latest Clippy nightly lints.CHANGELOG.md
in the proper section.Pull Request Details 📖
Description
The OTA process requires first erasing data in the flash partition and then writing the new image. By default the entire image is erased, even though we only need to erase enough space to fit the image. For esp32s with large flash sizes and relatively small images, the erasing can dominate total OTA time.
This PR adds an
initiate_update_with_known_size
variant to allow passing through the size parameter to the underlying ESP IDF library rather than the defaultOTA_SIZE_UNKNOWN
.Testing
I tested by using by specifying the size when performing an OTA. For me, this sped up the erase portion of OTA by 3x. (esp32s3 with 32M flash, two 8M OTA partitions, actual image considerably smaller than that)