ESP-IDF Setup
What is ESP-IDF?
ESP-IDF (Espressif IoT Development Framework) is the official, low-level development framework for ESP32, ESP32-S, ESP32-C, and ESP32-H series chips. It gives you full access to FreeRTOS, Wi-Fi/BLE stacks, and hardware peripherals — ideal once you've outgrown the Arduino framework.
Prerequisites
- A computer running Windows, macOS, or Linux.
- Git installed and available on your
PATH. - An ESP32-based board and a USB data cable.
Supported Targets
| Chip | idf.py set-target value |
|---|---|
| ESP32 | esp32 |
| ESP32-S2 | esp32s2 |
| ESP32-S3 | esp32s3 |
| ESP32-C3 | esp32c3 |
| ESP32-C6 | esp32c6 |
⚠️ ESP8266 is not ESP-IDF compatible. It uses an older, separate Espressif SDK. Use the ESP8266 Arduino IDE guide instead.
Option 1: VS Code Extension (Recommended)
- Install Visual Studio Code.
- Open the Extensions view and install the Espressif IDF extension.
- Run ESP-IDF: Configure ESP-IDF Extension from the command palette and choose Express install.
- Pick the latest stable ESP-IDF release and let the extension download the toolchain and Python environment.
Option 2: Command-Line Install
- Clone the IDF repository:
git clone -b v5.3 --recursive https://github.com/espressif/esp-idf.git
- Run the install script for your platform:
cd esp-idf
./install.sh esp32
- Source the environment in every new terminal session:
. ./export.sh
Build, Flash & Monitor
From your project directory:
idf.py set-target <target> # e.g. esp32, esp32s2, esp32s3, esp32c3, esp32c6
idf.py build
idf.py -p <PORT> flash monitor
idf.py monitor opens a serial console — press Ctrl+] to exit.

