クイックスタート
このスキルが解決すること
Windows に M5Stack を接続したのに arduino-cli board list で Unknown と出るときや、開発を始める前に正しいボード設定・書き込みフローを CLI だけで整えたいときに使います。
推奨プロンプト
text
Use $m5stack-arduino-cli to set up my M5Core2 on Windows, attach the correct FQBN, and upload a sample sketch from Arduino CLI.基本フロー
- Windows がシリアルデバイスとして認識しているか確認する
arduino-cliを探す- ESP32 コアを導入する
- 現在の COM ポートを確認する
Unknownを自動識別の限界として扱うべきか判定するM5GFXとM5Unifiedを必要に応じて導入する- スケッチに FQBN とポートを
board attachする - コンパイルして書き込む
重要コマンド
powershell
where.exe arduino-cli
Get-CimInstance Win32_SerialPort | Select-Object DeviceID,Name,Description,PNPDeviceID
Get-PnpDevice -PresentOnly | Where-Object { $_.Class -in @('Ports','USB') } |
Select-Object Class,FriendlyName,Status,InstanceId
arduino-cli board list
arduino-cli core update-index
arduino-cli core install esp32:esp32
arduino-cli lib install M5GFX
arduino-cli lib install M5Unified
arduino-cli board attach -p COM11 -b esp32:esp32:m5stack_core2 .\examples\m5core2\hello
arduino-cli compile .\examples\m5core2\hello
arduino-cli upload -p COM11 .\examples\m5core2\hello同梱ヘルパー
powershell
.\scripts\setup-m5core2.ps1 -SketchPath .\examples\m5core2\hello -Port COM11
.\scripts\upload-m5core2.ps1 -SketchPath .\examples\m5core2\hello -Port COM11SD カード確認用:
powershell
.\scripts\setup-m5core2.ps1 -SketchPath .\examples\m5core2\sd_text_write -Port COM11
.\scripts\upload-m5core2.ps1 -SketchPath .\examples\m5core2\sd_text_write -Port COM11透過アニメーション WebP から取り込んだ猫アニメの例:
powershell
.\scripts\setup-m5core2.ps1 -SketchPath .\examples\m5core2\pixel_pet -Port COM11
.\scripts\upload-m5core2.ps1 -SketchPath .\examples\m5core2\pixel_pet -Port COM11既定値
- M5Core2 の FQBN:
esp32:esp32:m5stack_core2 - よくある USB ブリッジ名:
USB-Enhanced-SERIAL CH9102,Silicon Labs CP210x USB to UART Bridge - よく使うライブラリ:
M5Unified,M5GFX - 既定のサンプルスケッチ:
examples/m5core2/hello/hello.ino - SD カード確認用スケッチ:
examples/m5core2/sd_text_write/sd_text_write.ino - 猫アニメ用スケッチ:
examples/m5core2/pixel_pet/pixel_pet.ino