nuttx-apps/boot
Neil Berkman 4decc1699a boot/nxboot: add flush barriers and CRC-validate primary before boot
Two hardening fixes for nxboot power-loss resilience:

1. Add flash_partition_flush() calls between critical partition
   operations in perform_update(). Without explicit flush barriers,
   writes may remain buffered in RAM (e.g. via FTL rwbuffer) when
   nxboot proceeds to the next phase. A power loss between phases
   can leave the recovery image uncommitted while the staging
   partition has already been consumed.

   Flush points added:
   - After copy_partition(primary, recovery) completes
   - After copy_partition(update, primary) completes, before
     erasing the staging first sector

2. Replace validate_image_header() with validate_image() in the
   final primary validation path of nxboot_perform_update(). The
   header-only check validates magic and platform identifier but
   does not CRC-check the image body. After an interrupted update,
   a corrupt primary with an intact header would pass this check
   and be booted, resulting in a persistent boot failure.

Signed-off-by: Neil Berkman <neil@xuku.com>
2026-03-18 13:06:05 +01:00
..
mcuboot boot/mcuboot: update MCUBoot version 2025-12-09 23:10:01 +08:00
miniboot boot: migrate to SPDX identifier 2024-12-19 15:25:28 +08:00
nxboot boot/nxboot: add flush barriers and CRC-validate primary before boot 2026-03-18 13:06:05 +01:00
.gitignore boot/mcuboot: Add support for MCUboot bootloader 2021-08-20 06:44:15 -03:00
CMakeLists.txt boot: migrate to SPDX identifier 2024-12-19 15:25:28 +08:00
Make.defs boot: migrate to SPDX identifier 2024-12-19 15:25:28 +08:00
Makefile boot: migrate to SPDX identifier 2024-12-19 15:25:28 +08:00