EasyManuals Logo

Espressif ESP32-S2 User Manual

Espressif ESP32-S2
1695 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 #1484 background imageLoading...
Page #1484 background image
Chapter 4. API Guides
Building a project with CMake In the project directory, run:
docker run --rm -v $PWD:/project -w /project espressif/idf idf.py build
The above command explained:
docker run: runs a Docker image. It is a shorter form of the command docker container run.
--rm: removes the container when the build is finished
-v $PWD:/project: mounts the current directory on the host ($PWD) as /project directory in the
container
espressif/idf: uses Docker image espressif/idf with tag latest (implicitly added by Docker
when no tag is specified)
idf.py build: runs this command inside the container
To build with a specific docker image tag, specify it as espressif/idf:TAG, for example:
docker run --rm -v $PWD:/project -w /project espressif/idf:release-v4.0 idf.py
,build
You can check the up-to-date list of available tags at https://hub.docker.com/r/espressif/idf/tags.
Building a project with GNU Make Same as for CMake, except that the build command is different:
docker run --rm -v $PWD:/project -w /project espressif/idf make defconfig all -j4
Note: If the sdkconfig file does not exist, the default behavior of GNU Make build system is to open the
menuconfig UI. This may be not desired in automated build environments. To ensure that the sdkconfig file
exists, defconfig target is added before all.
If you intend to build the same project repeatedly, you may bind the tools/kconfig directory of ESP-IDF to a
named volume. This will prevent Kconfig tools, located in ESP-IDF directory, from being rebuilt, causing a rebuild
of the rest of the project:
docker run --rm -v $PWD:/project -v kconfig:/opt/esp/idf/tools/kconfig -w /project
,espressif/idf make defconfig all -j4
If you need clean up the kconfig volume, run docker volume rm kconfig.
Binding the tools/kconfig directory to a volume is not necessary when using the CMake build system.
Using the image interactively It is also possible to do builds interactively, to debug build issues or test the auto-
mated build scripts. Start the container with -i -t flags:
docker run --rm -v $PWD:/project -w /project -it espressif/idf
Then inside the container, use idf.py as usual:
idf.py menuconfig
idf.py build
Note: Commands which communicate with the development board, such as idf.py flash and idf.py mon-
itor will not work in the container unless the serial port is passed through into the container. However currently
this is not possible with Docker for Windows (https://github.com/docker/for-win/issues/1018) and Docker for Mac
(https://github.com/docker/for-mac/issues/900).
Espressif Systems 1473
Submit Document Feedback
Release v4.4

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Espressif ESP32-S2 and is the answer not in the manual?

Espressif ESP32-S2 Specifications

General IconGeneral
BrandEspressif
ModelESP32-S2
CategorySingle board computers
LanguageEnglish