Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Raspberry Pi Picoデバッガ使用のすすめ
Search
Kenta IDA
May 28, 2022
Programming
2.4k
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Raspberry Pi Picoデバッガ使用のすすめ
トラ技オフ会 2022/05/28 での発表資料です。
Kenta IDA
May 28, 2022
More Decks by Kenta IDA
See All by Kenta IDA
日本の家電とMatterの世界
ciniml
0
720
Matter開発環境をざっくり眺める
ciniml
0
2.4k
組込みRustでも でかい?JSONを扱いたい!
ciniml
3
1.5k
ATOMDisplay_DisplayModule_M5Stack_UG_2023_Tokyo.pdf
ciniml
1
1.9k
Rusty Stack-chanのすすめ
ciniml
0
810
ベアメタル向けRust stdクレートの実装調査
ciniml
2
860
ESP32でSORACOM Arcつないでみた
ciniml
2
1.5k
RustでCMSIS-DAP実装してみた。
ciniml
3
1.2k
技書博初出展してみた
ciniml
0
520
Other Decks in Programming
See All in Programming
数年滞っていたダークモード対応をおよそ2週間で完了させる
chigichan24
0
720
C#の現在地 進化の歴史と、AI時代の.NET Everywhere
neuecc
4
2.3k
{ Android | Kotlin } Gradle Plugin in 2026
ryunen344
1
320
GKE で Pod の見方を変えたら、スケールアウト時の挙動を真に捉えられた話
stkk
0
130
テストを司るデーモンに会いに行く 〜隔離した仮想マシンでテストを通すまで〜
h1d3mun3
1
440
標準パッケージに uuid が追加された 背景から見る Go らしい意思決定 / go_127_uuid_decision
convto
5
7.3k
MVNOの申込からeSIM開通までをiOSアプリでつなぐ- 本人確認・MNP・通信事業者基盤をまたぐ実装
satotakeshi
0
430
マイコン向けの軽量Ruby「PicoRuby」で各種デバイスを制御するネイティブアプリの実現手法
bash0c7
0
410
一人だけ、Kiroが静止する日
hideg
0
110
AI活用は、個人から組織へ|マルチプレイヤーエージェントハーネス「QM」の社内活用事例 / AI use is moving from individuals to orgs
rkaga
1
110
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
130
Are APIs Still Relevant in the AI Era?
soyuka
0
250
Featured
See All Featured
Making the Leap to Tech Lead
cromwellryan
135
10k
Designing for Timeless Needs
cassininazir
1
480
XXLCSS - How to scale CSS and keep your sanity
sugarenia
250
1.3M
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
23k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
508
140k
The untapped power of vector embeddings
frankvandijk
2
1.9k
How GitHub (no longer) Works
holman
316
150k
JAMstack: Web Apps at Ludicrous Speed - All Things Open 2022
reverentgeek
1
600
Money Talks: Using Revenue to Get Sh*t Done
nikkihalliwell
0
500
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
28
3.6k
So, you think you're a good person
axbom
PRO
2
2.2k
The Curious Case for Waylosing
cassininazir
1
510
Transcript
Raspberry Pi Pico デバッガ使用のすすめ トラ技オンライン・オフ会 2022/05/28 Kenta Ida (@ciniml)
自己紹介 •井田 健太 (@ciniml) •仕事:FPGAの論理設計 •使用言語:C++, SystemVerilog, Rust, C# •組込みRust本の1割くらい書きました
(サンプルアプリ作ったり、デバッガ試したり)→ 2022/5/28 Raspberry Pi Picoデバッガ使用のすすめ 2
Raspberry Pi Picoの開発環境 2022/5/28 Raspberry Pi Picoデバッガ使用のすすめ •Pico C/C++ SDK
•MicroPython •CircuitPython •今回はPico C/C++ SDK前提の話をします 3
マイコンのプログラムのデバッグ方法 2022/5/28 Raspberry Pi Picoデバッガ使用のすすめ •UART等でprintfデバッグ • 一番単純な方法だが、プログラム止めたりできない •デバッガ (gdb)
• PCのプログラム同様に停止、変数の内容確認が可能 • VSCodeによるグラフィカルな環境もある • そんなに環境整備コワクナイヨー 4
RPi PicoでGDBを使うのに必要なもの 2022/5/28 Raspberry Pi Picoデバッガ使用のすすめ •RPi Pico2枚 • 目的のプログラムを動かす用
• PCとPicoのデバッグ通信用 (picoprobe) •RPi Picoを買うときは3枚買おう • 目的プログラム用 • 壊れたとき用 (GPIO速攻で壊したので) • デバッガ (picoprobe) 用 5
デバッガ使用手順 2022/5/28 Raspberry Pi Picoデバッガ使用のすすめ •実は公式ドキュメント (PicoのGetting Started)に記載 • https://datasheets.raspberrypi.com/pico/getting-started-with-
pico.pdf • 英語だけどしっかり書いてあるので 一度読んでるのをお勧めします • もともとRPiは教育用なのでこの辺しっかりしてる •インターフェース 2021年8月号にも記載 • (大分前だけど) 書いたので買ってね! https://interface.cqpub.co.jp/magazine/202108/ 6
環境構築1 2022/5/28 Raspberry Pi Picoデバッガ使用のすすめ •Mac --- 持ってないのでよくわからないです •Linux (Ubuntu)
• たぶん一番簡単 • Linux使ってる人はGetting Started読めると思うのでガンバレ 7
環境構築2 2022/5/28 Raspberry Pi Picoデバッガ使用のすすめ •Windows • WSL上での環境構築がおすすめ • WSL
- Windows上でLinux環境を動かせる便利なやつ (Win標準機能) • 公式手順 (Windows ネイティブでの環境構築)はハマりどころ満載 • Visual Studioのビルドツール入れろとか書いてるけど大体ハマる • WindowsのCMakeも大体ハマる • WindowsのPythonも大体 (以下略 • WSLのUbuntuを入れてしまえばあとは公式手順(ほぼ)そのまま 8
よくある?質問 2022/5/28 Raspberry Pi Picoデバッガ使用のすすめ •WSLだとUSBデバイス使えないんじゃないの? • WSL自体はUSB使えないけど対策アリ • a.
WSLでUSBを使えるようにする (usbipd等) • TCP/IP経由でUSB通信を中継する機能 • 現状標準で動かなくて設定いろいろ大変なので微妙 • b. USB必要な部分だけWindowsで動かす 9
WSLの利点 2022/5/28 Raspberry Pi Picoデバッガ使用のすすめ •Windowsとのファイル共有が容易 • WSL側で explorer.exe .
とか実行すると、 カレントディレクトリがエクスプローラで開く •Windows側のexeを直接立ち上げることができる • .exeをつけてあげるといい 10
ボードの接続 2022/5/28 Raspberry Pi Picoデバッガ使用のすすめ •普段使わないボード下端の ピンとpicoprobeを接続 • SWDの信号 •
SWCLK - クロック信号 • SWDIO - データ信号 • GND 11
デバッグ環境の構成 2022/5/28 Raspberry Pi Picoデバッガ使用のすすめ •WSL2上のUbuntuで開発ツールを動かす • gcc, CMake, python
• Pico C/C++ SDK • GDB •picoprobeと通信するOpenOCDは Windowsで動かす • USB通信のため WSL上では動かせない 12
デバッグ中の画面 2022/5/28 Raspberry Pi Picoデバッガ使用のすすめ 13
デバッグ中の画面 2022/5/28 Raspberry Pi Picoデバッガ使用のすすめ •PC上のソフトウェアのデバッグ時と遜色ない機能 • 変数の内容表示 • コールスタック
• ブレークポイント • ソースコード表示 •便利なので有効活用しよう 14
余談 2022/5/28 Raspberry Pi Picoデバッガ使用のすすめ •rust-dap開発中(https://github.com/ciniml/rust-dap) • Rust (プログラミング言語) で実装したCMSIS-DAP
• picoprobeの代わりになるファームウェア •RP2040は組込みRust入門にも最適 • 結構環境整備されてきた •Rustたのしいよ 15
おしまい 2022/5/28 Raspberry Pi Picoデバッガ使用のすすめ 16