Skip to content
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

Allow specifying known flash size during OTA to make erasing faster #561

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Calsign
Copy link

@Calsign Calsign commented Feb 18, 2025

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 📝

  • I have updated existing examples or added new ones (if applicable).
  • I have used cargo fmt command to ensure that all changed code is formatted correctly.
  • I have used cargo clippy command to ensure that all changed code passes latest Clippy nightly lints.
  • My changes were added to the 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 default OTA_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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant