EasyManuals Logo

Espressif Systems ESP User Manual

Default Icon
191 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #33 background imageLoading...
Page #33 background image
Chapter 2. Development environment
2.3.7 Errors occurred when using idf.menucong and idf.build after updating the ESP-
IDF version from v3.3 to the latest one:
Rebuild the environment following Get Started.
Remove build directory build and con󰝘guration 󰝘le sdkconfig under the hello_world directory.
2.3.8 How to congure PATH and IDF_PATH when developing ESP32 and ESP8266 si-
multaneously?
For PATH, there is no need to do extra con󰝘gurations. You can put them together as: export PATH=
$HOME/esp/xtensa-esp32-elf/bin:$HOME/esp/xtensa-lx106-elf/bin:$PATH.
For IDF_PATH, you can specify it for separate chips as:
In ESP32 related projects, use IDF_PATH = $(HOME)/esp/esp-idf. In ESP8266 related projects,
use IDF_PATH = $(HOME)/esp/ESP8266_RTOS_SDK.
2.3.9 Do I need to use command idf.py set-target every time when switching to
another project?
When building the project with idf.py build, the target is determined as follows:
1. If the build directory build already exists, the system will use the target the project was previously
built for. It is stored in CMakeCache.txt 󰝘le in the build directory.
2. Alternatively, if the build directory doesnt exist, the system will check if the sdkconfig 󰝘le
exists, and use the target speci󰝘ed there.
3. If both the build directory and sdkconfig 󰝘le exist with di󰝗erent targets speci󰝘ed, the system
will report an error. This shouldnt happen normally, unless sdkconfig was changed manually
without deleting the build directory.
4. If neither sdkconfig 󰝘le nor build directory exists, it can be considered to use IDF_TARGET
to set the target as a CMake variable or environment variable. If this variable is set and is di󰝗erent
from the target speci󰝘ed in sdkconfig or in the build directory, the system will also report an
error.
5. Finally, if sdkconfig doesnt exist, build directory doesnt exist, and the target is not set
via IDF_TARGET, then the system will use the default value. The default value can be set in
sdkconfig.defaults.
6. If the target isnt set using any of the above methods, then the system will build for ESP32 target.
To answer your question:
idf.py set-target stores the selected target in the projects build directory and sdkcon-
fig 󰝘le, not in the terminal environment. So, once the project is con󰝘gured and built once for
a certain target, if you switch to a di󰝗erent directory and build another project, then come back,
the target will not change, and will be the same as previously set for this project. And its not
necessary to run idf.py set-target again other than to switch to a di󰝗erent target.
If you want to make the project built for certain target by default, add CON-
FIG_IDF_TARGET="esp32s2" to the sdkconfig.defaults 󰝘le of the project.
After this, if sdkconfig 󰝘le doesnt exist and build directory doesnt exist, idf.py build
command will build for that target speci󰝘ed in sdkconfig.defaults.
idf.py set-target command can still be used to override the default target set in sdkcon-
fig.defaults.
Espressif Systems 16
Submit Document Feedback
Release master

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Espressif Systems ESP and is the answer not in the manual?

Espressif Systems ESP Specifications

General IconGeneral
BrandEspressif Systems
ModelESP
CategoryMotherboard
LanguageEnglish