diff options
Diffstat (limited to 'examples/boot/bootloader/stm32wb-dfu/src')
| -rw-r--r-- | examples/boot/bootloader/stm32wb-dfu/src/main.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/examples/boot/bootloader/stm32wb-dfu/src/main.rs b/examples/boot/bootloader/stm32wb-dfu/src/main.rs index 107f243fd..9ee82846d 100644 --- a/examples/boot/bootloader/stm32wb-dfu/src/main.rs +++ b/examples/boot/bootloader/stm32wb-dfu/src/main.rs | |||
| @@ -7,14 +7,14 @@ 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::rcc::WPAN_DEFAULT; | 11 | use embassy_stm32::rcc::WPAN_DEFAULT; |
| 12 | use embassy_stm32::usb::Driver; | 12 | use embassy_stm32::usb::Driver; |
| 13 | use embassy_stm32::{bind_interrupts, peripherals, usb}; | 13 | use embassy_stm32::{bind_interrupts, peripherals, usb}; |
| 14 | use embassy_sync::blocking_mutex::Mutex; | 14 | use embassy_sync::blocking_mutex::Mutex; |
| 15 | use embassy_usb::{msos, Builder}; | 15 | use embassy_usb::{Builder, msos}; |
| 16 | use embassy_usb_dfu::consts::DfuAttributes; | 16 | use embassy_usb_dfu::consts::DfuAttributes; |
| 17 | use embassy_usb_dfu::{usb_dfu, Control, ResetImmediate}; | 17 | use embassy_usb_dfu::{Control, ResetImmediate, usb_dfu}; |
| 18 | 18 | ||
| 19 | bind_interrupts!(struct Irqs { | 19 | bind_interrupts!(struct Irqs { |
| 20 | USB_LP => usb::InterruptHandler<peripherals::USB>; | 20 | USB_LP => usb::InterruptHandler<peripherals::USB>; |
| @@ -109,8 +109,8 @@ fn main() -> ! { | |||
| 109 | unsafe { bl.load(BANK1_REGION.base + active_offset) } | 109 | unsafe { bl.load(BANK1_REGION.base + active_offset) } |
| 110 | } | 110 | } |
| 111 | 111 | ||
| 112 | #[no_mangle] | 112 | #[unsafe(no_mangle)] |
| 113 | #[cfg_attr(target_os = "none", link_section = ".HardFault.user")] | 113 | #[cfg_attr(target_os = "none", unsafe(link_section = ".HardFault.user"))] |
| 114 | unsafe extern "C" fn HardFault() { | 114 | unsafe extern "C" fn HardFault() { |
| 115 | cortex_m::peripheral::SCB::sys_reset(); | 115 | cortex_m::peripheral::SCB::sys_reset(); |
| 116 | } | 116 | } |
| @@ -118,7 +118,7 @@ unsafe extern "C" fn HardFault() { | |||
| 118 | #[exception] | 118 | #[exception] |
| 119 | unsafe fn DefaultHandler(_: i16) -> ! { | 119 | unsafe fn DefaultHandler(_: i16) -> ! { |
| 120 | const SCB_ICSR: *const u32 = 0xE000_ED04 as *const u32; | 120 | const SCB_ICSR: *const u32 = 0xE000_ED04 as *const u32; |
| 121 | let irqn = core::ptr::read_volatile(SCB_ICSR) as u8 as i16 - 16; | 121 | let irqn = unsafe { core::ptr::read_volatile(SCB_ICSR) } as u8 as i16 - 16; |
| 122 | 122 | ||
| 123 | panic!("DefaultHandler #{:?}", irqn); | 123 | panic!("DefaultHandler #{:?}", irqn); |
| 124 | } | 124 | } |
