diff --git a/.gitignore b/.gitignore index b71c776..3443356 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,6 @@ target/ book/ Cargo.lock - +rtt.log .vscode/ *.DS_Store diff --git a/beginner/apps/.vscode/launch.json b/beginner/apps/.vscode/launch.json index ec06c3d..4634018 100644 --- a/beginner/apps/.vscode/launch.json +++ b/beginner/apps/.vscode/launch.json @@ -18,16 +18,21 @@ "transport select swd", "source [find target/nrf52.cfg]" ], - // commands only supported in OpenOCD 0.11.0; also due to how the `rtt-target` crate works - // these commands need to run _after_ the target executes the `rtt_init` macro so running - // these commands when the device is halted on `main` will fail - // "postLaunchCommands": [ - // // FIXME(?) to work with a newer version (>0.3.7) of the cortex-debug extension the - // // escaped backslashes (`\\`) may need to be removed - // "monitor rtt setup 0x20000000 262144 \\\"SEGGER RTT\\\"", - // "monitor rtt start", - // "monitor rtt server start 8765 0", - // ], + "rttConfig": { + "enabled": true, + "address": "auto", + "decoders": [ + { + "port": 0, + "type": "console", + "label": "Defmt RTT", + // You can parse this log file with + // tail -F rtt.log | defmt-print -e ./target/thumbv7em-none-eabihf/debug/led + "logfile": "${workspaceRoot}/rtt.log", + "noprompt": true + } + ] + } } ] }