- ちょっとしたエラーに見舞われた話と、その回避策です
- 鮮度が高かったため、誰かの役に立つかもしれないので投稿します
現在の wio_terminal
crate と周辺状況
-
「基礎から学ぶ組込みRust」をRust 2021で書いてみました with Wio Terminal
- ありがとうございます
本当に助かります
- ありがとうございます
- しかし
2025-04-05
現在、build は通らなかった-
rust-wio-terminal-exercise
- latest commit :
2023-07-28
- latest commit :
-
wio_v0_7_0_reference
- latest commit :
2023-09-25
- この 1 年半あまりの間に、何かが起こった?
- latest commit :
-
rust-wio-terminal-exercise
トラブルの詳細
環境
- Ubuntu 24.04 (
noble
)- apt で install した
cargo
で検討を開始したものの、
同じく apt でrustup
を install すると apt 版のcargo
は消されます - あとは上記の先人の知恵を借り環境を構築しました
- apt で install した
build エラー
-
build エラーの内容
hello_wio$ cargo build --target thumbv7em-none-eabihf warning: no edition set: defaulting to the 2015 edition while the latest is 2024 Compiling wio_terminal v0.7.2 error[E0308]: mismatched types --> /home/user/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/wio_terminal-0.7 .2/src/wifi.rs:142:19 | 142 | ssid: ssid.into(), | ^^^^^^^^^^^ expected `String<64>`, found `String<UInt<UInt<..., ...>, ...>>` | note: two different versions of crate `heapless` are being used; two types coming from two different versions of the same crate are different types even if they look the same
-
ssid.into()
やString<64>
などで検索しても全く分からない
-
-
調べ疲れた後、
note:
の方に注目してみた-
two different versions of crate
heaplessare being used;
-
新しい方の
heapless
を使っている package が更新されてぶつかっている?
-
-
原因調査
-
色々調べて、crate の依存関係は
cargo tree
で確認できることが分かった$ cargo install cargo-tree $ cargo tree hello_wio v0.0.0 (/home/user/works/rust/wio_terminal/hello_wio)c └── wio_terminal v0.3.0 ├── atsamd-hal v0.12.0 │ ├── atsamd51p v0.9.0 │ │ ├── bare-metal v0.2.5 │ │ │ [build-dependencies] │ │ │ └── rustc_version v0.2.3 │ │ │ └── semver v0.9.0 │ │ │ └── semver-parser v0.7.0 │ │ ├── cortex-m v0.6.7 ... ├── generic-array v0.14.7 (*) ├── heapless v0.5.6 │ ├── as-slice v0.1.5 (*) │ ├── generic-array v0.13.3 (*) │ ├── hash32 v0.1.1 │ │ └── byteorder v1.5.0 │ └── stable_deref_trait v1.2.0 ├── ili9341 v0.4.1 ... ├── seeed-erpc v0.1.2 │ ├── bbqueue v0.4.12 (*) │ ├── bitfield v0.13.2 │ ├── bitflags v1.3.2 │ ├── generic-array v0.14.7 (*) │ ├── heapless v0.8.0 │ │ ├── hash32 v0.3.1 │ │ │ └── byteorder v1.5.0 │ │ └── stable_deref_trait v1.2.0 │ ├── no-std-net v0.5.0 │ └── nom v6.2.2 (*) ├── usb-device v0.2.9
-
wio_terminal
がheapless v0.5.6
-
seeed-erpc
がheapless v0.8.0
に依存している
-
-
-
0.1.2
が2025-04-01
にリリースされている
-
-
Cargo.toml
を修正[dependencies] +seeed-erpc = "=0.1.1" wio_terminal = "0.7"
- 結果 :
cargo build
が通った!
- 結果 :
おわりに
- 技術本は寝かさずにさっさととりかかりましょう。
- わずか 4 日の差で…自分のヒキの悪さにびっくりしています