Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

git defmt から安定版 defmt への移行

2020-11-11 より前にこの本に取り組み始めた人は、defmt ロギングフレームワークの不安定な git 版を使用しています。 2020-11-11 に、defmt の安定版が crates.io で利用可能になりました。 まだ git 版を使っている場合は、crates.io 版へ移行することをお勧めします! 方法は次のとおりです:

  1. app-template プロジェクトで、ルートの Cargo.toml を以下のように変更します:
 [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"
  1. app-template プロジェクトで、testsuite/Cargo.toml も以下のように変更します:
 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"
-# より完全なテスト出力のために `print-defmt` フィーチャーを有効にする
-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"
  1. 最後に、probe-run バージョン v0.1.4(またはそれ以降)をインストールします
$ cargo install probe-run -f

これでプロジェクトでの作業を再開できます!