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
from
October 28, 2026 16:16
91c3ae7 to
9cd5e75
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
Stores a gzip-compressed, signed firmware image, in two arrangements with different trade-offs.
COMPRESSED_RAM_SLOTS=1keeps both A/B slots compressed and inflates the selected one into RAM to execute it there, so A/B redundancy costs about half the flash of two uncompressed slots and rollback is unchanged. RAM bounds the image in this mode.COMPRESSED_UPDATE=1keeps only the update partition compressed 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. There is no local copy of the outgoing image, so this trades rollback for flash: the container is verified before the first erase, and an interrupted install resumes from recorded progress because the update partition is only ever read.What it adds
src/update_ram.c- manifest TLVs, capacity and overlap checks, inflate toWOLFBOOT_LOAD_ADDRESSsrc/update_flash.c- the execute-in-place installer, built on the existingDISABLE_BACKUPpathsrc/gzip.c- a sink decoder with a bounded window, selected at build time, leaving the flat decoder the FIT path uses unchangedsrc/compress_crypt.c- optional at-rest encryption of both RAM-executed slotstools/keytools/sign.c---compressedfor an already-gzipped payload, and--compress[=bits]which compresses and signs the nested containerdocs/Compression.md, simulator tests, unit tests and CIFixes in shared code
wolfBoot_success()confirmedPART_BOOTunconditionally, so an image booted from the update slot was discarded on the next bootwb_trailer_clear()cleared the update partition's trailer at the boot partition's size offset, which only matters once the two are sized independentlyhal/stm32f4.cdescribes 1MB of flash, so a partition past that silently failed to erase; now refused at build timeDEBUG_UART=1onTARGET=stm32f4hung on the first print, because nothing initialized the portTesting
Validated on a NUCLEO-F439ZI: both modes end to end, including the install, verification of the installed image, the update being consumed rather than repeated, and resume after an interrupted install. At-rest encryption is simulator-only. Simulator and unit tests cover both gzip decoders and the sink's window bound, ED25519/ECC256, and ChaCha20/AES-128/AES-256.
Scope
At-rest encryption of a compressed update partition is follow-on work and is rejected at build time for now: verification would need a decrypt seam in the image hashing path as well as in the inflater's input.