Migrating from git defmt to stable defmt
NOTE this talks about migrating to defmt v0.1.x; v0.2.0 is on yet on crates.io!
On 2020-11-11, a stable version of defmt
became available on crates.io.
If you are still using the git version you are encouraged to migrate your project to the crates.io version!
Two things need to be done to use the crates.io version of defmt
:
- change
defmt
,defmt-rtt
andpanic-probe
dependencies from git to version"0.1.0"
in relevantCargo.toml
-s - install version v0.1.4 (or newer) of
probe-run
Here's are the exact steps for migrating an app-template
project.
- In your
app-template
project, change the rootCargo.toml
as shown below:
[workspace]
members = ["testsuite"]
-[dependencies.defmt]
-git = "https://github.com/knurling-rs/defmt"
-branch = "main"
-
-[dependencies.defmt-rtt]
-git = "https://github.com/knurling-rs/defmt"
-branch = "main"
-
-[dependencies.panic-probe]
-git = "https://github.com/knurling-rs/probe-run"
-branch = "main"
-
[dependencies]
+defmt = "0.1.0"
+defmt-rtt = "0.1.0"
+panic-probe = { version = "0.1.0", features = ["print-defmt"] }
cortex-m = "0.6.4"
cortex-m-rt = "0.6.13"
- In your
app-template
project, also change thetestsuite/Cargo.toml
as shown below:
name = "test"
harness = false
-[dependencies.defmt]
-git = "https://github.com/knurling-rs/defmt"
-branch = "main"
-
-[dependencies.defmt-rtt]
-git = "https://github.com/knurling-rs/defmt"
-branch = "main"
-
-[dependencies.panic-probe]
-git = "https://github.com/knurling-rs/probe-run"
-branch = "main"
-# enable the `print-defmt` feature for more complete test output
-features = ["print-defmt"]
-
[dependencies]
+defmt = "0.1.0"
+defmt-rtt = "0.1.0"
+panic-probe = { version = "0.1.0", features = ["print-defmt"] }
cortex-m = "0.6.3"
cortex-m-rt = "0.6.12"
- Finally, install
probe-run
version v0.1.4 (or newer)
$ cargo install probe-run -f
Now you can resume working on your project!