Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more

ESP-IDF is Espressif’s development framework for building firmware for ESP32-family chips. A typical workflow is to select the exact chip target and ESP-IDF release, configure a project made of components, build its firmware, flash it to a board, and monitor its output. In the application, ESP-IDF starts FreeRTOS and calls app_main; use NVS for modest persistent settings and a filesystem for larger or growing data.

What ESP-IDF and ESP32 mean

ESP32 refers to a family of microcontrollers; ESP-IDF (Espressif IoT Development Framework) is the software framework used to develop applications for them. Developing and building firmware also requires the toolchain and build tools appropriate to the selected target. Hardware features and available APIs can differ across chips, so do not assume that guidance for one ESP32 model applies unchanged to every member of the family.

Examples below use the conventional idf.py workflow shown in Espressif’s ESP32 getting-started documentation. The official “latest” documentation is a moving guide, not a fixed release. Check the guide and API reference for the ESP-IDF version and chip you actually use; version-specific behavior should not be inferred from a page for another release or target. Espressif’s ESP32 getting-started guide

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

How an ESP-IDF project is organized

Think of a project as the application plus its configuration and supporting components. Components are the framework’s building blocks: they can provide system facilities, drivers, networking, or your own application code. A project’s build brings together the components and options selected for its target.

#1 Best Overall
ESP-WROOM-32 ESP32 ESP-32S Development Board 2.4GHz Dual-Mode WiFi + Bluetooth Dual Cores Microcontroller Processor Integrated with Antenna RF AMP Filter AP STA Compatible with Arduino IDE (3PCS)
  • 2.4GHz Dual Mode WiFi + Bluetooth Development Board
  • Support LWIP protocol, Freertos
  • SupportThree Modes: AP, STA, and AP+STA
  • Ultra-Low power consumption, Compatible with Arduino IDE
  • ESP32 is a safe, reliable, and scalable to a variety of applications
  • Application: your firmware code and the project-level files that describe how it is built.
  • Components: reusable framework or application modules, with dependencies that the build system resolves.
  • Configuration: project options recorded in sdkconfig. Use idf.py menuconfig to inspect and change configurable options.
  • Build output: firmware artifacts for the selected target. A typical project builds the application and a bootloader application, but details depend on target and release.

Set the target before building and review the project configuration when changing chips or build options; a successful build for one target does not establish compatibility with another. The general component and build-system explanation cited here is from the ESP32-H2 ESP-IDF v6.1 guide, so use the ESP32-specific guide for target details. ESP-IDF build system and components · ESP32 API guides

What happens at app_main

ESP-IDF startup initializes the system and starts the FreeRTOS scheduler before calling the application entry point, app_main. Espressif’s ESP32 FreeRTOS overview for ESP-IDF v5.1 states: “Users must define a void app_main(void) function which acts as the entry point for user’s application and is automatically called on ESP-IDF startup.” This description is specifically from the v5.1 guide; consult the documentation for your chosen release for current implementation details. FreeRTOS overview, ESP-IDF v5.1 · ESP32 application startup flow

Rank #2
ELEGOO 3PCS ESP-32 Dev Boards, ESP-WROOM-32, USB-C, WiFi Bluetooth 4.2
  • Dual-Core Performance Up to 240 MHz: Run sensor processing, wireless communication, automation logic and connected-device tasks on a 32-bit dual-core ESP32 platform designed for responsive embedded and IoT projects
  • Built-in Wi-Fi and Bluetooth 4.2: Connect to 2.4 GHz Wi-Fi networks or use Bluetooth Classic and BLE for wireless sensors, smart devices, remote controls, home automation and other connected projects
  • Flexible Power-Saving Modes: ESP32 power-management features support dynamic clock scaling and low-power operating modes, helping developers reduce energy use in compatible sensing, monitoring and connected-device applications, suitable for battery-powered Internet of Things (IoT) devices.
  • USB-C Programming with CP2102: Connect through USB-C for power, sketch uploads and serial monitoring, while GPIO, UART, SPI and I2C interfaces support sensors, displays, motor drivers and other modules (USB-C cable not included)
  • Over-the-Air Update Support: Configure OTA functionality through a compatible ESP-32 software framework to update deployed firmware over Wi-Fi without reconnecting the board by USB for every revision

Use tasks for concurrent or ongoing work

A common pattern is for app_main to initialize application resources and create one or more FreeRTOS tasks for ongoing work. For example, a task might handle periodic sensor sampling while another handles communication. Keep each task’s responsibilities clear, and use the synchronization mechanisms and APIs documented for your ESP-IDF release.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Returning from app_main

app_main does not have to run forever. If it creates worker tasks and returns, ESP-IDF cleans up the main task while the scheduler continues running the other tasks. Alternatively, the application can do ongoing work directly in app_main. Choose the structure that fits the work rather than treating app_main as an ordinary desktop-style main function. Task and scheduling details should be checked against the target and release in use.

