We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents cf52e9e + 6929b56 commit a34dd4fCopy full SHA for a34dd4f
examples/crash.rs
@@ -82,8 +82,10 @@
82
use panic_halt as _;
83
84
use core::ptr;
85
+use core::fmt::Write;
86
-use cortex_m_rt::entry;
87
+use cortex_m_rt::{entry, exception, ExceptionFrame};
88
+use cortex_m_semihosting::hio;
89
90
#[entry]
91
fn main() -> ! {
@@ -94,3 +96,12 @@ fn main() -> ! {
94
96
95
97
loop {}
98
}
99
+
100
+#[exception]
101
+fn HardFault(ef: &ExceptionFrame) -> ! {
102
+ if let Ok(mut hstdout) = hio::hstdout() {
103
+ writeln!(hstdout, "{:#?}", ef).ok();
104
+ }
105
106
+ loop {}
107
+}
0 commit comments