diff options
| author | Ulf Lilleengen <[email protected]> | 2023-08-11 19:47:24 +0200 |
|---|---|---|
| committer | Ulf Lilleengen <[email protected]> | 2023-08-11 20:58:31 +0200 |
| commit | 55ff397c0cde8a04c41cfc228645c3fd33383cd1 (patch) | |
| tree | b73e5fee9027422cb121b892e6d467fd0f73cfe7 /examples/boot/bootloader/stm32/src/main.rs | |
| parent | c1da2c0219667085124c47d8059ffbf077adaf9d (diff) | |
boot: release flash after prepare and refactor api
This refactoring of the chip specific bootloader creates the internal boot instance and aligned
buffer in the prepare stage, so that they are automatically dropped after. This unlocks a use
case where peripherals owning the flash need to be Drop'ed before load() happens.
Diffstat (limited to 'examples/boot/bootloader/stm32/src/main.rs')
| -rw-r--r-- | examples/boot/bootloader/stm32/src/main.rs | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/examples/boot/bootloader/stm32/src/main.rs b/examples/boot/bootloader/stm32/src/main.rs index 262eed200..5fd9ea588 100644 --- a/examples/boot/bootloader/stm32/src/main.rs +++ b/examples/boot/bootloader/stm32/src/main.rs | |||
| @@ -27,9 +27,7 @@ fn main() -> ! { | |||
| 27 | 27 | ||
| 28 | let config = BootLoaderConfig::from_linkerfile_blocking(&flash); | 28 | let config = BootLoaderConfig::from_linkerfile_blocking(&flash); |
| 29 | let active_offset = config.active.offset(); | 29 | let active_offset = config.active.offset(); |
| 30 | let mut bl: BootLoader<_, _, _, 2048> = BootLoader::new(config); | 30 | let bl = BootLoader::prepare::<_, _, _, 2048>(config); |
| 31 | |||
| 32 | bl.prepare(); | ||
| 33 | 31 | ||
| 34 | unsafe { bl.load(BANK1_REGION.base + active_offset) } | 32 | unsafe { bl.load(BANK1_REGION.base + active_offset) } |
| 35 | } | 33 | } |
