defmt works properly now

This commit is contained in:
2025-04-12 16:45:43 +02:00
parent 86ac7428bb
commit 0515ca5eaa
23 changed files with 121 additions and 281 deletions

View File

@ -77,7 +77,7 @@ to flash and run the blinky program on the RAM. There is also a `VA108xx` chip t
available for persistent flashing.
Runner configuration avilable in the `.cargo/def-config.toml` file to use `probe-rs` for
convenience.
convenience. `probe-rs` is also able to process and display `defmt` strings directly.
### Using VS Code
@ -123,13 +123,13 @@ is also run when running the `jlink-gdb.sh` script)
```sh
JLinkGDBServer -select USB -device Cortex-M0 -endian little -if JTAG-speed auto \
-LocalhostOnly
-LocalhostOnly -jtagconf -1,-1
```
After this, you can flash and debug the application with the following command
```sh
gdb-mutliarch -q -x jlink/jlink.gdb target/thumbv6m-none-eabihf/debug/examples/blinky
gdb-mutliarch -q -x jlink/jlink.gdb target/thumbv6m-none-eabihf/debug/examples/blinky -tui
```
Please note that you can automate all steps except starting the GDB server by using a cargo
@ -149,6 +149,16 @@ The Segger RTT viewer can be used to display log messages received from the targ
address for the RTT block placement is 0x10000000. It is recommended to use a search range of
0x1000 around that base address when using the RTT viewer.
The RTT viewer will not be able to process `defmt` printouts. However, you can view the defmt
logs by [installing defmt-print](https://crates.io/crates/defmt-print) first and then piping
the output on telnet port 19021 into `defmt-print`, for example by running
```sh
telnet localhost 19021 | defmt-print -e <pathToElfFile>
```
The path of the ELF file which is being debugged needs to be specified for this to work.
## Learning (Embedded) Rust
If you are unfamiliar with Rust on Embedded Systems or Rust in general, the following resources