ESP-IDF (Espressif IoT Development Framework) is Espressif’s official native development framework for the ESP32 family. Starting with ESPHome 2026.1.0, ESP-IDF is the default framework for all ESP32 variants. It produces smaller binaries, compiles firmware specifically tailored to your device’s configuration, and unlocks the full range of ESP32 hardware features. The Arduino framework remains available and supported for configurations that depend on Arduino-only libraries.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/esphome/esphome.io/llms.txt
Use this file to discover all available pages before exploring further.
Arduino vs. ESP-IDF
| ESP-IDF | Arduino | |
|---|---|---|
| Binary size | Up to 40% smaller | Larger (includes Arduino compatibility layer) |
| Supported variants | All ESP32 variants | ESP32, ESP32-C3, ESP32-S2, ESP32-S3 only |
| Actively developed | ✅ Primary target | ✅ Maintained |
| Custom sdkconfig | ✅ Full control | Limited |
| Crash backtraces | ✅ Yes | No |
| Build system | CMake + Ninja | PlatformIO |
| Available since | ESP32 initial release | ESP32 initial release |
The Arduino framework is implemented as an ESP-IDF component — it sits on top of ESP-IDF and provides Arduino API compatibility. This means Arduino builds include both layers, resulting in longer build times and higher flash and RAM usage compared to native ESP-IDF builds.
Choosing a Framework
Option 1 — ESP-IDF (Recommended)
Option 2 — Arduino (when required)
Framework Configuration Variables
esp-idf or arduino. Defaults to esp-idf for all ESP32 variants.The ESP-IDF (or Arduino) version to use. Defaults to
recommended. Other accepted values:recommended— the version tested and recommended by the ESPHome team (default)latest— the newest stable release, even if not yet recommendeddev— the latest development commit; may break at any time- A specific version string, e.g.
5.3.2
A custom PlatformIO package URL for the framework. Useful for testing patched or pre-release builds:
Raw key-value pairs passed to ESP-IDF’s
sdkconfig build system. Use these to tune Kconfig options that ESPHome does not expose directly.ESP-IDF framework log verbosity. One of
ERROR (default), NONE, WARN, INFO, DEBUG, VERBOSE.Additional ESP-IDF components to include from component registries or git sources. See IDF Components.
Full Configuration Example
Selecting the Toolchain
ESPHome supports two build backends for ESP-IDF firmware:| Toolchain | Description |
|---|---|
platformio | Default. Wraps ESP-IDF inside PlatformIO’s build system. |
esp-idf | Uses ESPHome’s own ESP-IDF management with automatic download and environment setup. |
Automatic ESP-IDF Management (Native Toolchain)
When you usetoolchain: esp-idf, ESPHome manages the entire framework lifecycle automatically:
ESPHome downloads the ESP-IDF release archive for the configured
version into <data_dir>/idf/frameworks/<version>/. The download URL defaults to GitHub releases and can be overridden via ESPHOME_IDF_FRAMEWORK_MIRRORS.ESP-IDF’s
idf_tools.py is run to install cmake, ninja, and other required tools if they are not already present on the system.A dedicated Python virtual environment is created at
<data_dir>/idf/penvs/<version>/ and populated with the ESP-IDF Python dependencies. A stamp file tracks the environment version to avoid unnecessary reinstalls.Storage Locations
| Path | Contents |
|---|---|
<data_dir>/idf/frameworks/<version>/ | ESP-IDF framework archive |
<data_dir>/idf/penvs/<version>/ | Python virtual environment |
<data_dir>/idf/tools/ | Build tools (cmake, ninja, esptool) |
Custom sdkconfig Options
The sdkconfig_options: mapping passes raw Kconfig values directly to the ESP-IDF build system. This enables fine-grained tuning of any option exposed by ESP-IDF’s configuration system:
Components Requiring ESP-IDF
The following ESP32 variants require ESP-IDF and have no Arduino support:- ESP32-C2
- ESP32-C5
- ESP32-C6 / C61
- ESP32-H2
- ESP32-P4
framework: type: arduino):
esp32_rmt_led_strip— LED strip via RMT peripheralmicro_wake_word— on-device wake word detectionesp_adf— ESP Audio Development Framework integration- Camera components on newer variants
Components Incompatible with ESP-IDF
Some components currently require the Arduino framework and do not have native ESP-IDF equivalents:| Arduino Component | Status |
|---|---|
fastled_clockless / fastled_spi | Replace with esp32_rmt_led_strip or spi_led_strip |
neopixelbus | Replace with esp32_rmt_led_strip |
bme680_bsec | Replace with bme68x_bsec2 |
heatpumpir | No ESP-IDF alternative yet |
midea climate | No ESP-IDF alternative yet |
| WLED Effect | No ESP-IDF alternative yet |
Component compatibility improves with every ESPHome release. When you compile with ESP-IDF, ESPHome will automatically notify you if any components are incompatible and suggest alternatives where they exist.
Crash Reporting
ESP-IDF includes built-in panic handling that produces detailed crash backtraces. These appear in the serial log output and include:- Register dump
- Stack backtrace with symbol names (when compiled with debug info)
- Cause of the crash (e.g., stack overflow, divide by zero, null pointer dereference)
Advanced Configuration
One of
ENABLE (default), SILENT, or DISABLE. Disabling or silencing assertions reduces binary size but makes bugs harder to diagnose.One of
SIZE (default), PERF, NONE, or DEBUG. PERF increases binary size but may improve runtime performance.ESP32-S3 and ESP32-P4 only. When
true, code executes from PSRAM, which can speed up display drawing and allows normal operation while FLASH is being written (e.g., during OTA). Defaults to false.