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/rp/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/rp/src/main.rs')
| -rw-r--r-- | examples/boot/bootloader/rp/src/main.rs | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/examples/boot/bootloader/rp/src/main.rs b/examples/boot/bootloader/rp/src/main.rs index 6a81db804..c0e75d1ea 100644 --- a/examples/boot/bootloader/rp/src/main.rs +++ b/examples/boot/bootloader/rp/src/main.rs | |||
| @@ -29,9 +29,7 @@ fn main() -> ! { | |||
| 29 | 29 | ||
| 30 | let config = BootLoaderConfig::from_linkerfile_blocking(&flash); | 30 | let config = BootLoaderConfig::from_linkerfile_blocking(&flash); |
| 31 | let active_offset = config.active.offset(); | 31 | let active_offset = config.active.offset(); |
| 32 | let mut bl: BootLoader<_, _, _> = BootLoader::new(config); | 32 | let bl: BootLoader = BootLoader::prepare(config); |
| 33 | |||
| 34 | bl.prepare(); | ||
| 35 | 33 | ||
| 36 | unsafe { bl.load(embassy_rp::flash::FLASH_BASE as u32 + active_offset) } | 34 | unsafe { bl.load(embassy_rp::flash::FLASH_BASE as u32 + active_offset) } |
| 37 | } | 35 | } |
