From 6782fb1efa1bd4c5372220bb38539ea1e7ef6ffa Mon Sep 17 00:00:00 2001 From: Priit Laes Date: Wed, 13 Dec 2023 11:41:46 +0200 Subject: [PATCH] embassy-boot: Add explanation to dfu vs active size assertion --- embassy-boot/boot/src/boot_loader.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/embassy-boot/boot/src/boot_loader.rs b/embassy-boot/boot/src/boot_loader.rs index a8c19197b..1663f4f2c 100644 --- a/embassy-boot/boot/src/boot_loader.rs +++ b/embassy-boot/boot/src/boot_loader.rs @@ -224,6 +224,7 @@ impl BootLoader( ) { assert_eq!(active.capacity() as u32 % page_size, 0); assert_eq!(dfu.capacity() as u32 % page_size, 0); + // DFU partition has to be bigger than ACTIVE partition to handle swap algorithm assert!(dfu.capacity() as u32 - active.capacity() as u32 >= page_size); assert!(2 + 2 * (active.capacity() as u32 / page_size) <= state.capacity() as u32 / STATE::WRITE_SIZE as u32); }