From 49a254f8ce616665ad86cbd68525324861c6a3a2 Mon Sep 17 00:00:00 2001 From: Jorge Aparicio Date: Thu, 21 Jan 2021 14:00:40 +0100 Subject: [PATCH 1/2] use asm::udf in panic-log to match panic-probe behavior UDF makes probe-run exit with a non-zero exit code --- common/panic-log/src/lib.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/common/panic-log/src/lib.rs b/common/panic-log/src/lib.rs index cb82695..5a08462 100644 --- a/common/panic-log/src/lib.rs +++ b/common/panic-log/src/lib.rs @@ -8,7 +8,6 @@ use cortex_m::asm; fn panic(info: &PanicInfo) -> ! { log::error!("{}", info); - loop { - asm::bkpt() - } + // abort instruction: triggers a HardFault exception which causes probe-run to exit + asm::udf() } From ec03653be4f0c56edecde24f64a343faf91fe11b Mon Sep 17 00:00:00 2001 From: Jorge Aparicio Date: Thu, 21 Jan 2021 14:03:57 +0100 Subject: [PATCH 2/2] bump cortex-m versions to ensure we use versions that don't have debuginfo issues which break probe-run backtraces --- advanced/firmware/Cargo.toml | 4 ++-- beginner/apps/Cargo.toml | 4 ++-- boards/dk/Cargo.toml | 4 ++-- common/panic-log/Cargo.toml | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/advanced/firmware/Cargo.toml b/advanced/firmware/Cargo.toml index 943d6ef..dca67df 100644 --- a/advanced/firmware/Cargo.toml +++ b/advanced/firmware/Cargo.toml @@ -12,8 +12,8 @@ usb2 = { git = "https://github.com/japaric/usb2" } [dependencies] consts = { path = "../common/consts" } -cortex-m = "0.6.2" -cortex-m-rt = "0.6.12" +cortex-m = "0.6.4" +cortex-m-rt = "0.6.13" cortex-m-rtic = "0.5.1" dk = { path = "../../boards/dk", features = ["advanced"] } heapless = "0.5.5" diff --git a/beginner/apps/Cargo.toml b/beginner/apps/Cargo.toml index a9374c5..991b60d 100644 --- a/beginner/apps/Cargo.toml +++ b/beginner/apps/Cargo.toml @@ -6,8 +6,8 @@ name = "apps" version = "0.0.0" [dependencies] -cortex-m = "0.6.2" -cortex-m-rt = "0.6.12" +cortex-m = "0.6.4" +cortex-m-rt = "0.6.13" dk = { path = "../../boards/dk", features = ["beginner"] } heapless = "0.5.5" log = "0.4.8" diff --git a/boards/dk/Cargo.toml b/boards/dk/Cargo.toml index 14aac39..2bfe8be 100644 --- a/boards/dk/Cargo.toml +++ b/boards/dk/Cargo.toml @@ -6,8 +6,8 @@ name = "dk" version = "0.0.0" [dependencies] -cortex-m = "0.6.2" -cortex-m-rt = "0.6.12" +cortex-m = "0.6.4" +cortex-m-rt = "0.6.13" embedded-hal = "0.2.3" hal = { package = "nrf52840-hal", git = "https://github.com/japaric/nrf-hal", branch = "radio" } log = "0.4.8" diff --git a/common/panic-log/Cargo.toml b/common/panic-log/Cargo.toml index 2e98e95..4129601 100644 --- a/common/panic-log/Cargo.toml +++ b/common/panic-log/Cargo.toml @@ -6,5 +6,5 @@ name = "panic-log" version = "0.0.0" [dependencies] -cortex-m = "0.6.2" +cortex-m = "0.6.4" log = "0.4.8"