Adjust toml files, fix application example
This commit is contained in:
parent
ccf4d854f8
commit
7a5d090810
@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
name = "embassy-boot-stm32wl-examples"
|
name = "embassy-boot-stm32wb-dfu-examples"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
license = "MIT OR Apache-2.0"
|
license = "MIT OR Apache-2.0"
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@ use core::cell::RefCell;
|
|||||||
|
|
||||||
#[cfg(feature = "defmt-rtt")]
|
#[cfg(feature = "defmt-rtt")]
|
||||||
use defmt_rtt::*;
|
use defmt_rtt::*;
|
||||||
use embassy_boot_stm32::{AlignedBuffer, BlockingFirmwareUpdater, FirmwareUpdaterConfig};
|
use embassy_boot_stm32::{AlignedBuffer, BlockingFirmwareState, FirmwareUpdaterConfig};
|
||||||
use embassy_executor::Spawner;
|
use embassy_executor::Spawner;
|
||||||
use embassy_stm32::flash::{Flash, WRITE_SIZE};
|
use embassy_stm32::flash::{Flash, WRITE_SIZE};
|
||||||
use embassy_stm32::rcc::WPAN_DEFAULT;
|
use embassy_stm32::rcc::WPAN_DEFAULT;
|
||||||
@ -33,8 +33,8 @@ async fn main(_spawner: Spawner) {
|
|||||||
|
|
||||||
let config = FirmwareUpdaterConfig::from_linkerfile_blocking(&flash);
|
let config = FirmwareUpdaterConfig::from_linkerfile_blocking(&flash);
|
||||||
let mut magic = AlignedBuffer([0; WRITE_SIZE]);
|
let mut magic = AlignedBuffer([0; WRITE_SIZE]);
|
||||||
let mut updater = BlockingFirmwareUpdater::new(config, &mut magic.0);
|
let mut firmware_state = BlockingFirmwareState::from_config(config, &mut magic.0);
|
||||||
updater.mark_booted().expect("Failed to mark booted");
|
firmware_state.mark_booted().expect("Failed to mark booted");
|
||||||
|
|
||||||
let driver = Driver::new(p.USB, Irqs, p.PA12, p.PA11);
|
let driver = Driver::new(p.USB, Irqs, p.PA12, p.PA11);
|
||||||
let mut config = embassy_usb::Config::new(0xc0de, 0xcafe);
|
let mut config = embassy_usb::Config::new(0xc0de, 0xcafe);
|
||||||
@ -46,7 +46,7 @@ async fn main(_spawner: Spawner) {
|
|||||||
let mut config_descriptor = [0; 256];
|
let mut config_descriptor = [0; 256];
|
||||||
let mut bos_descriptor = [0; 256];
|
let mut bos_descriptor = [0; 256];
|
||||||
let mut control_buf = [0; 64];
|
let mut control_buf = [0; 64];
|
||||||
let mut state = Control::new(updater, DfuAttributes::CAN_DOWNLOAD);
|
let mut state = Control::new(firmware_state, DfuAttributes::CAN_DOWNLOAD);
|
||||||
let mut builder = Builder::new(
|
let mut builder = Builder::new(
|
||||||
driver,
|
driver,
|
||||||
config,
|
config,
|
||||||
@ -57,7 +57,7 @@ async fn main(_spawner: Spawner) {
|
|||||||
&mut control_buf,
|
&mut control_buf,
|
||||||
);
|
);
|
||||||
|
|
||||||
usb_dfu::<_, _, _>(&mut builder, &mut state, Duration::from_millis(2500));
|
usb_dfu::<_, _>(&mut builder, &mut state, Duration::from_millis(2500));
|
||||||
|
|
||||||
let mut dev = builder.build();
|
let mut dev = builder.build();
|
||||||
dev.run().await
|
dev.run().await
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
[package]
|
[package]
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
name = "stm32-bootloader-example"
|
name = "stm32wb-dfu-bootloader-example"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
description = "Example bootloader for STM32 chips"
|
description = "Example USB DFUbootloader for the STM32WB series of chips"
|
||||||
license = "MIT OR Apache-2.0"
|
license = "MIT OR Apache-2.0"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
Loading…
Reference in New Issue
Block a user