Defmt: Debugging Embedded Rust Without GDB (2020)
ferrous-systems.com
ferrous-systems.com
The cool thing about defmt is that it doesn't do string formatting in the program itself. The problem with logging is that many formatting operations - like formatting floats as strings - can be very expensive on small embedded microcontrollers, both the runtime cost as well as a big increase in binary size. Instead, defmt sends the memory representation of the logged values to the host (over an arbitrary transport like UART or RTT). The formatting / visualization of the logs is then handled on the host side.
This has the downside that you cannot simply connect a random serial console to your microcontroller for logging, because defmt uses its own non-plaintext format. But it has the huge advantage that you can do very efficient logging in the microcontroller firmware, and then visualize all those logs on your host with an appropriate client.
More details can be found in the article itself.
It has "channels" and each channel gets its own tab in the built-in interface. It's so sweet! Check it out (I'm typing F1 through F7 to go through all the channels):
https://gfycat.com/lonelyspanishasiandamselfly
To get to that interface I just ran `cargo build --release` and it comes up automatically :D
The values output in the various "AM<num>" tabs are the readings from the hall effect sensors (in millivolts). So I can see that I had a lot of work to do on voltage wobble, haha. We'll see how well I did in fixing it with the next revision of the PCB (which I can't order because everywhere is out of stock of the hall effect sensors I need! SOT-23 "49e" sensors if you're curious which sensor).
In this chat they map (what I presume to be) a channel to colors: https://youtu.be/BZqt187RWTw?t=506. Haven't had the time to look at it in detail yet.