Skip to content

COMMON COMMAND

TOC

Use Command
Create Project idf.py create_project <project_name>
Set Target idf.py set_target <target>
Configure idf.py menuconfig
Create Component idf.py create_component <component_name>
Add Component from ESP Component Register idf.py add-dependency <component_name>
Build idf.py build
Flash idf.py -p <port> flash
Monitor idf.py -p <port> monitor
Build & Flash & Monitor idf.py build flash monitor

CREATE PROJECT

Command Prototype

idf.py create_project <project_name>

Example

idf.py create_project my_project

SET TARGET

Command Prototype

idf.py set_target <target>

Example

idf.py set_target esp32s3

CONFIGURE

Command Prototype

idf.py menuconfig

Example

idf.py menuconfig

Note

In ESP32 projects, we usually configure the project using the menuconfig command. The menuconfig command opens a configuration interface where you can configure various options of the project. This configuration interface is generated by the Kconfig file in the project. The values of these configuration options are saved in the sdkconfig file in the project.

In short, the logical relationship of the configuration system is: Kconfig -> menuconfig -> sdkconfig. We define configuration options in the Kconfig file, configure these options using the menuconfig command, and then save the values of these configuration options in the sdkconfig file.

CREATE COMPONENT

Command Prototype

idf.py -C <project_path> create_component <component_name>

Note

The -C option is used to specify the path of the project.

<project_path> is the path of the project.

<component_name> is the name of the component.

Example

idf.py -C /path/to/project create_component my_component

ADD COMPONENT FROM ESP COMPONENT REGISTER

Command Prototype

idf.py add-dependency <component_name>

Example

idf.py add-dependency "joltwallet/littlefs^1.16.4"

BUILD

Command Prototype

idf.py build

Example

idf.py build

FLASH

Command Prototype

idf.py -p <port> flash

Example

idf.py -p /dev/ttyACM0 flash

Tip

For short, most of time, you can use idf.py flash and the computer will automatically detect the port.

MONITOR

Command Prototype

idf.py -p <port> monitor

Example

idf.py -p /dev/ttyACM0 monitor

Tip

For short, most of time, you can use idf.py monitor and the computer will automatically detect the port.

BUILD & FLASH & MONITOR

This is a combination of the above commands.

Command Prototype

idf.py build flash monitor

Example

idf.py build flash monitor