diff options
Diffstat (limited to 'examples/boot/application/stm32wl/src/bin/a.rs')
-rw-r--r-- | examples/boot/application/stm32wl/src/bin/a.rs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/examples/boot/application/stm32wl/src/bin/a.rs b/examples/boot/application/stm32wl/src/bin/a.rs index c71a4265..faa65077 100644 --- a/examples/boot/application/stm32wl/src/bin/a.rs +++ b/examples/boot/application/stm32wl/src/bin/a.rs @@ -4,11 +4,11 @@ #[cfg(feature = "defmt-rtt")] use defmt_rtt::*; -use embassy_boot_stm32::FirmwareUpdater; +use embassy_boot_stm32::{AlignedBuffer, FirmwareUpdater}; use embassy_embedded_hal::adapter::BlockingAsync; use embassy_executor::Spawner; use embassy_stm32::exti::ExtiInput; -use embassy_stm32::flash::Flash; +use embassy_stm32::flash::{Flash, WRITE_SIZE}; use embassy_stm32::gpio::{Input, Level, Output, Pull, Speed}; use panic_reset as _; @@ -37,7 +37,8 @@ async fn main(_spawner: Spawner) { updater.write_firmware(offset, &buf, &mut flash, 2048).await.unwrap(); offset += chunk.len(); } - updater.update(&mut flash).await.unwrap(); + let mut magic = AlignedBuffer([0; WRITE_SIZE]); + updater.mark_updated(&mut flash, magic.as_mut()).await.unwrap(); //defmt::info!("Marked as updated"); led.set_low(); cortex_m::peripheral::SCB::sys_reset(); |