Building The Bootloader; Selecting The Target - Espressif ESP32-S2 Programming Manual

Hide thumbs Also See for ESP32-S2:
Table of Contents

Advertisement

Chapter 4. API Guides
• flash_bootloader_args contains arguments to flash only the bootloader.
You can pass any of these flasher argument files to esptool.py as follows:
python esptool.py --chip esp32 write_flash @build/flash_project_args
Alternatively, it is possible to manually copy the parameters from the argument file and pass them on the command
line.
The build directory also contains a generated file flasher_args.json which contains project flash information,
in JSON format. This file is used by idf.py and can also be used by other tools which need information about the
project build.

4.4.15 Building the Bootloader

The bootloader is built by default as part of idf.py build, or can be built standalone via idf.py boot-
loader.
The bootloader is a special "subproject"inside /components/bootloader/subproject. It has its own project CMake-
Lists.txt file and builds separate .ELF and .BIN files to the main project. However it shares its configuration and build
directory with the main project.
The subproject is inserted as an external project from the top-level project, by the file
nents/bootloader/project_include.cmake. The main build process runs CMake for the subproject, which includes
discovering components (a subset of the main components) and generating a bootloader-specific config (derived
from the main sdkconfig).

4.4.16 Selecting the Target

ESP-IDF supports multiple targets (chips). A full list of supported targets in your version if ESP-IDF can be seen by
running idf.py –list-targets.
To select the target before building the project, use idf.py set-target <target> command, for example:
idf.py set-target esp32s2
Important: idf.py set-target will clear the build directory and re-generate the sdkconfig file from
scratch. The old sdkconfig file will be saved as sdkconfig.old.
Note: The behavior of idf.py set-target command is equivalent to:
1. clearing the build directory (idf.py fullclean)
2. removing the sdkconfig file (mv sdkconfig sdkconfig.old)
3. configuring the project with the new target (idf.py -DIDF_TARGET=esp32 reconfigure)
It is also possible to pass the desired IDF_TARGET as an environment variable (e.g.
IDF_TARGET=esp32s2) or as a CMake variable (e.g. -DIDF_TARGET=esp32s2 argument to CMake or
idf.py). Setting the environment variable is a convenient method if you mostly work with one type of the chip.
To specify the _default_ value of IDF_TARGET for a given project, add CONFIG_IDF_TARGET value to
sdkconfig.defaults. For example, CONFIG_IDF_TARGET="esp32s2". This value will be used if
IDF_TARGET is not specified by other method: using an environment variable, CMake variable, or idf.py set-
target command.
If the target has not been set by any of these methods, the build system will default to esp32 target.
Espressif Systems
1288
Submit Document Feedback
/compo-
export
Release v4.4

Advertisement

Table of Contents
loading
Need help?

Need help?

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

Table of Contents

Save PDF