summaryrefslogtreecommitdiff
path: root/examples/boot/bootloader
diff options
context:
space:
mode:
authorUlf Lilleengen <lulf@redhat.com>2022-08-30 13:07:35 +0200
committerUlf Lilleengen <lulf@redhat.com>2022-09-02 08:25:36 +0200
commit3ca73144765411994759194a2279b567f4508be5 (patch)
tree7c2466e14eb91321d35f831384c633f9936e8977 /examples/boot/bootloader
parent7542505cf903930520773f5b6b5ff239b78a8f9c (diff)
downloadembassy-3ca73144765411994759194a2279b567f4508be5.zip
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/bootloader')
-rw-r--r--examples/boot/bootloader/nrf/src/main.rs6
-rw-r--r--examples/boot/bootloader/stm32/src/main.rs8
2 files changed, 7 insertions, 7 deletions
diff --git a/examples/boot/bootloader/nrf/src/main.rs b/examples/boot/bootloader/nrf/src/main.rs
index bc7e0755..9031997c 100644
--- a/examples/boot/bootloader/nrf/src/main.rs
+++ b/examples/boot/bootloader/nrf/src/main.rs
@@ -20,10 +20,8 @@ fn main() -> ! {
*/
let mut bl = BootLoader::default();
- let start = bl.prepare(&mut SingleFlashProvider::new(&mut WatchdogFlash::start(
- Nvmc::new(p.NVMC),
- p.WDT,
- 5,
+ let start = bl.prepare(&mut SingleFlashConfig::new(&mut BootFlash::<_, 4096>::new(
+ &mut WatchdogFlash::start(Nvmc::new(p.NVMC), p.WDT, 5),
)));
unsafe { bl.load(start) }
}
diff --git a/examples/boot/bootloader/stm32/src/main.rs b/examples/boot/bootloader/stm32/src/main.rs
index 45c511ce..bb5d3e53 100644
--- a/examples/boot/bootloader/stm32/src/main.rs
+++ b/examples/boot/bootloader/stm32/src/main.rs
@@ -5,7 +5,7 @@ use cortex_m_rt::{entry, exception};
#[cfg(feature = "defmt")]
use defmt_rtt as _;
use embassy_boot_stm32::*;
-use embassy_stm32::flash::{Flash, ERASE_SIZE};
+use embassy_stm32::flash::{Flash, ERASE_SIZE, ERASE_VALUE, WRITE_SIZE};
#[entry]
fn main() -> ! {
@@ -19,9 +19,11 @@ fn main() -> ! {
}
*/
- let mut bl: BootLoader<ERASE_SIZE> = BootLoader::default();
+ let mut bl: BootLoader<ERASE_SIZE, WRITE_SIZE> = BootLoader::default();
let mut flash = Flash::unlock(p.FLASH);
- let start = bl.prepare(&mut SingleFlashProvider::new(&mut flash));
+ let start = bl.prepare(&mut SingleFlashConfig::new(
+ &mut BootFlash::<_, ERASE_SIZE, ERASE_VALUE>::new(&mut flash),
+ ));
core::mem::drop(flash);
unsafe { bl.load(start) }
}