Description
Currently, we support the Rust log
frame work, which can send messages either through printk, or Zephyr's log framework. This certainly works, but it ends up bringing in the entire formatting framework on the Rust side (in addition to printk on the Zephyr side).
Many embedded projects in Rust use the defmt
framework to log messages. This is a deferred logging framework that encodes the log messages in a binary format, where log strings are not included in the image, but referenced by index. A host-side tool reads this stream, and formats the messages. It reads the elf image, where the various string constants are placed in a section that is not in the image.
A common backend for defmt
is to use a channel in RTT. Zephyr has RTT support, and also supports multiple channels. Rather that try to somehow combine these, the proposal here is to use a second channel to encode the defmt messages.
Implementing this requires implementing a backend for defmt
. This will take the data passed in, and send using the Zephyr interface to RTT that already exists.
The defmt authors are open to patches that would allow it to receive messages from both the Zephyr log channel as well as the defmt channel. Without these patches, the defmt-print
tool would be able to print the rust-side defmt messages, and something else, such as socat, could be used to view Zephyr logs.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Todo