panic: abort, not halt

This commit is contained in:
Robert Jördens 2019-06-10 00:29:20 +02:00
parent 9b6ef68eac
commit dd981ed850
3 changed files with 2 additions and 9 deletions

7
Cargo.lock generated
View File

@ -172,11 +172,6 @@ name = "managed"
version = "0.7.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "panic-abort"
version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "panic-semihosting"
version = "0.5.2"
@ -296,7 +291,6 @@ dependencies = [
"cortex-m-rtfm 0.5.0-alpha.1 (git+https://github.com/japaric/cortex-m-rtfm?rev=fafeeb2)",
"heapless 0.5.0-alpha.2 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
"panic-abort 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
"panic-semihosting 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 1.0.92 (registry+https://github.com/rust-lang/crates.io-index)",
"serde-json-core 0.0.1 (git+https://github.com/quartiq/serde-json-core.git?rev=fc764de)",
@ -374,7 +368,6 @@ dependencies = [
"checksum heapless 0.5.0-alpha.2 (registry+https://github.com/rust-lang/crates.io-index)" = "c50e9f50ed4098bca126410960080738c3dd4cbea45812c15cf8aa02a9cfded1"
"checksum log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "c84ec4b527950aa83a329754b01dbe3f58361d1c5efacd1f6d68c494d08a17c6"
"checksum managed 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)" = "fdcec5e97041c7f0f1c5b7d93f12e57293c831c646f4cc7a5db59460c7ea8de6"
"checksum panic-abort 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2c14a66511ed17b6a8b4256b868d7fd207836d891db15eea5195dbcaf87e630f"
"checksum panic-semihosting 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "97cfb37c1d3b5f0cc18bf14485018cccd13bdd24f7b5bfd456c1d8760afef824"
"checksum proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)" = "cf3d2011ab5c909338f7887f4fc896d35932e29146c12c8d01da6b22a80ba759"
"checksum quote 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)" = "faf4799c5d274f3868a4aae320a0a182cbd2baee377b378f080e16a23e9d80db"

View File

@ -31,7 +31,6 @@ cortex-m = { version = "0.6", features = ["inline-asm", "const-fn"] }
cortex-m-rt = { version = "0.6", features = ["device"] }
cortex-m-log = { version = "0.5", features = ["log-integration"] }
log = "0.4"
panic-abort = "0.3"
panic-semihosting = { version = "0.5.2", optional = true }
serde = { version = "1.0", features = ["derive"], default-features = false }
heapless = { version = "0.5.0-alpha.2" }

View File

@ -3,6 +3,7 @@
#![feature(asm)]
// Enable returning `!`
#![feature(never_type)]
#![feature(core_intrinsics)]
#[inline(never)]
#[panic_handler]
@ -10,7 +11,7 @@
fn panic(_info: &core::panic::PanicInfo) -> ! {
let gpiod = unsafe { &*pac::GPIOD::ptr() };
gpiod.odr.modify(|_, w| w.odr6().high().odr12().high()); // FP_LED_1, FP_LED_3
loop { core::sync::atomic::compiler_fence(core::sync::atomic::Ordering::SeqCst); }
unsafe { core::intrinsics::abort(); }
}
#[cfg(feature = "semihosting")]