diff options
Diffstat (limited to 'examples/boot/application/stm32l0/src/bin/a.rs')
-rw-r--r-- | examples/boot/application/stm32l0/src/bin/a.rs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/examples/boot/application/stm32l0/src/bin/a.rs b/examples/boot/application/stm32l0/src/bin/a.rs index f4f1d711..f0b0b80e 100644 --- a/examples/boot/application/stm32l0/src/bin/a.rs +++ b/examples/boot/application/stm32l0/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 embassy_time::{Duration, Timer}; use panic_reset as _; @@ -38,7 +38,8 @@ async fn main(_spawner: Spawner) { 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(); led.set_low(); Timer::after(Duration::from_secs(1)).await; cortex_m::peripheral::SCB::sys_reset(); |