LoginSignup
0
0

More than 5 years have passed since last update.

ESP32の開発環境を準備する

Last updated at Posted at 2019-03-15

ESP32の開発環境を準備

https://docs.espressif.com/projects/esp-idf/en/latest/get-started/
このドキュメントに沿って準備するだけだけど、さくっといかなかったのでメモ。

1.ツールチェーンを設定する

pipをインストール

sudo easy_install pip

ファイルをダウンロード

mkdir -p ~/esp
cd ~/esp
tar -xzf ~/Downloads/xtensa-esp32-elf-osx-1.22.0-80-g6c4433a-5.2.0.tar.gz

PATHの設定

cd
vi .bash_profile

以下を追記。一番下だとうまくいかなかったけど、書く場所を変えてみたら成功した

export PATH=$HOME/esp/xtensa-esp32-elf/bin:$PATH

2. ESP-IDFを入手

cd ~/esp
git clone --recursive https://github.com/espressif/esp-idf.git

3.環境変数を設定

1.と同じように、以下を.bash_profileに追記

export IDF_PATH=~/esp/esp-idf

4.必要なPythonパッケージをインストール

python -m pip install --user -r $IDF_PATH/requirements.txt

5.プロジェクトを始める

cd ~/esp
cp -r $IDF_PATH/examples/get-started/hello_world .

6.デバイスを接続

ドライバをインストール
https://www.silabs.com/products/development-tools/software/usb-to-uart-bridge-vcp-drivers

ls /dev/tty.* 

一覧にtty.SLAB_USBtoUARTが見えていることを確認

7.設定

cd ~/esp/hello_world
make menuconfig

スクリーンショット 2019-03-15 17.25.47.png
Serial flasher configDefault serial port/dev/tty.SLAB_USBtoUARTを入力

8.ビルドとフラッシュ

make flash

9.モニター

make monitorで実行されているか確認

Hello world!
This is ESP32 chip with 2 CPU cores, WiFi/BT/BLE, silicon revision 1, 4MB external flash
Restarting in 10 seconds...
Restarting in 9 seconds...
Restarting in 8 seconds...
Restarting in 7 seconds...
Restarting in 6 seconds...
Restarting in 5 seconds...
Restarting in 4 seconds...
Restarting in 3 seconds...
Restarting in 2 seconds...
Restarting in 1 seconds...
Restarting in 0 seconds...
Restarting now.

Ctrl+]で確認を終了

開発環境の準備完了です\(^o^)/

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