From e40346a54495e2cf2de6cf45c8c6e87bb634165f Mon Sep 17 00:00:00 2001 From: dskleingeld <11743287+dskleingeld@users.noreply.github.com> Date: Sun, 2 May 2021 20:58:01 +0200 Subject: Fix core::panic! not printing in examples (#153) * fixes panic not showing in examples removes panic_immediate_abort feature where present, renames config -> config.toml, enables panic-probe defmt printing feature and updates panic-probe to 0.2 * fix unintended changes in build_core and arch * revert uninteded change --- embassy-nrf-examples/.cargo/config | 22 ---------------------- embassy-nrf-examples/.cargo/config.toml | 20 ++++++++++++++++++++ embassy-nrf-examples/Cargo.toml | 4 ++-- embassy-rp-examples/.cargo/config | 20 -------------------- embassy-rp-examples/.cargo/config.toml | 19 +++++++++++++++++++ embassy-rp-examples/Cargo.toml | 4 ++-- embassy-stm32-examples/.cargo/config | 28 ---------------------------- embassy-stm32-examples/.cargo/config.toml | 28 ++++++++++++++++++++++++++++ embassy-stm32-examples/Cargo.toml | 2 +- 9 files changed, 72 insertions(+), 75 deletions(-) delete mode 100644 embassy-nrf-examples/.cargo/config create mode 100644 embassy-nrf-examples/.cargo/config.toml delete mode 100644 embassy-rp-examples/.cargo/config create mode 100644 embassy-rp-examples/.cargo/config.toml delete mode 100644 embassy-stm32-examples/.cargo/config create mode 100644 embassy-stm32-examples/.cargo/config.toml diff --git a/embassy-nrf-examples/.cargo/config b/embassy-nrf-examples/.cargo/config deleted file mode 100644 index 17b9c8d80..000000000 --- a/embassy-nrf-examples/.cargo/config +++ /dev/null @@ -1,22 +0,0 @@ -[unstable] -build-std = ["core"] -build-std-features = ["panic_immediate_abort"] - -[target.'cfg(all(target_arch = "arm", target_os = "none"))'] -runner = "probe-run --chip nRF52840_xxAA" - -rustflags = [ - # LLD (shipped with the Rust toolchain) is used as the default linker - "-C", "link-arg=--nmagic", - "-C", "link-arg=-Tlink.x", - "-C", "link-arg=-Tdefmt.x", - - # Code-size optimizations. - "-Z", "trap-unreachable=no", - "-C", "inline-threshold=5", - "-C", "no-vectorize-loops", -] - -[build] -target = "thumbv7em-none-eabi" - diff --git a/embassy-nrf-examples/.cargo/config.toml b/embassy-nrf-examples/.cargo/config.toml new file mode 100644 index 000000000..1dbeb002e --- /dev/null +++ b/embassy-nrf-examples/.cargo/config.toml @@ -0,0 +1,20 @@ +[unstable] +build-std = ["core"] + +[target.'cfg(all(target_arch = "arm", target_os = "none"))'] +runner = "probe-run --chip nRF52840_xxAA" + +rustflags = [ + # LLD (shipped with the Rust toolchain) is used as the default linker + "-C", "link-arg=--nmagic", + "-C", "link-arg=-Tlink.x", + "-C", "link-arg=-Tdefmt.x", + + # Code-size optimizations. + "-Z", "trap-unreachable=no", + "-C", "inline-threshold=5", + "-C", "no-vectorize-loops", +] + +[build] +target = "thumbv7em-none-eabi" diff --git a/embassy-nrf-examples/Cargo.toml b/embassy-nrf-examples/Cargo.toml index 2a5b52dd9..29614f133 100644 --- a/embassy-nrf-examples/Cargo.toml +++ b/embassy-nrf-examples/Cargo.toml @@ -27,5 +27,5 @@ defmt-rtt = "0.2.0" cortex-m = { version = "0.7.1", features = ["inline-asm"] } cortex-m-rt = "0.6.13" embedded-hal = { version = "0.2.4" } -panic-probe = "0.1.0" -futures = { version = "0.3.8", default-features = false, features = ["async-await"] } \ No newline at end of file +panic-probe = { version = "0.2.0", features = ["print-defmt"] } +futures = { version = "0.3.8", default-features = false, features = ["async-await"] } diff --git a/embassy-rp-examples/.cargo/config b/embassy-rp-examples/.cargo/config deleted file mode 100644 index 8db641544..000000000 --- a/embassy-rp-examples/.cargo/config +++ /dev/null @@ -1,20 +0,0 @@ -[unstable] -build-std = ["core"] -build-std-features = ["panic_immediate_abort"] - -[target.'cfg(all(target_arch = "arm", target_os = "none"))'] -runner = "probe-run-rp --chip RP2040" - -rustflags = [ - # LLD (shipped with the Rust toolchain) is used as the default linker - "-C", "link-arg=--nmagic", - "-C", "link-arg=-Tlink.x", - "-C", "link-arg=-Tlink-rp.x", - "-C", "link-arg=-Tdefmt.x", - - # Code-size optimizations. - "-Z", "trap-unreachable=no", -] - -[build] -target = "thumbv6m-none-eabi" # Cortex-M0 and Cortex-M0+ diff --git a/embassy-rp-examples/.cargo/config.toml b/embassy-rp-examples/.cargo/config.toml new file mode 100644 index 000000000..1bbbe97da --- /dev/null +++ b/embassy-rp-examples/.cargo/config.toml @@ -0,0 +1,19 @@ +[unstable] +build-std = ["core"] + +[target.'cfg(all(target_arch = "arm", target_os = "none"))'] +runner = "probe-run-rp --chip RP2040" + +rustflags = [ + # LLD (shipped with the Rust toolchain) is used as the default linker + "-C", "link-arg=--nmagic", + "-C", "link-arg=-Tlink.x", + "-C", "link-arg=-Tlink-rp.x", + "-C", "link-arg=-Tdefmt.x", + + # Code-size optimizations. + "-Z", "trap-unreachable=no", +] + +[build] +target = "thumbv6m-none-eabi" # Cortex-M0 and Cortex-M0+ diff --git a/embassy-rp-examples/Cargo.toml b/embassy-rp-examples/Cargo.toml index dae22f809..2cee99bc5 100644 --- a/embassy-rp-examples/Cargo.toml +++ b/embassy-rp-examples/Cargo.toml @@ -28,5 +28,5 @@ defmt-rtt = "0.2.0" cortex-m = { version = "0.7.1", features = ["inline-asm"] } cortex-m-rt = "0.6.13" embedded-hal = { version = "0.2.4" } -panic-probe = "0.1.0" -futures = { version = "0.3.8", default-features = false, features = ["async-await", "cfg-target-has-atomic", "unstable"] } \ No newline at end of file +panic-probe = { version = "0.2.0", features = ["print-defmt"] } +futures = { version = "0.3.8", default-features = false, features = ["async-await", "cfg-target-has-atomic", "unstable"] } diff --git a/embassy-stm32-examples/.cargo/config b/embassy-stm32-examples/.cargo/config deleted file mode 100644 index 7c1d4dfb6..000000000 --- a/embassy-stm32-examples/.cargo/config +++ /dev/null @@ -1,28 +0,0 @@ -[target.'cfg(all(target_arch = "arm", target_os = "none"))'] -runner = "probe-run --chip STM32F401CCUx" - -rustflags = [ - # LLD (shipped with the Rust toolchain) is used as the default linker - "-C", "link-arg=--nmagic", - "-C", "link-arg=-Tlink.x", - "-C", "link-arg=-Tdefmt.x", - - # if you run into problems with LLD switch to the GNU linker by commenting out - # this line - # "-C", "linker=arm-none-eabi-ld", - - # if you need to link to pre-compiled C libraries provided by a C toolchain - # use GCC as the linker by commenting out both lines above and then - # uncommenting the three lines below - # "-C", "linker=arm-none-eabi-gcc", - # "-C", "link-arg=-Wl,-Tlink.x", - # "-C", "link-arg=-nostartfiles", - - # Code-size optimizations. - "-Z", "trap-unreachable=no", - "-C", "inline-threshold=5", - "-C", "no-vectorize-loops", -] - -[build] -target = "thumbv7em-none-eabihf" diff --git a/embassy-stm32-examples/.cargo/config.toml b/embassy-stm32-examples/.cargo/config.toml new file mode 100644 index 000000000..7c1d4dfb6 --- /dev/null +++ b/embassy-stm32-examples/.cargo/config.toml @@ -0,0 +1,28 @@ +[target.'cfg(all(target_arch = "arm", target_os = "none"))'] +runner = "probe-run --chip STM32F401CCUx" + +rustflags = [ + # LLD (shipped with the Rust toolchain) is used as the default linker + "-C", "link-arg=--nmagic", + "-C", "link-arg=-Tlink.x", + "-C", "link-arg=-Tdefmt.x", + + # if you run into problems with LLD switch to the GNU linker by commenting out + # this line + # "-C", "linker=arm-none-eabi-ld", + + # if you need to link to pre-compiled C libraries provided by a C toolchain + # use GCC as the linker by commenting out both lines above and then + # uncommenting the three lines below + # "-C", "linker=arm-none-eabi-gcc", + # "-C", "link-arg=-Wl,-Tlink.x", + # "-C", "link-arg=-nostartfiles", + + # Code-size optimizations. + "-Z", "trap-unreachable=no", + "-C", "inline-threshold=5", + "-C", "no-vectorize-loops", +] + +[build] +target = "thumbv7em-none-eabihf" diff --git a/embassy-stm32-examples/Cargo.toml b/embassy-stm32-examples/Cargo.toml index f12ed9101..bdb1ca84a 100644 --- a/embassy-stm32-examples/Cargo.toml +++ b/embassy-stm32-examples/Cargo.toml @@ -46,7 +46,7 @@ defmt-rtt = "0.2.0" cortex-m = "0.7.1" cortex-m-rt = "0.6.13" embedded-hal = { version = "0.2.4" } -panic-probe = "0.1.0" +panic-probe = { version = "0.2.0", features = ["print-defmt"] } futures = { version = "0.3.8", default-features = false, features = ["async-await"] } rtt-target = { version = "0.3", features = ["cortex-m"] } bxcan = "0.5.0" -- cgit