google / google/wasefire

Use defmt for Rust applets

Open
#35 0 comments 0 reactions 0 assignees View on GitHub
for:footprint for:performance for:usability lang:rust needs:design
Dominant language
Rust
Stars
188
Forks
41
Avg merge
1d 5h
Merged PRs (30d)
12

Description

Once https://github.com/knurling-rs/defmt/issues/738 is fixed, the prelude can provide a defmt global logger such that applets may use defmt for logging. This would reduce the size of applets (as well as serial communication) when debugging.

There are a few design questions to be solved:
- Should the platform multiplex the applet serials into its own? This could be done by assuming defmt is using rzCOBS encoding. Each null byte may be followed by a byte describing which "binary" (platform or applet) it is coming from. On the other side of the serial, those bytes would be removed and used to send the frame to the correct defmt decoder.
- How to deal with applets made of multiple modules? This is not possible yet, but is a possibility to share code between applets. There would be one defmt table per module. Maybe each module has its own defmt global logger deferring to the defmt module with some magical id.

References:
- The [logging section](https://docs.rust-embedded.org/embedonomicon/logging.html) of the Embedonomicon explains the idea for ELF.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.