diff options
Diffstat (limited to 'examples/boot/bootloader/stm32-dual-bank/src/main.rs')
| -rw-r--r-- | examples/boot/bootloader/stm32-dual-bank/src/main.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/examples/boot/bootloader/stm32-dual-bank/src/main.rs b/examples/boot/bootloader/stm32-dual-bank/src/main.rs index 4d2e82d26..f0063fb5c 100644 --- a/examples/boot/bootloader/stm32-dual-bank/src/main.rs +++ b/examples/boot/bootloader/stm32-dual-bank/src/main.rs | |||
| @@ -7,7 +7,7 @@ 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}; | 10 | use embassy_stm32::flash::{BANK1_REGION, Flash}; |
| 11 | use embassy_sync::blocking_mutex::Mutex; | 11 | use embassy_sync::blocking_mutex::Mutex; |
| 12 | 12 | ||
| 13 | #[entry] | 13 | #[entry] |
| @@ -33,8 +33,8 @@ fn main() -> ! { | |||
| 33 | unsafe { bl.load(BANK1_REGION.base + active_offset) } | 33 | unsafe { bl.load(BANK1_REGION.base + active_offset) } |
| 34 | } | 34 | } |
| 35 | 35 | ||
| 36 | #[no_mangle] | 36 | #[unsafe(no_mangle)] |
| 37 | #[cfg_attr(target_os = "none", link_section = ".HardFault.user")] | 37 | #[cfg_attr(target_os = "none", unsafe(link_section = ".HardFault.user"))] |
| 38 | unsafe extern "C" fn HardFault() { | 38 | unsafe extern "C" fn HardFault() { |
| 39 | cortex_m::peripheral::SCB::sys_reset(); | 39 | cortex_m::peripheral::SCB::sys_reset(); |
| 40 | } | 40 | } |
| @@ -42,7 +42,7 @@ unsafe extern "C" fn HardFault() { | |||
| 42 | #[exception] | 42 | #[exception] |
| 43 | unsafe fn DefaultHandler(_: i16) -> ! { | 43 | unsafe fn DefaultHandler(_: i16) -> ! { |
| 44 | const SCB_ICSR: *const u32 = 0xE000_ED04 as *const u32; | 44 | const SCB_ICSR: *const u32 = 0xE000_ED04 as *const u32; |
| 45 | let irqn = core::ptr::read_volatile(SCB_ICSR) as u8 as i16 - 16; | 45 | let irqn = unsafe { core::ptr::read_volatile(SCB_ICSR) } as u8 as i16 - 16; |
| 46 | 46 | ||
| 47 | panic!("DefaultHandler #{:?}", irqn); | 47 | panic!("DefaultHandler #{:?}", irqn); |
| 48 | } | 48 | } |
