Blog
ESP-IDF: SDK, Build, vs Arduino
What is ESP32 IDF, how to install it, and how to put a first project together — ESP-IDF is Espressif’s official C/C++ SDK, and it runs deeper than the Arduino wrapper. Short answers to the questions people ask once the board manager stops being enough.
What Is ESP32 IDF?
ESP-IDF (Espressif IoT Development Framework) is the official C/C++ SDK from Espressif — the company that makes the chip. You get FreeRTOS, hardware drivers, and the idf.py build system instead of Arduino’s friendly wrapper. It’s not a language and not an IDE; it’s the toolchain the chip’s own documentation talks to.
How to Install ESP32 IDF?
On Windows, the Espressif IDE or the esp-idf installer sets up Python, Git, and toolchains in one run. On Linux: git clone –recursive the repository, then source install.sh and export.sh. Budget 4-6 GB of disk and 10-20 minutes; my v5.3 install on a 2022 laptop took 14 minutes.
How to Put a Project into ESP32 IDF?
A project is one folder: a main/ directory with your C files plus a CMakeLists.txt at the top. Copy one of the examples in examples/get-started, run idf.py set-target esp32s3 once, then idf.py build. Arduino-style code won’t drop in unchanged — ESP-IDF wants app_main(), not setup() and loop(). The getting-started FAQ covers the Arduino route if that’s where you’re coming from.
How to Run boot.py ESP32?
boot.py is MicroPython’s startup script, not an ESP-IDF concept. Flash MicroPython first (esptool.py write_flash 0x1000 micropython.bin), then upload boot.py to the filesystem and it runs on every boot. Expecting boot.py on ESP-IDF? Wrong firmware for the job.
ESP-IDF or Arduino — which should I use?
Both work; the answer depends on your board and your patience. Arduino is a wrapper that hides sdkconfig and the build system. ESP-IDF gives you control and matches the official docs — which are good, but they assume C experience. For anything with deep sleep plus Wi-Fi, or for a product, ESP-IDF is the safer bet; for a hobby prototype, Arduino gets there faster.
What is app_main() and why does my build want it?
Every ESP-IDF project defines exactly one app_main() — the entry point, with no setup()/loop() split. Create a FreeRTOS task inside it and keep it alive. If your build ends in ‘undefined reference to app_main’, that function is the missing piece.
What is sdkconfig, and should I edit it?
sdkconfig is your project’s generated config, regenerated on every clean build. Don’t hand-edit it: idf.py menuconfig writes it for you. sdkconfig.defaults is the file to commit. The under-the-hood FAQ explains how config propagates into the build.
What does “fatal error: driver/gpio.h: No such file or directory” mean?
A missing component dependency. The header exists in the SDK — your CMakeLists.txt just doesn’t declare it in REQUIRES. One line fixes it, and it’s the most common ESP-IDF compile error I’ve helped debug in forums. I hit it on my own first project at 2am; the fix took 20 seconds after I stopped panicking.
How to Set Baud Rate of an ESP32 Using ESP-IDF?
Run idf.py menuconfig → Serial flasher config → Default flash baud rate. That’s the direct answer to ‘how to set baud rate of a ESP32 using ESP-IDF’: it’s the flashing speed, not your app’s UART speed. Your application baud rate is a UART driver parameter you set in code, separately.
Can I run Arduino code inside ESP-IDF?
Yes, recent cores ship Arduino as an optional component — idf.py add-dependency espressif/arduino-esp32 pulls it in. It mostly works, though mixing the two worlds gets confusing: two config systems, two timer APIs. Pick one per project. Debugging a mixed project is where the debugging FAQ earns its keep.
Compiled With the Real Toolchain Family
ESP-IDF is the source of truth for the platform — and its abstractions are visible in our simulator, which builds sketches with arduino-cli (itself a layer over IDF):
- Blink (Arduino style) — setup()/loop(), compiled and running in one click.
- IDF-style blink — the same LED via the native API surface, also runnable here.
Two abstraction levels over the same silicon, one browser tab. When this FAQ debates IDF-versus-Arduino, that debate is something you can A/B by running both.