0
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?

M5StampS3をplatform.ioで開発する際にハマったこと

Posted at

簡単なメモですが記しておきます。

普通にプロジェクト作成してもビルドできない

症状

PIO Homeからボード「M5StampS3」を選んでプロジェクトを作成し、簡単なプログラムをビルドすると以下のようなエラーが出ることがありました。

error: 'SCK' was not declared in this scope
error: 'MISO' was not declared in this scope
error: 'MOSI' was not declared in this scope
error: 'SS' was not declared in this scope

対処方法その1

この記事 に対処方法がありました。
platformio.iniファイルに以下を追記します。

platformio.ini
platform_packages =
    framework-arduinoespressif32@https://github.com/espressif/arduino-esp32/archive/refs/tags/2.0.14.zip

対処方法その2

こちらの記事 に別の対処方法がありました。
platformio.iniファイルに以下を追記します。

platformio.ini
platform = espressif32@6.9.0

GitHubに依存しない分、こちらの方法の方が良い気がします。

おまけ: 2025/2/16 再現しなくなった

メモしておいたのを記事に書こうと、platformio.iniをデフォルトに戻したのですが、なぜか問題なくビルドできるようになってしまいました。環境が残ってしまっているような気がします。また再現したときのために記事は書いておくことにします。

デフォルトのplatformio.ini
[env:m5stack-stamps3]
platform = espressif32
board = m5stack-stamps3
framework = arduino

USBシリアルに出力されない

症状

Serial.println("Hello"); としても、USBシリアルに出力されていませんでした。

対処方法

こちらの記事 に対策がありました。
platformio.iniに下記を追加します。

platformio.ini
build_flags =
    -DARDUINO_USB_CDC_ON_BOOT=1

こうすると無事USBシリアルに出力されるようになりました。

0
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
0
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?