CLionでのesp32開発に必要な環境整備
いろいろハマった(♦)のでメモを残したいと思います。
開発ボードを用意する
- USB に差し込んで、
/dev
の下にusbmodem
やUSBtoUART
などの名前が出ているか確認します。 - 表示がなければ、ドライバーがインストールされてない可能性があります。SILABSのチップが乗っているかどうか確認します。
- SILABSのチップがある場合、Silicon Labs のダウンロードページ から適宜にダウンロードし、インストールします。
- 再度USBに差し込んで、
/dev/cu.SLAB_USBtoUART
があると確認します。
PlatformIO Core をインストールする
必ず homebrew 経由でインストールします。
brew install platformio
PlatformIO 本家のインストール指示に従うと、インストールされるPlatformIO Coreがうまく認識されません♦。
インストールが終わったあと確認します。
$ which platformio
/usr/local/bin/platformio
Platformio プラグインを整備する
- CLionの設定画面(
⌘
+,
)を開き、左側からPlugins
を選びます。 - platformio で検索してインストールします(iniというプラグインが必要です。聞かれたら、合わせてインストールします)。
- CLionを再起動します
- 再起動した後、再び設定画面を開きます。
- 左側から
Languages & Frameworks
>PlatformIO
を選びます。 - platformio のインストール場所
/usr/local/bin/platformio
を入力します。
プロジェクトを作成しビルドする
- メニューから
File
>New Project
を選びます。 - 左側から
PlatformIO
を選びます。 -
Espressif
>Espressif ESP32 Dev Module
>espidf
を選びます(お持ちのボードに応じて適宜に選んでください) - [Create] を押します。
プロジェクト作成に5分ぐらい時間がかかります。作成終了後
src/main.c
が作成されます -
platformio.ini
を修正します。-
platform = [email protected]
(♦重要。新しい espidf は使えません) -
upload_port = /dev/cu.SLAB_USBtoUART
(Windowsの場合はCOMnn
です)
-
platformio.ini 例
; PlatformIO Project Configuration File
;
; Build options: build flags, source filter
; Upload options: custom upload port, speed and extra flags
; Library options: dependencies, extra library storages
; Advanced options: extra scripting
;
; Please visit documentation for the other options and examples
; https://docs.platformio.org/page/projectconf.html
[env:esp32dev]
platform = [email protected]
board = esp32dev
framework = espidf
src_dir = src
upload_port = /dev/cu.SLAB_USBtoUART
ツールバーの「🔨ビルド」ボタンを押してビルドを開始します。
以上
Author And Source
この問題について(CLionでのesp32開発に必要な環境整備), 我々は、より多くの情報をここで見つけました https://qiita.com/cocoamatic/items/db3982065d3ad6bbf983著者帰属:元の著者の情報は、元のURLに含まれています。著作権は原作者に属する。
Content is automatically searched and collected through network algorithms . If there is a violation . Please contact us . We will adjust (correct author information ,or delete content ) as soon as possible .