diff options
| author | kalkyl <[email protected]> | 2023-01-03 22:58:56 +0100 |
|---|---|---|
| committer | kalkyl <[email protected]> | 2023-01-03 22:58:56 +0100 |
| commit | 9428c40c8de1285271a5e6ba9ad2a7fed8a9475e (patch) | |
| tree | 30d672bdc0d80f714dfbb5338c9dd41f5ae82061 /examples/boot/bootloader/rp | |
| parent | 0aa2a9ac2705ead5186d4c1d53bba55064c33db7 (diff) | |
embassy-boot (rp): Add WatchdogFlash
Diffstat (limited to 'examples/boot/bootloader/rp')
| -rw-r--r-- | examples/boot/bootloader/rp/Cargo.toml | 2 | ||||
| -rw-r--r-- | examples/boot/bootloader/rp/src/main.rs | 6 |
2 files changed, 5 insertions, 3 deletions
diff --git a/examples/boot/bootloader/rp/Cargo.toml b/examples/boot/bootloader/rp/Cargo.toml index 580ced22e..c0b576cff 100644 --- a/examples/boot/bootloader/rp/Cargo.toml +++ b/examples/boot/bootloader/rp/Cargo.toml | |||
| @@ -11,6 +11,8 @@ defmt-rtt = { version = "0.4", optional = true } | |||
| 11 | 11 | ||
| 12 | embassy-rp = { path = "../../../../embassy-rp", default-features = false, features = ["nightly"] } | 12 | embassy-rp = { path = "../../../../embassy-rp", default-features = false, features = ["nightly"] } |
| 13 | embassy-boot-rp = { path = "../../../../embassy-boot/rp", default-features = false } | 13 | embassy-boot-rp = { path = "../../../../embassy-boot/rp", default-features = false } |
| 14 | embassy-time = { path = "../../../../embassy-time", features = ["nightly"] } | ||
| 15 | |||
| 14 | cortex-m = { version = "0.7.6", features = ["critical-section-single-core"] } | 16 | cortex-m = { version = "0.7.6", features = ["critical-section-single-core"] } |
| 15 | cortex-m-rt = { version = "0.7" } | 17 | cortex-m-rt = { version = "0.7" } |
| 16 | embedded-storage = "0.3.0" | 18 | embedded-storage = "0.3.0" |
diff --git a/examples/boot/bootloader/rp/src/main.rs b/examples/boot/bootloader/rp/src/main.rs index 5028ec688..4defa01fd 100644 --- a/examples/boot/bootloader/rp/src/main.rs +++ b/examples/boot/bootloader/rp/src/main.rs | |||
| @@ -5,8 +5,8 @@ use cortex_m_rt::{entry, exception}; | |||
| 5 | #[cfg(feature = "defmt")] | 5 | #[cfg(feature = "defmt")] |
| 6 | use defmt_rtt as _; | 6 | use defmt_rtt as _; |
| 7 | use embassy_boot_rp::*; | 7 | use embassy_boot_rp::*; |
| 8 | use embassy_rp::flash::{Flash, ERASE_SIZE}; | 8 | use embassy_rp::flash::ERASE_SIZE; |
| 9 | use embassy_rp::peripherals::FLASH; | 9 | use embassy_time::Duration; |
| 10 | 10 | ||
| 11 | const FLASH_SIZE: usize = 2 * 1024 * 1024; | 11 | const FLASH_SIZE: usize = 2 * 1024 * 1024; |
| 12 | 12 | ||
| @@ -23,7 +23,7 @@ fn main() -> ! { | |||
| 23 | */ | 23 | */ |
| 24 | 24 | ||
| 25 | let mut bl: BootLoader = BootLoader::default(); | 25 | let mut bl: BootLoader = BootLoader::default(); |
| 26 | let flash: Flash<'_, FLASH, FLASH_SIZE> = Flash::new(p.FLASH); | 26 | let flash: WatchdogFlash<'_, FLASH_SIZE> = WatchdogFlash::start(p.FLASH, p.WATCHDOG, Duration::from_secs(8)); |
| 27 | let mut flash = BootFlash::<_, ERASE_SIZE>::new(flash); | 27 | let mut flash = BootFlash::<_, ERASE_SIZE>::new(flash); |
| 28 | let start = bl.prepare(&mut SingleFlashConfig::new(&mut flash)); | 28 | let start = bl.prepare(&mut SingleFlashConfig::new(&mut flash)); |
| 29 | core::mem::drop(flash); | 29 | core::mem::drop(flash); |
