diff options
| author | Raul Alimbekov <[email protected]> | 2025-12-16 09:05:22 +0300 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-12-16 09:05:22 +0300 |
| commit | c9a04b4b732b7a3b696eb8223664c1a7942b1875 (patch) | |
| tree | 6dbe5c02e66eed8d8762f13f95afd24f8db2b38c /examples/boot/bootloader/stm32wba-dfu/src/main.rs | |
| parent | cde24a3ef1117653ba5ed4184102b33f745782fb (diff) | |
| parent | 5ae6e060ec1c90561719aabdc29d5b6e7b8b0a82 (diff) | |
Merge branch 'main' into main
Diffstat (limited to 'examples/boot/bootloader/stm32wba-dfu/src/main.rs')
| -rw-r--r-- | examples/boot/bootloader/stm32wba-dfu/src/main.rs | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/examples/boot/bootloader/stm32wba-dfu/src/main.rs b/examples/boot/bootloader/stm32wba-dfu/src/main.rs index 75d8d4199..b33a75d95 100644 --- a/examples/boot/bootloader/stm32wba-dfu/src/main.rs +++ b/examples/boot/bootloader/stm32wba-dfu/src/main.rs | |||
| @@ -7,13 +7,13 @@ use cortex_m_rt::{entry, exception}; | |||
| 7 | #[cfg(feature = "defmt")] | 7 | #[cfg(feature = "defmt")] |
| 8 | use defmt_rtt as _; | 8 | use defmt_rtt as _; |
| 9 | use embassy_boot_stm32::*; | 9 | use embassy_boot_stm32::*; |
| 10 | use embassy_stm32::flash::{Flash, BANK1_REGION, WRITE_SIZE}; | 10 | use embassy_stm32::flash::{BANK1_REGION, Flash, WRITE_SIZE}; |
| 11 | use embassy_stm32::usb::Driver; | 11 | use embassy_stm32::usb::Driver; |
| 12 | use embassy_stm32::{bind_interrupts, peripherals, usb, Config}; | 12 | use embassy_stm32::{Config, bind_interrupts, peripherals, usb}; |
| 13 | use embassy_sync::blocking_mutex::Mutex; | 13 | use embassy_sync::blocking_mutex::Mutex; |
| 14 | use embassy_usb::{msos, Builder}; | 14 | use embassy_usb::{Builder, msos}; |
| 15 | use embassy_usb_dfu::consts::DfuAttributes; | 15 | use embassy_usb_dfu::consts::DfuAttributes; |
| 16 | use embassy_usb_dfu::{usb_dfu, Control, ResetImmediate}; | 16 | use embassy_usb_dfu::{Control, ResetImmediate, usb_dfu}; |
| 17 | 17 | ||
| 18 | bind_interrupts!(struct Irqs { | 18 | bind_interrupts!(struct Irqs { |
| 19 | USB_OTG_HS => usb::InterruptHandler<peripherals::USB_OTG_HS>; | 19 | USB_OTG_HS => usb::InterruptHandler<peripherals::USB_OTG_HS>; |
| @@ -138,8 +138,8 @@ fn main() -> ! { | |||
| 138 | unsafe { bl.load(BANK1_REGION.base + active_offset) } | 138 | unsafe { bl.load(BANK1_REGION.base + active_offset) } |
| 139 | } | 139 | } |
| 140 | 140 | ||
| 141 | #[no_mangle] | 141 | #[unsafe(no_mangle)] |
| 142 | #[cfg_attr(target_os = "none", link_section = ".HardFault.user")] | 142 | #[cfg_attr(target_os = "none", unsafe(link_section = ".HardFault.user"))] |
| 143 | unsafe extern "C" fn HardFault() { | 143 | unsafe extern "C" fn HardFault() { |
| 144 | cortex_m::peripheral::SCB::sys_reset(); | 144 | cortex_m::peripheral::SCB::sys_reset(); |
| 145 | } | 145 | } |
| @@ -147,7 +147,7 @@ unsafe extern "C" fn HardFault() { | |||
| 147 | #[exception] | 147 | #[exception] |
| 148 | unsafe fn DefaultHandler(_: i16) -> ! { | 148 | unsafe fn DefaultHandler(_: i16) -> ! { |
| 149 | const SCB_ICSR: *const u32 = 0xE000_ED04 as *const u32; | 149 | const SCB_ICSR: *const u32 = 0xE000_ED04 as *const u32; |
| 150 | let irqn = core::ptr::read_volatile(SCB_ICSR) as u8 as i16 - 16; | 150 | let irqn = unsafe { core::ptr::read_volatile(SCB_ICSR) } as u8 as i16 - 16; |
| 151 | 151 | ||
| 152 | panic!("DefaultHandler #{:?}", irqn); | 152 | panic!("DefaultHandler #{:?}", irqn); |
| 153 | } | 153 | } |
