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
780
Matter開発環境をざっくり眺める
ciniml
0
2.5k
組込みRustでも でかい?JSONを扱いたい!
ciniml
3
1.5k
ATOMDisplay_DisplayModule_M5Stack_UG_2023_Tokyo.pdf
ciniml
1
2k
Rusty Stack-chanのすすめ
ciniml
0
830
ベアメタル向けRust stdクレートの実装調査
ciniml
2
870
ESP32でSORACOM Arcつないでみた
ciniml
2
1.5k
RustでCMSIS-DAP実装してみた。
ciniml
3
1.2k
技書博初出展してみた
ciniml
0
540
Other Decks in Programming
See All in Programming
Railsのためのパスキー実践入門 〜マルチテナントSaaSでの意思決定〜
utakaha
3
1k
【加筆修正版】Laravel のアプリケーションをどこにデプロイするか #phpcon_ehime
akase244
0
160
自作Discord音声botをLambda MicroVMsに移行した話 / Migrating My Discord Voice Bot to Lambda MicroVMs
akihisaikeda
0
140
Agentic Software Factoryに、すごく賢いIF文を。 / super smart IF statement into the Agentic Software Factory.
rkaga
8
2.3k
ChromeでローカルLLM
ryu1013
0
160
PumaからFalconに移行したRailsアプリケーションでの実践
falcon8823
0
190
自サークルのIdPからログアウトできるようになるまで
taiseiue
1
140
Domain-Driven Transformation
hschwentner
2
2.3k
Web Framework Benchmark Battle 2026, Any%
a_matsuda
2
2.7k
Long Living Tokens, Die, Die, Die! (or: The One Ring is Banned in Modern)
sylph01
0
350
Jetpack Compose Mechanisms
skydoves
3
840
當我們開始不讀 Code - AI Agent 時代,Code Review 與 Clean Code 還剩下什麼?
jame2408
1
290
Featured
See All Featured
The World Runs on Bad Software
bkeepers
PRO
72
12k
Done Done
chrislema
187
17k
Building the Perfect Custom Keyboard
takai
2
910
Agile Actions for Facilitating Distributed Teams - ADO2019
mkilby
0
310
How to Align SEO within the Product Triangle To Get Buy-In & Support - #RIMC
aleyda
2
1.8k
How to Get Subject Matter Experts Bought In and Actively Contributing to SEO & PR Initiatives.
livdayseo
0
220
A better future with KSS
kneath
240
18k
Getting science done with accelerated Python computing platforms
jacobtomlinson
2
540
Raft: Consensus for Rubyists
vanstee
142
7.8k
Chasing Engaging Ingredients in Design
codingconduct
0
370
YesSQL, Process and Tooling at Scale
rocio
174
15k
From Legacy to Launchpad: Building Startup-Ready Communities
dugsong
0
360
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