wolfBoot Compressed and Encrypted Updates

wolfBoot can now deliver firmware updates as gzip-compressed, signed images and install them directly into an execute-in-place boot partition. Because the update partition only holds the compressed image, the flash space saved is reclaimed by your application.

  • Flexible storage: Internal or external flash.
  • At-rest encryption: Updates on external flash can be encrypted with ENCRYPT=1.
  • Power-safe and tamper-resistant: Verified before erase; an interrupted install resumes on the next boot.
  • One-step workflow: sign –compress compresses and signs in one command.

Flash Savings

Embedded firmware typically compresses to 65-70% of its original size. The update partition only has to hold the compressed image, so it can be smaller than the application. The gain is less than the compression ratio, because a safe update still keeps the whole new image in flash before replacing the running one. Compressed updates also need no swap sector, since the new image is written directly over the old one.

  • Example: On a 2 MB STM32H7, application space increases from 896 KB (standard A/B layout) to 1 MB.
  • Images containing assets, fonts, tables, or file systems will yield even higher gains.

Power Failure and Rollback

  • Power-loss recovery: Decompression only reads from the update partition. If power fails mid-install, wolfBoot resumes and completes installation on the next boot.
  • Pre-install verification: Corrupt or unsigned images are rejected before any partition is erased; active firmware continues running undisturbed.
  • Trade-off (no rollback): Once an update is installed, the prior version is overwritten. Recovery requires sending a subsequent update. If your system requires automatic rollbacks, use standard A/B or delta updates.

Resource Footprint and Getting Started

  • Code size: Adds about 3 KB on an STM32F439ZI.
  • RAM overhead: Depends on the compression window size: about 52 KB at the default, down to about 8.5 KB with a 4 KB window and the small decoder (GZIP_SMALL=1).
  • Boot impact: None for normal boots; decompression runs only during updates.

To enable, set COMPRESSED_UPDATE=1. Tested on STM32F439ZI, with example configurations for STM32F4, STM32H7, and the simulator.

Download wolfSSL Now