From 74bdeb3665b1e905a31380462e1dbf985cdda723 Mon Sep 17 00:00:00 2001 From: Mirabellensaft Date: Tue, 6 Dec 2022 15:13:20 +0100 Subject: [PATCH] correct logging --- beginner/apps/Cargo.toml | 9 ++++----- boards/dk/Cargo.toml | 5 ++--- embedded-workshop-book/src/using-hal.md | 11 +++-------- 3 files changed, 9 insertions(+), 16 deletions(-) diff --git a/beginner/apps/Cargo.toml b/beginner/apps/Cargo.toml index 633f9b2..7ba1c1f 100644 --- a/beginner/apps/Cargo.toml +++ b/beginner/apps/Cargo.toml @@ -34,12 +34,11 @@ opt-level = 3 overflow-checks = false [features] -# set defmt logging levels here -default = [ - "defmt-default", - # "dependency-a/defmt-trace", -] +default = [ + "other-feature" +] +other-feature = [] # do NOT modify these features defmt-default = [] defmt-trace = [] diff --git a/boards/dk/Cargo.toml b/boards/dk/Cargo.toml index a4213f6..123de69 100644 --- a/boards/dk/Cargo.toml +++ b/boards/dk/Cargo.toml @@ -18,11 +18,10 @@ defmt-rtt = "0.3.1" advanced = [] beginner = [] -# set defmt logging levels here default = [ - "defmt-info", - # "dependency-a/defmt-trace", + "other-feature" ] +other-feature = [] # do NOT modify these features defmt-default = [] diff --git a/embedded-workshop-book/src/using-hal.md b/embedded-workshop-book/src/using-hal.md index 1537497..67e5f1c 100644 --- a/embedded-workshop-book/src/using-hal.md +++ b/embedded-workshop-book/src/using-hal.md @@ -28,15 +28,10 @@ $ cargo doc -p dk --open ✅ Check the API docs of the `Led` abstraction. Change the `led` program, so that the bottom two LEDs are turned on, and the top two are turned off. -🔎 If you want to see logs from Led API of the `dk` Hardware Abstraction Layer, go to `boards/dk/Cargo.toml` and change the log level of the `dk` crate: +🔎 If you want to see logs from Led API of the `dk` Hardware Abstraction Layer, flash the dk with the following environment variable: -```diff -# set defmt logging levels here -default = [ -- "defmt-debug", -+ "defmt-trace", - # "dependency-a/defmt-trace", -] +```console +$ DEFMT_LOG=trace cargo run --bin led ``` Among the logs you'll find the line "I/O pins have been configured for digital output". At this point the electrical pins of the nRF52840 microcontroller have been configured to drive the 4 LEDs on the board.