mirror of
https://github.com/ferrous-systems/embedded-trainings-2020.git
synced 2024-05-06 10:39:12 +00:00
16 lines
307 B
Rust
16 lines
307 B
Rust
#![no_std]
|
|
|
|
use core::panic::PanicInfo;
|
|
|
|
use cortex_m::asm;
|
|
|
|
#[panic_handler]
|
|
fn panic(info: &PanicInfo) -> ! {
|
|
unsafe { (0x4002_7504 as *mut u32).write_volatile(0) }
|
|
|
|
log::error!("{}", info);
|
|
|
|
// abort instruction: triggers a HardFault exception which causes probe-run to exit
|
|
asm::udf()
|
|
}
|