Repository navigation
Conversation
dgarske
force-pushed
the
compressed_images
branch
from
October 27, 2026 19:09
024b841 to
336ec0d
Compare
dgarske
force-pushed
the
compressed_images
branch
from
October 28, 2026 03:03
336ec0d to
91c3ae7
Compare
dgarske
force-pushed
the
compressed_images
branch
3 times, most recently
from
October 28, 2026 22:07
2fdd41a to
1171a22
Compare
dgarske
force-pushed
the
compressed_images
branch
3 times, most recently
from
October 29, 2026 01:09
54fa02f to
4a86648
Compare
dgarske
force-pushed
the
compressed_images
branch
from
October 29, 2026 04:33
4a86648 to
46e624f
Compare
dgarske
force-pushed
the
compressed_images
branch
from
October 29, 2026 05:14
46e624f to
8bf9cb1
Compare
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.
Description
COMPRESSED_UPDATE=1holds the update partition as a gzip-compressed, signed image and inflates it into the boot partition, which goes on executing in place. The update partition is then sized for the container rather than for a second full copy, and the flash that frees goes to the application instead.The update partition may be internal, on external flash, or on external flash encrypted at rest with the existing
ENCRYPT=1layer. The last two work because the decoder can pull its input through a callback rather than reading it in place, andext_flash_check_read()is already the point where an encrypted partition is decrypted.There is no local copy of the outgoing image, so this trades rollback for flash. Three things bound that: the container is verified before the first erase, so a bad image never touches the running one; the update partition is only ever read during an install, so a power cut leaves an intact source and the next boot resumes from the recorded progress; and the payload is a complete signed image, so the boot partition stays an ordinary wolfBoot partition that the normal boot path verifies, meaning the inflater need not be trusted.
What it adds
src/update_flash.c- the installer, built on the existingDISABLE_BACKUPpathsrc/gzip.c- a sink decoder with a bounded LZ77 window and an optional input callback, selected at build time, leaving the flat decoder the FIT path uses unchangedtools/keytools/sign.c---compress[=bits], which compresses and signs the nested container; zlib is an optional dependency and the option is rejected without itWOLFBOOT_PARTITION_UPDATE_SIZEsmaller than the boot partition, which the existing monolithic self-update sizing already allowed in the other directiondocs/Compression.md, simulator tests, unit tests and CIFixes in shared code
START_FLAGS_OFFSETis derived from the boot partition but applied to the update partition, so with the two sized independently the update trailer fell outside the plaintext window and would be encrypted along with the image. Sized from the update slot now; identical for a symmetric layout.wb_trailer_clear()cleared the update partition's trailer at the boot partition's size offsethal/stm32f4.cdescribes 1MB of flash, so a partition past that silently failed to erase; now refused at build timehal/stm32h7.hderives the write-once flags page from the partition end, and the H7 cannot erase less than a sector, so a partition that was not a whole number of sectors had that erase reach into the neighbouring one.stm32h7.configwas 6.5 sectors, which put the BOOT flags page over the first 64KB of UPDATE and made rollback impossible. Guarded at build time, and the example, presets and CMake docs are now sector-aligned.DEBUG_UART=1onTARGET=stm32f4hung on the first print, because nothing initialized the portTesting
Simulator tests cover all three layouts across two signature algorithms, and the internal-flash layout at both the smallest and the default window. Unit tests compare the sink decoder against the flat one over the existing fixture corpus at every window, including input delivered through a callback, and check that a short or failing source is rejected rather than yielding a truncated image.
Hardware validation on a NUCLEO-F439ZI covered the internal-flash install, the update being consumed rather than repeated, and resume after an interrupted install. That board has no external flash wired, so the external and encrypted layouts are simulator-only.