Cache bootloader firmware writes#2002
Open
NickeZ wants to merge 2 commits into
Open
Conversation
Erase the full firmware area on OP_ERASE, then cache sequential 4 KiB firmware chunks into 8 KiB flash blocks. Flush cached blocks once, using flash_append() when the target block is already erased and flash_write() otherwise. Also reject signature data before all declared firmware chunks have been received and flushed. Verification: - ./scripts/dev_exec.sh ./scripts/format - ./scripts/dev_exec.sh make bootloader - ./scripts/dev_exec.sh make unit-test - ./scripts/dev_exec.sh make run-unit-tests
benma
reviewed
Jul 2, 2026
benma
left a comment
Collaborator
There was a problem hiding this comment.
Seems overly complicated, I think the cache/flush is not needed?
Why not just erase in OP_ERASE, and just use flash_append with 4kB chunks during flashing?
Also reject signature data before all declared firmware chunks have been received and flushed.
Why? One can't successfully do it anyway beforehand, as that API call rejects on invalid signatures. Can't hurt but seems not needed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Approximately halfs the current flashing time to 55s.
Erase the full firmware area on OP_ERASE, then cache sequential 4 KiB firmware chunks into 8 KiB flash blocks. Flush cached blocks once, using flash_append() when the target block is already erased and flash_write() otherwise.
Also reject signature data before all declared firmware chunks have been received and flushed.
Verification: