From 27d054aa6875d977efc5f5c3554c57fd1245bdb9 Mon Sep 17 00:00:00 2001 From: Kaitlyn Kenwell Date: Thu, 14 Dec 2023 10:34:22 -0500 Subject: [PATCH] Adjust toml files, fix application example --- examples/boot/application/stm32wb-dfu/Cargo.toml | 2 +- examples/boot/application/stm32wb-dfu/src/main.rs | 10 +++++----- examples/boot/bootloader/stm32wb-dfu/Cargo.toml | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/examples/boot/application/stm32wb-dfu/Cargo.toml b/examples/boot/application/stm32wb-dfu/Cargo.toml index 57d51de02..0ed0b75e0 100644 --- a/examples/boot/application/stm32wb-dfu/Cargo.toml +++ b/examples/boot/application/stm32wb-dfu/Cargo.toml @@ -1,6 +1,6 @@ [package] edition = "2021" -name = "embassy-boot-stm32wl-examples" +name = "embassy-boot-stm32wb-dfu-examples" version = "0.1.0" license = "MIT OR Apache-2.0" diff --git a/examples/boot/application/stm32wb-dfu/src/main.rs b/examples/boot/application/stm32wb-dfu/src/main.rs index f03003ffe..cdac903b5 100644 --- a/examples/boot/application/stm32wb-dfu/src/main.rs +++ b/examples/boot/application/stm32wb-dfu/src/main.rs @@ -6,7 +6,7 @@ use core::cell::RefCell; #[cfg(feature = "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_stm32::flash::{Flash, WRITE_SIZE}; use embassy_stm32::rcc::WPAN_DEFAULT; @@ -33,8 +33,8 @@ async fn main(_spawner: Spawner) { let config = FirmwareUpdaterConfig::from_linkerfile_blocking(&flash); let mut magic = AlignedBuffer([0; WRITE_SIZE]); - let mut updater = BlockingFirmwareUpdater::new(config, &mut magic.0); - updater.mark_booted().expect("Failed to mark booted"); + let mut firmware_state = BlockingFirmwareState::from_config(config, &mut magic.0); + firmware_state.mark_booted().expect("Failed to mark booted"); let driver = Driver::new(p.USB, Irqs, p.PA12, p.PA11); 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 bos_descriptor = [0; 256]; 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( driver, config, @@ -57,7 +57,7 @@ async fn main(_spawner: Spawner) { &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(); dev.run().await diff --git a/examples/boot/bootloader/stm32wb-dfu/Cargo.toml b/examples/boot/bootloader/stm32wb-dfu/Cargo.toml index 774a8223d..fde9eb57d 100644 --- a/examples/boot/bootloader/stm32wb-dfu/Cargo.toml +++ b/examples/boot/bootloader/stm32wb-dfu/Cargo.toml @@ -1,8 +1,8 @@ [package] edition = "2021" -name = "stm32-bootloader-example" +name = "stm32wb-dfu-bootloader-example" 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" [dependencies]