Add stm32 flash + bootloader support

* Add flash drivers for L0, L1, L4, WB and WL. Not tested for WB, but
should be similar to WL.
* Add embassy-boot-stm32 for bootloading on STM32.
* Add flash examples and bootloader examples
* Update stm32-data
This commit is contained in:
Ulf Lilleengen
2022-04-20 13:49:59 +02:00
committed by Ulf Lilleengen
parent 9c283cd445
commit 484e0acc63
59 changed files with 2115 additions and 137 deletions

View File

@ -13,7 +13,7 @@ defmt-rtt = { version = "0.3", optional = true }
embassy = { path = "../../embassy", default-features = false }
embassy-nrf = { path = "../../embassy-nrf", default-features = false, features = ["nightly"] }
embassy-boot = { path = "../boot", default-features = false }
embassy-boot = { path = "../boot", default-features = false, features = ["write-4"] }
cortex-m = { version = "0.7" }
cortex-m-rt = { version = "0.7" }
embedded-storage = "0.3.0"

View File

@ -4,9 +4,7 @@
mod fmt;
pub use embassy_boot::{
FirmwareUpdater, FlashProvider, Partition, SingleFlashProvider, State, BOOT_MAGIC,
};
pub use embassy_boot::{FirmwareUpdater, FlashProvider, Partition, SingleFlashProvider};
use embassy_nrf::{
nvmc::{Nvmc, PAGE_SIZE},
peripherals::WDT,
@ -184,29 +182,3 @@ impl<'d> ReadNorFlash for WatchdogFlash<'d> {
self.flash.capacity()
}
}
pub mod updater {
use super::*;
pub fn new() -> embassy_boot::FirmwareUpdater {
extern "C" {
static __bootloader_state_start: u32;
static __bootloader_state_end: u32;
static __bootloader_dfu_start: u32;
static __bootloader_dfu_end: u32;
}
let dfu = unsafe {
Partition::new(
&__bootloader_dfu_start as *const u32 as usize,
&__bootloader_dfu_end as *const u32 as usize,
)
};
let state = unsafe {
Partition::new(
&__bootloader_state_start as *const u32 as usize,
&__bootloader_state_end as *const u32 as usize,
)
};
embassy_boot::FirmwareUpdater::new(dfu, state)
}
}