diff --git a/embassy-boot/src/boot_loader.rs b/embassy-boot/src/boot_loader.rs index a38558056..789fa34c1 100644 --- a/embassy-boot/src/boot_loader.rs +++ b/embassy-boot/src/boot_loader.rs @@ -235,12 +235,15 @@ impl BootLoader Result { + const { + assert!(Self::PAGE_SIZE % ACTIVE::WRITE_SIZE as u32 == 0); + assert!(Self::PAGE_SIZE % ACTIVE::ERASE_SIZE as u32 == 0); + assert!(Self::PAGE_SIZE % DFU::WRITE_SIZE as u32 == 0); + assert!(Self::PAGE_SIZE % DFU::ERASE_SIZE as u32 == 0); + } + // Ensure we have enough progress pages to store copy progress assert_eq!(0, Self::PAGE_SIZE % aligned_buf.len() as u32); - assert_eq!(0, Self::PAGE_SIZE % ACTIVE::WRITE_SIZE as u32); - assert_eq!(0, Self::PAGE_SIZE % ACTIVE::ERASE_SIZE as u32); - assert_eq!(0, Self::PAGE_SIZE % DFU::WRITE_SIZE as u32); - assert_eq!(0, Self::PAGE_SIZE % DFU::ERASE_SIZE as u32); assert!(aligned_buf.len() >= STATE::WRITE_SIZE); assert_eq!(0, aligned_buf.len() % ACTIVE::WRITE_SIZE); assert_eq!(0, aligned_buf.len() % DFU::WRITE_SIZE);