Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Raspberry Pi Picoデバッガ使用のすすめ
Search
Kenta IDA
May 28, 2022
Programming
2.3k
0
Share
Raspberry Pi Picoデバッガ使用のすすめ
トラ技オフ会 2022/05/28 での発表資料です。
Kenta IDA
May 28, 2022
More Decks by Kenta IDA
See All by Kenta IDA
日本の家電とMatterの世界
ciniml
0
550
Matter開発環境をざっくり眺める
ciniml
0
2.3k
組込みRustでも でかい?JSONを扱いたい!
ciniml
3
1.5k
ATOMDisplay_DisplayModule_M5Stack_UG_2023_Tokyo.pdf
ciniml
1
1.9k
Rusty Stack-chanのすすめ
ciniml
0
760
ベアメタル向けRust stdクレートの実装調査
ciniml
2
840
ESP32でSORACOM Arcつないでみた
ciniml
2
1.4k
RustでCMSIS-DAP実装してみた。
ciniml
3
1.1k
技書博初出展してみた
ciniml
0
480
Other Decks in Programming
See All in Programming
AI駆動開発で崩れていくコードベースを立て直す
kyoko_nr_nr
1
440
3Dシーンの圧縮
fadis
1
650
Lessons from Spec-Driven Development
simas
PRO
0
140
ユニットテストの先へ:テスト技法で要求・仕様を整理するJava開発実践 / Beyond_Unit_Testing_Practical_Java_Development_Techniques_for_Organizing_Requirements_and_Specifications
shimashima35
0
350
Make SRE Operations Easier with Azure SRE Agent
kkamegawa
0
4k
DynamoDBには集計系のクエリがないけどなんとかしたい
musan
1
130
Datadog × OpenTelemetry 入門と実践のあいだ
kn_to_maxpno
1
140
ビジネスモデルから紐解く、AI+型駆動開発
hirokiomote
2
5.2k
jQueryをバージョンアップする前に使いたいjQuery Migrate
matsuo_atsushi
0
190
Stage 3 Decorators でできること / できないこと / TSKaigi 2026
susisu
1
1.5k
LLM Plugin for Node-REDの利用方法と開発について
404background
0
160
Why Laravel apps break—Mastering the fundamentals to keep them maintainable
kentaroutakeda
1
340
Featured
See All Featured
Building a Modern Day E-commerce SEO Strategy
aleyda
45
9.1k
Balancing Empowerment & Direction
lara
6
1.1k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
250
1.3M
Jess Joyce - The Pitfalls of Following Frameworks
techseoconnect
PRO
1
160
How People are Using Generative and Agentic AI to Supercharge Their Products, Projects, Services and Value Streams Today
helenjbeal
1
200
Deep Space Network (abreviated)
tonyrice
0
160
世界の人気アプリ100個を分析して見えたペイウォール設計の心得
akihiro_kokubo
PRO
71
40k
Building Applications with DynamoDB
mza
96
7.1k
Optimizing for Happiness
mojombo
378
71k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
49
10k
Why Mistakes Are the Best Teachers: Turning Failure into a Pathway for Growth
auna
0
150
Leveraging LLMs for student feedback in introductory data science courses - posit::conf(2025)
minecr
1
280
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