aboutsummaryrefslogtreecommitdiff
path: root/examples/boot/application/stm32l4/src
diff options
context:
space:
mode:
authorUlf Lilleengen <[email protected]>2022-08-30 13:07:35 +0200
committerUlf Lilleengen <[email protected]>2022-09-02 08:25:36 +0200
commit3ca73144765411994759194a2279b567f4508be5 (patch)
tree7c2466e14eb91321d35f831384c633f9936e8977 /examples/boot/application/stm32l4/src
parent7542505cf903930520773f5b6b5ff239b78a8f9c (diff)
Remove generic const expressions from embassy-boot
* Remove the need for generic const expressions and use buffers provided in the flash config. * Extend embedded-storage traits to simplify generics. * Document all public APIs * Add toplevel README * Expose AlignedBuffer type for convenience. * Update examples
Diffstat (limited to 'examples/boot/application/stm32l4/src')
-rw-r--r--examples/boot/application/stm32l4/src/bin/a.rs7
1 files changed, 4 insertions, 3 deletions
diff --git a/examples/boot/application/stm32l4/src/bin/a.rs b/examples/boot/application/stm32l4/src/bin/a.rs
index 178b2e04a..5119bad2e 100644
--- a/examples/boot/application/stm32l4/src/bin/a.rs
+++ b/examples/boot/application/stm32l4/src/bin/a.rs
@@ -4,11 +4,11 @@
4 4
5#[cfg(feature = "defmt-rtt")] 5#[cfg(feature = "defmt-rtt")]
6use defmt_rtt::*; 6use defmt_rtt::*;
7use embassy_boot_stm32::FirmwareUpdater; 7use embassy_boot_stm32::{AlignedBuffer, FirmwareUpdater};
8use embassy_embedded_hal::adapter::BlockingAsync; 8use embassy_embedded_hal::adapter::BlockingAsync;
9use embassy_executor::Spawner; 9use embassy_executor::Spawner;
10use embassy_stm32::exti::ExtiInput; 10use embassy_stm32::exti::ExtiInput;
11use embassy_stm32::flash::Flash; 11use embassy_stm32::flash::{Flash, WRITE_SIZE};
12use embassy_stm32::gpio::{Input, Level, Output, Pull, Speed}; 12use embassy_stm32::gpio::{Input, Level, Output, Pull, Speed};
13use panic_reset as _; 13use panic_reset as _;
14 14
@@ -35,7 +35,8 @@ async fn main(_spawner: Spawner) {
35 updater.write_firmware(offset, &buf, &mut flash, 2048).await.unwrap(); 35 updater.write_firmware(offset, &buf, &mut flash, 2048).await.unwrap();
36 offset += chunk.len(); 36 offset += chunk.len();
37 } 37 }
38 updater.update(&mut flash).await.unwrap(); 38 let mut magic = AlignedBuffer([0; WRITE_SIZE]);
39 updater.mark_updated(&mut flash, magic.as_mut()).await.unwrap();
39 led.set_low(); 40 led.set_low();
40 cortex_m::peripheral::SCB::sys_reset(); 41 cortex_m::peripheral::SCB::sys_reset();
41} 42}