Rank #3
ELEGOO ESP-32 Super Starter Kit with Tutorial Compatible with Arduino IDE
  • Powerful ESP-32 Board: Unlock the world of Internet of Things (IoT) and advanced electronics with the heart of this kit: the ESP-32 board. It features a powerful dual-core processor, integrated Wi-Fi and Bluetooth 4.2, making it perfect for building connected, smart devices that communicate with your phone or the cloud. It's fully compatible with the Arduino IDE for easy programming.
  • Super Starter Kit: This kit contains over 35 different modules and electronic components, including sensors, displays, motors, and input devices. From LEDs and buttons to an OLED screen, servo motor, and keypad, you have everything needed to explore a vast range of projects in one box.
  • Step by Step Online Tutorial: Jump right in with our detailed, beginner-friendly tutorial. Access 30+ projects with complete code, clear circuit diagrams, and step-by-step instructions. Learn the fundamentals of electronics, coding, and how to utilize the ESP-32's unique capabilities without any prior experience.
  • Hands-on Learning for All Skill Levels: Perfect for students, makers, engineers, and hobbyists. Start with basic circuits and coding, then progress to intermediate and advanced IoT applications. Build practical projects like weather stations, smart home controllers, remote-controlled devices, and interactive gadgets. The skills you learn are the foundation for real-world innovation.
  • Quality & Great Support: Elegoo is committed to quality. We provide a clear, detailed tutorial guide, refined code, and a well-organized component kit. All modules are carefully selected for reliability and ease of use. Our dedicated technical support team and active online community are ready to help you succeed in your learning journey.

When to use NVS and when to use a filesystem

ESP-IDF’s Non-Volatile Storage (NVS) library stores key-value pairs in flash, so values persist across resets and power loss. It is intended for a moderate, relatively stable set of small values—for example, configuration, calibration values, or state flags. NVS organizes data into namespaces; a key must be unique within its namespace. Espressif NVS documentation

Data pattern Better fit Why
Small settings, calibration values, or flags that change occasionally NVS Designed for modest key-value data stored persistently in flash.
Large strings or blobs, growing records, or frequently appended data An ESP-IDF filesystem Large or repeatedly rewritten NVS data can fill and fragment its partition and increase flash wear; a filesystem better suits data that grows or is appended.

Persistent storage also has a physical-access security dimension. Without NVS encryption, someone who can access the flash can read or alter stored pairs. Espressif documents that NVS encryption combined with flash encryption protects confidentiality and authenticity from someone who lacks the corresponding keys. Encryption does not prevent someone with physical access from erasing the data. NVS security and tampering considerations

Rank #4
ESP-WROOM-32 ESP32 ESP-32S Development Board 2.4GHz Dual-Mode WiFi + Bluetooth Dual Cores Microcontroller Processor Integrated with Antenna RF AMP Filter AP STA Compatible with Arduino IDE (1 PCS)
  • 2.4GHz Dual Mode WiFi + Bluetooth Development Board
  • Support LWIP protocol, Freertos;ESP32 is a safe, reliable, and scalable to a variety of applications
  • SupportThree Modes: AP, STA, and AP+STA
  • Ultra-Low power consumption, Compatible with Arduino IDE
  • 1PCS 30Pin ESP32 Development Board 2.4GHz WiFi Dual Cores Microcontroller Integrated with Antenna RF Low Noise Amplifiers Filters
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Build, flash, and monitor the firmware

Install ESP-IDF and the required target toolchain and build tools using the setup flow for your operating system. You also need an ESP32 development board and a USB cable that matches its connector; the cable and board must support the connection you intend to use. Before flashing, identify the chip target and the serial port assigned to the connected board. Port names vary by operating system and device.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  1. Configure the target: from the project directory in an ESP-IDF environment, run idf.py set-target TARGET, replacing TARGET with the exact chip target supported by your board and ESP-IDF release.
  2. Configure project options as needed: run idf.py menuconfig to edit settings, which are stored in sdkconfig.
  3. Build: run idf.py build. This compiles the project and creates firmware artifacts for the selected target.
  4. Flash: run idf.py -p PORT flash, replacing PORT with the board’s serial port. The flash command also builds the project if needed.
  5. Monitor output: run idf.py -p PORT monitor to open the serial monitor. To combine flashing and monitoring, run idf.py -p PORT flash monitor.

These commands and the combined flash-monitor flow are documented in Espressif’s ESP32 first-project guide. If the board does not connect or the monitor shows unexpected output, verify the selected target, serial port, board connection, and release-matched setup instructions before changing application code. Espressif also documents a crystal-frequency mismatch troubleshooting case; it is relevant only to affected hardware, not a general fix for every flash or boot problem. Build the ESP32 project, flash it, and open the monitor

Best Value
HiLetgo ESP-WROOM-32 ESP32 ESP-32S Development Board 2.4GHz Dual-Mode WiFi + Bluetooth Dual Cores Microcontroller Processor Integrated with Antenna RF AMP Filter AP STA for Arduino IDE
  • 2.4GHz Dual Mode WiFi + Bluetooth Development Board
  • Ultra-Low power consumption, works perfectly with the Arduino IDE
  • Support LWIP protocol, Freertos
  • SupportThree Modes: AP, STA, and AP+STA
  • ESP32 is a safe, reliable, and scalable to a variety of applications

Choose guidance that matches your chip and release

Use the target-specific ESP32 guides for peripheral setup, hardware capabilities, and APIs, and the documentation for your installed ESP-IDF release for exact command and behavior details. A project’s target, component dependencies, and configuration all influence what builds and runs; examples from a different chip or release may need adjustment. Espressif’s ESP Component Registry is a resource for components, including board support packages that can simplify board initialization, but a BSP still needs to match the hardware and software environment. ESP32 API guides

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.