Chapter 4. API Guides
If the bootloader grows too large then it can collide with the partition table, which is flashed at offset 0x8000 by
default. Increase the partition table offset value to place the partition table later in the flash. This increases the space
available for the bootloader.
Note: Customize the bootloader by using either method is only supported with CMake build system (i.e. not
supported with legacy Make build system).
4.4 Build System
This document explains the implementation of the ESP-IDF build system and the concept of“components”. Read
this document if you want to know how to organize and build a new ESP-IDF project or component.
4.4.1 Overview
An ESP-IDF project can be seen as an amalgamation of a number of components. For example, for a webserver that
shows the current humidity, there could be:
• The ESP-IDF base libraries (libc, ROM bindings, etc)
• The Wi-Fi drivers
• A TCP/IP stack
• The FreeRTOS operating system
• A webserver
• A driver for the humidity sensor
• Main code tying it all together
ESP-IDF makes these components explicit and configurable. To do that, when a project is compiled, the build system
will look up all the components in the ESP-IDF directories, the project directories and (optionally) in additional
custom component directories. It then allows the user to configure the ESP-IDF project using a text-based menu
system to customize each component. After the components in the project are configured, the build system will
compile the project.
Concepts
• A “project”is a directory that contains all the files and configuration to build a single “app”(executable),
as well as additional supporting elements such as a partition table, data/filesystem partitions, and a bootloader.
•“Project configuration”is held in a single file called sdkconfig in the root directory of the project. This
configuration file is modified via idf.py menuconfig to customise the configuration of the project. A
single project contains exactly one project configuration.
• An“app”is an executable which is built by ESP-IDF. A single project will usually build two apps - a“project
app”(the main executable, ie your custom firmware) and a“bootloader app”(the initial bootloader program
which launches the project app).
•“components”are modular pieces of standalone code which are compiled into static libraries (.a files) and
linked into an app. Some are provided by ESP-IDF itself, others may be sourced from other places.
•“Target”is the hardware for which an application is built. A full list of supported targets in your version if
ESP-IDF can be seen by running idf.py –list-targets.
Some things are not part of the project:
•“ESP-IDF”is not part of the project. Instead it is standalone, and linked to the project via the IDF_PATH
environment variable which holds the path of the esp-idf directory. This allows the IDF framework to be
decoupled from your project.
• The toolchain for compilation is not part of the project. The toolchain should be installed in the system com-
mand line PATH.
Espressif Systems 1269
Submit Document Feedback
Release v4.4