-
-
Notifications
You must be signed in to change notification settings - Fork 76
/
README.md
114 lines (77 loc) · 3.06 KB
/
README.md
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
# `defmt`
`defmt` ("de format", short for "deferred formatting") is a highly efficient logging framework that targets resource-constrained devices, like microcontrollers.
For more details about the framework check the book at <https://defmt.ferrous-systems.com>.
The git version of the defmt book can be viewed at <https://defmt-next.ferrous-systems.com/>.
## Setup
### New project
The fastest way to get started with `defmt` is to use our [app-template] to set up a new Cortex-M embedded project.
[app-template]: https://github.com/knurling-rs/app-template
### Existing project
To include `defmt` in your existing project, follow our [Application Setup guide].
[Application Setup guide]: https://defmt.ferrous-systems.com/setup.html
## MSRV
`defmt` always compiles on the [latest `stable` rust release](https://github.com/rust-lang/rust/releases/latest). This is enforced by our CI building and testing against this version.
It still might work on older rust versions, but this isn't ensured.
## defmt ecosystem
The following diagram illustrates the user-facing and internal crates of the defmt framework.
```mermaid
%%{ init: { 'flowchart': { 'curve': 'step', "defaultRenderer": "elk" } } }%%
graph TD;
A[[defmt]]
B[defmt-decoder]
C[defmt-itm]
D[defmt-macros]
E[defmt-parser]
F[defmt-print]
G[defmt-rtt]
H(defmt-semihosting)
I[[defmt-test]]
J[defmt-test-macros]
K[[flip-link]]
L[panic-probe]
M[[probe-run]]
N(qemu-run)
A --> D
B & D --o E
C & G & H & I & L --> A
F & M & N --o B
I --o J
subgraph Legend
O[[user facing crate]]
P[internal crate]
Q(unreleased crate)
O -- dependency --> P
Q -- pinned dependency --o P
end
J ~~~ Legend
```
## Developer Information
### Running Tests
Tests are run using `cargo xtask` -- although this is simply an alias (defined in `.cargo/config.toml`) for `cargo run --package xtask --`.
To see a list of options, see [`xtask/src/main.rs`](xtask/src/main.rs), or run:
```console
$ cargo xtask help
```
For example, to run all the tests, run:
```console
$ cargo xtask test-all
```
You will need `qemu-system-arm` installed and in your `$PATH` for some of the tests (e.g. `test-snapshot`).
## Support
`defmt` is part of the [Knurling] project, [Ferrous Systems]' effort at
improving tooling used to develop for embedded systems.
If you think that our work is useful, consider sponsoring it via [GitHub
Sponsors].
## License
Licensed under either of
- Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or
http://www.apache.org/licenses/LICENSE-2.0)
- MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)
at your option.
### Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted
for inclusion in the work by you, as defined in the Apache-2.0 license, shall be
licensed as above, without any additional terms or conditions.
[Knurling]: https://knurling.ferrous-systems.com/
[Ferrous Systems]: https://ferrous-systems.com/
[GitHub Sponsors]: https://github.com/sponsors/knurling-rs