1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

「基礎から学ぶ組込み Rust」 (Wio Terminal) @ 2025-04

Last updated at Posted at 2025-04-13
  • ちょっとしたエラーに見舞われた話と、その回避策です
    • 鮮度が高かったため、誰かの役に立つかもしれないので投稿します

現在の wio_terminal crate と周辺状況

トラブルの詳細

環境

  • Ubuntu 24.04 (noble)
    • apt で install した cargo で検討を開始したものの、
      同じく apt で rustup を install すると apt 版の cargo は消されます
    • あとは上記の先人の知恵を借り環境を構築しました

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 heapless are being used;
      • :arrow_right: 新しい方の 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_terminalheapless v0.5.6
    • seeed-erpcheapless v0.8.0 に依存している
       
  • crates.io : seeed-erpc

    • 0.1.22025-04-01 にリリースされている
       
  • Cargo.toml を修正

      [dependencies]
     +seeed-erpc = "=0.1.1"
      wio_terminal = "0.7"
    
    • 結果 : cargo build が通った!

おわりに

  • 技術本は寝かさずにさっさととりかかりましょう。
    • わずか 4 日の差で…自分のヒキの悪さにびっくりしています
1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?