0
(0)

先日、似たようなタイトルで blog エントリしました。
[ICT] ESP-IDF v4.1 / Tools 2.3 インストール (Windows 64-bit)して、example プロジェクトをビルド確認する手順例。

そこでは ESP-IDF v4.1 でしたが、 v4.2 新機能によるESP32-S3 Dual Core (XTensa LX7 MCU) による AIoT (AI IoT) プロジェクトビルドしたい方がおられる場合には環境の作り直しが発生するので、新たに blog 記事を作成しました。

また、ESP-IDF / Tools は複数バージョンを PATH 指定により1台の PC に持てるので(v4.1 で開発中のプロジェクトがある私向け)、インストール時にパスを明示的に区別すれば大丈夫です。
// 世の中には「開発エディションごとの仮想環境」を作るリソース消費する方もいるとか、いないとかw

ESP32-S3 について

概要:AIoT 市場ニーズに対応するよう特別に設計された ESP32-S3 は、XTensa LX7 MCU での 240MHzでの実行が可能です。 512 KBの内部SRAMの他に、統合された2.4 GHz、802.11 b / g / n Wi-Fi、および Bluetooth-Low-Energy 5.0 接続が付属しており、長距離サポートを提供します。 44のプログラム可能なGPIOがあり、豊富な周辺機器のセットをサポートしています。 ESP32と比較して、より大きな高速オクタルSPIフラッシュ、および構成可能なデータと命令キャッシュを備えたPSRAMをサポートします。

オフィシャル記事はこちら:
Announcing ESP32-S3 for AIoT Applications
https://www.espressif.com/en/news/ESP32_S3

ESP32-S3 対応 ESP-IDF v4.2 / Tools 2.3 インストール (Windows 64-bit)手順

★インストーラ入手先:
https://docs.espressif.com/projects/esp-idf/en/latest/esp32/get-started/windows-setup.html#get-started-windows-tools-installer

Python / Anaconda 環境をお持ちの方は python.exe が存在するPATH の選択または、Python 3.7 インスール可能です。ここでは既に導入済み Python 3.8 (64-bit) を指定しました。ESP-IDF は release/v4.2 (relase branch)をあとで指定します。


★ESP-IDF リリースバージョンと ESP-IDF Tools バージョンは異なるので、混乱しないように★

バージョンについて:
https://docs.espressif.com/projects/esp-idf/en/latest/esp32/versions.html

インストール直前の指定内容の確認

Python 3.8 と Git 2.30.0.windows.1 はESP-IDF 4.1 環境構築時と同じパス。
今回は ESP-IDF v4.1 を残したまま、新たに v4.2 をインストールするため明示的にインストールパスを分けました。

ESP-IDF tools インストール完了時のコマンドプロンプト(コンソール)画面

install.bat と export.bat を実行します。

コマンドプロンプト(コンソール)に次の文言が表示されれば、ESP-IDF プロジェクトをコンパイルできます。

Checking if Python packages are up to date…
Python requirements from D:\espidf42\requirements.txt are satisfied.

Done! You can now compile ESP-IDF projects.
Go to the project directory and run:

idf.py build

idf.py について

cmake (make) コマンドでもビルドできますが、ESP では idf.py 使用推奨されていますが、df.py を使うことでプロジェクトビルド時に menuconfig 使用可能です。これは、Espressif IoT Development Framework Configuration のことで、これからビルドする bin ファイル環境を定義できます。

ここで定義した環境は、プロジェクトディレクトリルートの sdkconfig (ファイルサイズ 30KB ~ 40KB )に格納されます。

自動生成される sdkconfig 例 (ファイルサイズ 30KB – 40KB の一部)
エディタ等で直接編集は厳禁です。

menuconfig によってビルドターゲットは ESP32 または ESP32S3 です。
この例では “esp32” が L.6 にて定義されます。また、商業用ではファームウェアチップ ID を明示的に指定するでしょう。その場合は L.8 へ出力されるので、開発チームは組織内の開発指針に沿って適切にビルド管理してください。

idf.py 引数一覧

皆さんも idf.py (引数付けずに)実行すると出力されますよ。

d:>idf.py
Usage: idf.py [OPTIONS] COMMAND1 [ARGS]… [COMMAND2 [ARGS]…]…

ESP-IDF CLI build management tool. For commands that are not known to idf.py an attempt to execute it as a build system
target will be made.

Options:
–version Show IDF version and exit.
–list-targets Print list of supported targets and exit.
-C, –project-dir PATH Project directory.
-B, –build-dir PATH Build directory.
-w, –cmake-warn-uninitialized / -n, –no-warnings
Enable CMake uninitialized variable warnings for CMake files inside the project directory.
(–no-warnings is now the default, and doesn’t need to be specified.)

-v, –verbose Verbose build output.
–ccache / –no-ccache Use ccache in build. Disabled by default, unless IDF_CCACHE_ENABLE environment variable is set
to a non-zero value.

-G, –generator [Ninja|MinGW Makefiles]
CMake generator.
-D, –define-cache-entry TEXT Create a cmake cache entry. This option can be used at most once either globally, or for one
subcommand.

-b, –baud INTEGER Baud rate for flashing. The default value can be set with the ESPBAUD environment variable.
This option can be used at most once either globally, or for one subcommand.

-p, –port TEXT Serial port. The default value can be set with the ESPPORT environment variable. This option
can be used at most once either globally, or for one subcommand.

–help Show this message and exit.

Commands:
all Aliases: build. Build the project.
app Build only the app.
app-flash Flash the app only.
bootloader Build only bootloader.
bootloader-flash Flash bootloader only.
clean Delete build output files from the build directory.
confserver Run JSON configuration server.
efuse_common_table Generate C-source for IDF’s eFuse fields.
efuse_custom_table Generate C-source for user’s eFuse fields.
encrypted-app-flash Flash the encrypted app only.
encrypted-flash Flash the encrypted project.
erase_flash Erase entire flash chip.
erase_otadata Erase otadata partition.
flash Flash the project.
fullclean Delete the entire build directory contents.
gdb Run the GDB.
gdbgui GDB UI in default browser.
gdbtui GDB TUI mode.
menuconfig Run “menuconfig” project configuration tool.
monitor Display serial output.
openocd Run openocd from current path
partition_table Build only partition table.
partition_table-flash Flash partition table only.
post_debug Utility target to read the output of async debug action and stop them.
python-clean Delete generated Python byte code from the IDF directory
read_otadata Read otadata partition.
reconfigure Re-run CMake.
set-target Set the chip target to build.
show_efuse_table Print eFuse table.
size Print basic size information about the app.
size-components Print per-component size information.
size-files Print per-source-file size information.

以上、ご覧いただき有難うございました。

How useful was this post?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate this post.

投稿者 斉藤之雄 (Yukio Saito)

Global Information and Communication Technology OTAKU / Sports volunteer / Social Services / Master of Technology in Innovation for Design and Engineering, AIIT / BA, Social Welfare, NFU / twitter@yukio_saitoh