ESP-IDF: how Espressif's official framework builds, flashes and versions firmware, and where it trips people up
Espressif IoT Development Framework. Official development framework for Espressif SoCs.
At a glance
- What is it?
- ESP-IDF is Espressif's own C development framework for its SoCs, driven by the idf.py command on Windows, Linux and macOS. This guide follows the build and flash workflow, then covers the version, chip and shell traps that cost new users time.
- Who is it for?
- ESP-IDF is the framework to use when you are writing firmware for a current Espressif SoC and want the vendor's own build system, examples and release line, released under Apache-2.0. It is the wrong choice for ESP8266 or ESP8285 boards, which need the separate RTOS SDK.
- Can I use it commercially?
- Yes. Apache-2.0 is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
- Is it still maintained?
- Yes. The repository last received commits 1 day ago.
- What is it written in?
- Mainly C, according to GitHub's language statistics.
Answers come from the project's GitHub data, last synced on November 25, 2026, and from our analysis. They are not legal advice.
Star history
- espressif/esp-idf19,598 ★ · +423
| Repository | 2026-10-07 | 2026-11-25 |
|---|---|---|
| espressif/esp-idf | 19.2k | 19.6k |
423 Stars in the last 49 days, measured from the daily GitHub snapshot. Compare with other projects
Editorial analysis
ESP-IDF is the vendor framework, and ESP8266 is not in it
ESP-IDF is Espressif's official development framework for its SoCs, written mainly in C, licensed under Apache-2.0, and supported on Windows, Linux and macOS. The repository holds the framework source under components/, a Kconfig tree, CMake build files, the docs/ directory that produces the online documentation, and tools/ with the helper scripts.
The first thing to confirm is whether your chip belongs here at all. Espressif SoCs released before 2016, the ESP8266 and the ESP8285, are not supported by ESP-IDF. They use the separate ESP8266_RTOS_SDK repository instead. If you buy a cheap ESP8266 board and follow an ESP-IDF tutorial, the set-target step will not offer your chip, and none of the examples apply. For current chips, the project also keeps COMPATIBILITY.md, which maps ESP-IDF releases to specific silicon revisions. An older ESP-IDF release may not support a newer revision of the same chip family, so check that table against the revision printed on your module before choosing a version.
The export script has to run in every new shell
Setup is split into two scripts with different jobs. The install script sets up the build environment once: install.bat or install.ps1 on Windows, install.sh or install.fish for Unix shells. Host build dependencies listed in the Getting Started guide at idf.espressif.com have to be in place first, and that site sends you to chip-specific instructions.
The export script is the one that catches people out. It must run in every shell environment before you use ESP-IDF, not just once after installation. On Windows that is export.bat, with export.ps1 also in the repository root; on Unix you source it:
source export.shThere is also an export.fish for fish users. If you open a new terminal and idf.py is not found, or picks up the wrong tools, the missing step is this one. The repository root also contains add_path.sh. Editor integrations and CI jobs have to replicate the export step too, because each new process starts without it.
idf.py set-target fixes the chip before menuconfig sees the project
Every project starts by choosing which SoC it builds for:
idf.py set-target <chip_name>Running it with no arguments prints the list of supported targets, which is the quickest way to check whether your installed release knows about your chip:
idf.py set-targetConfiguration then happens in a text-based menu built from the Kconfig files:
idf.py menuconfigThe menu covers project options and also the serial flashing settings used later by idf.py flash. Configuration is per project, so a project copied from examples/ carries its own settings. Espressif tells you to copy an example directory outside of the ESP-IDF directory before turning it into your own project. Editing examples in place mixes your changes into the framework checkout itself. The examples cover bluetooth, wifi, ethernet, ieee802154, openthread, zigbee, mesh, lowpower, security, storage, peripherals, custom_bootloader, cxx and more, alongside the separate esp-idf-template repository.
One build produces the app, the bootloader and the partition table
A single command compiles three artifacts:
idf.py buildIt builds the app, the bootloader, and generates a partition table from the project configuration. When it finishes, it prints an esptool command line you can use to flash the chip by hand. Most people let idf.py do it instead:
idf.py -p PORT flashPORT is the serial port name: COM3 style names on Windows, /dev/ttyUSB0 on Linux, /dev/cu.usbserial-X on macOS. If you leave out -p, idf.py flash tries the first available serial port, which on a machine with several USB serial devices can be the wrong one. You do not need to run idf.py build first, because idf.py flash rebuilds anything that needs it. This writes the whole project, app plus bootloader plus partition table, to the chip. To build, flash and watch the serial output in one pass:
idf.py flash monitorThe monitor uses the separate esp-idf-monitor tool, which also decodes crash output. Exit it with Ctrl-].
idf.py flash leaves old flash contents behind
The flash target does not erase the entire flash. It writes the app, bootloader and partition table over what is there, and any region it does not write keeps its old data. That matters most when you change the partition table or work with OTA app updates, where leftover data from a previous layout can survive the new flash. The fix is an explicit erase:
idf.py erase-flashIt can be chained with other targets, so a full reset and reflash is one command:
idf.py -p PORT erase-flash flashThe consequence for your workflow: if a board behaves differently from a freshly flashed one after a partition change, erase it before assuming the bug is in your code. The erase also wipes anything your firmware stored in flash, so do not run it on a device whose stored data you still need.
Flashing only the app skips the bootloader after the first write
After the initial flash, you can rebuild and reflash only the application:
idf.py appidf.py app-flashThe first builds just the app; the second flashes just the app and rebuilds it first if any source file changed. Espressif's own note is that in normal development there is no downside to reflashing the bootloader and partition table each time if they have not changed, so app-flash is a convenience rather than a necessity. The case where it matters is the reverse one: if you changed bootloader or partition settings in menuconfig, app-flash will not write them. Use idf.py flash, or the erase-flash combination from the previous section, whenever those pieces change.
Every release has its own documentation, so the latest pages can mislead
Each SoC series and each ESP-IDF release has its own documentation, built from the docs/ directory of that release. The versions page at docs.espressif.com explains how to find the right set and how to check out a specific release. If you read the latest pages while building against an older release, you can end up following options and instructions written for a different version.
Several release lines are maintained in parallel. Recent tags include v5.5.6 from 16 October 2026, v5.3.6 from 15 September 2026 and v5.2.8 from 11 September 2026. SUPPORT_POLICY.md covers how ESP-IDF versions are supported, and Espressif publishes End-of-Life Advisories for releases whose support has stopped. The repository itself is active, with the last push on 2 November 2026; the default branch is master. For a product, pick a release tag, note its support window, and match the documentation to it, rather than building from master.
Forks hosted outside GitHub break submodule cloning
ESP-IDF pulls several dependencies in as git submodules, and .gitmodules uses relative URLs. Those resolve correctly only when the repository lives on GitHub. If your company mirrors ESP-IDF to a self-hosted Git server or another forge, the relative paths point at repositories that do not exist there, and the submodule step fails.
The repository ships a script for this case, tools/set-submodules-to-github.sh, to run after git clone. It rewrites every submodule to an absolute GitHub URL so that this completes:
git submodule update --init --recursiveTwo consequences follow. A non-GitHub mirror still fetches submodules from GitHub after the script runs, so it does not make an internal mirror self-contained, and networks that block GitHub need their own submodule mirrors. If you clone straight from GitHub, none of this applies and the script is not needed.
Editorial conclusion
ESP-IDF is the framework to use when you are writing firmware for a current Espressif SoC and want the vendor's own build system, examples and release line, released under Apache-2.0. It is the wrong choice for ESP8266 or ESP8285 boards, which need the separate RTOS SDK. Before starting, check COMPATIBILITY.md for your chip revision, pick a release such as v5.5.6 against SUPPORT_POLICY.md, and read the documentation for that exact release and SoC series rather than the latest pages.
Frequently asked questions
What is ESP-IDF?
ESP-IDF is the Espressif IoT Development Framework, the official development framework for Espressif SoCs. It runs on Windows, Linux and macOS and is released under the Apache-2.0 license.
Is ESP-IDF written in C or C++?
The ESP-IDF repository is primarily C. Its examples directory also includes a cxx folder with C++ examples.
How do I install ESP-IDF?
Follow the chip-specific instructions linked from idf.espressif.com, install the host build dependencies, then run the install script for your shell. Before using ESP-IDF in each new shell, run the export script, for example source export.sh on Unix.
How do I install ESP-IDF on Windows?
On Windows, ESP-IDF uses install.bat or install.ps1 to set up the build environment, and export.bat must be run in every shell before using it.
How do I install ESP-IDF on Mac?
ESP-IDF supports macOS through install.sh or install.fish, followed by sourcing export.sh in each shell. On macOS the serial port for flashing has a name like /dev/cu.usbserial-X.
How do I use ESP-IDF on a project?
Copy an example project outside the ESP-IDF directory, run idf.py set-target with your chip name, adjust options with idf.py menuconfig, then run idf.py flash monitor to build, flash and watch the serial output in one pass.
Official sources
Add this badge to your README
If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.
[](https://hysenlabs.com/projects/espressif-esp-idf)Star history chart for your README
[](https://hysenlabs.com/projects/espressif-esp-idf)Was this useful?