fix(boot): update examples
This commit is contained in:
parent
4a72f946e4
commit
cfc3e96633
18 changed files with 24 additions and 44 deletions
|
@ -1,29 +1,9 @@
|
|||
# Examples using bootloader
|
||||
|
||||
Example for STM32WL demonstrating the bootloader. The example consists of application binaries, 'a'
|
||||
which allows you to press a button to start the DFU process, and 'b' which is the updated
|
||||
application.
|
||||
|
||||
|
||||
## Prerequisites
|
||||
|
||||
* `cargo-binutils`
|
||||
* `cargo-flash`
|
||||
* `embassy-boot-stm32`
|
||||
Example for STM32WB demonstrating the USB DFU application.
|
||||
|
||||
## Usage
|
||||
|
||||
```
|
||||
# Flash bootloader
|
||||
cargo flash --manifest-path ../../bootloader/stm32/Cargo.toml --release --features embassy-stm32/stm32wl55jc-cm4 --chip STM32WLE5JCIx
|
||||
# Build 'b'
|
||||
cargo build --release --bin b
|
||||
# Generate binary for 'b'
|
||||
cargo objcopy --release --bin b -- -O binary b.bin
|
||||
```
|
||||
|
||||
# Flash `a` (which includes b.bin)
|
||||
|
||||
```
|
||||
cargo flash --release --bin a --chip STM32WLE5JCIx
|
||||
cargo flash --release --chip STM32WB55RGVx
|
||||
```
|
||||
|
|
|
@ -30,7 +30,7 @@ async fn main(_spawner: Spawner) {
|
|||
let flash = Flash::new_blocking(p.FLASH);
|
||||
let flash = Mutex::new(RefCell::new(flash));
|
||||
|
||||
let config = FirmwareUpdaterConfig::from_linkerfile_blocking(&flash);
|
||||
let config = FirmwareUpdaterConfig::from_linkerfile_blocking(&flash, &flash);
|
||||
let mut magic = AlignedBuffer([0; WRITE_SIZE]);
|
||||
let mut firmware_state = BlockingFirmwareState::from_config(config, &mut magic.0);
|
||||
firmware_state.mark_booted().expect("Failed to mark booted");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue