From 1aac949a44b301599a5171d29b4a82d97f3c738c Mon Sep 17 00:00:00 2001 From: Jorge Aparicio Date: Thu, 12 Nov 2020 13:51:46 +0100 Subject: [PATCH] document how to switch to the git version of defmt --- Cargo.toml | 5 +++++ README.md | 38 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+) diff --git a/Cargo.toml b/Cargo.toml index c29a39a..5bfde87 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -48,3 +48,8 @@ incremental = false lto = 'fat' opt-level = 3 # <- overflow-checks = false # <- + +# [patch.crates-io] +# defmt = { git = "https://github.com/knurling-rs/defmt", rev = "use defmt version reported by `probe-run --version`" } +# defmt-rtt = { git = "https://github.com/knurling-rs/defmt", rev = "use defmt version reported by `probe-run --version`" } +# panic-probe = { git = "https://github.com/knurling-rs/defmt", rev = "use defmt version reported by `probe-run --version`" } \ No newline at end of file diff --git a/README.md b/README.md index a1e72a4..f8ad2fb 100644 --- a/README.md +++ b/README.md @@ -131,6 +131,44 @@ $ echo $? 0 ``` +## Trying out the git version of defmt + +This template is configured to use the latest crates.io release (the "stable" release) of the `defmt` framework. +To use the git version (the "development" version) of `defmt` follow these steps: + +1. Install the *git* version of `probe-run` + +``` console +$ cargo install --git https://github.com/knurling-rs/probe-run --branch main +``` + +2. Check which defmt version `probe-run` supports + +``` console +$ probe-run --version +probe-run 0.1.4 (3521a42 2020-11-12) +supported defmt version: 3db6b41f08a5c866e6d6ed7103d01b0b0fe5a1f4 +``` + +In the example output, the supported version is `3db6b41f08a5c866e6d6ed7103d01b0b0fe5a1f4` + +3. Switch defmt dependencies to git: uncomment the last part of the root `Cargo.toml` and enter the hash reported by `probe-run --version`: + +``` diff +-# [patch.crates-io] +-# defmt = { git = "https://github.com/knurling-rs/defmt", rev = "use defmt version reported by `probe-run --version`" } +-# defmt-rtt = { git = "https://github.com/knurling-rs/defmt", rev = "use defmt version reported by `probe-run --version`" } +-# panic-probe = { git = "https://github.com/knurling-rs/defmt", rev = "use defmt version reported by `probe-run --version`" } ++[patch.crates-io] ++defmt = { git = "https://github.com/knurling-rs/defmt", rev = "3db6b41f08a5c866e6d6ed7103d01b0b0fe5a1f4" } ++defmt-rtt = { git = "https://github.com/knurling-rs/defmt", rev = "3db6b41f08a5c866e6d6ed7103d01b0b0fe5a1f4" } ++panic-probe = { git = "https://github.com/knurling-rs/defmt", rev = "3db6b41f08a5c866e6d6ed7103d01b0b0fe5a1f4" } +``` + +You are now using the git version of `defmt`! + +**NOTE** there may have been breaking changes between the crates.io version and the git version; you'll need to fix those in the source code. + ## Support `app-template` is part of the [Knurling] project, [Ferrous Systems]' effort at