Beyond Arduino: Getting Started with ESP-IDF in VS Code for ESP32
Note: This tutorial was originally published on effessdev.github.io . Check out the original article for the most up-to-date version: https://effessdev.github.io/posts/2026-07-27/ This is a step-by-step tutorial that explains how you can set up your development environment for working with ESP-IDF projects in VS Code . Install ESP-IDF Install EIM Espressif Systems provides a graphical tool called…
This tutorial, originally published on effessdev.github.io, explains the process of setting up a development environment for working with ESP-IDF projects in Visual Studio Code (VS Code). ESP-IDF, provided by Espressif Systems, is the framework for developing software for Espressif's IoT products. This guide will walk you through the steps to install ESP-IDF, set up the ESP-IDF extension in VS Code, create a new ESP-IDF project, configure the project, and build and flash the project to an ESP32 board.
Firstly, you need to install the ESP-IDF Installation Manager (EIM). Download the appropriate installer for your system from the official page, following the link provided. Once installed, open EIM and start a new installation, choosing the latest stable version of ESP-IDF. After installation, install the ESP-IDF extension in VS Code to provide a high-level interface for ESP-IDF. Restart VS Code and verify the installation by searching for ESP-IDF commands in the command palette.
Next, create a new ESP-IDF project using the ESP-IDF: New Project command from the command palette. Select the desired ESP-IDF version, project template (sample_project in this case), and target (esp32 for an ESP32 board). Fill in your project details, such as the project name, project directory, and board (Custom board). Click the Create Project button.
Open the new project tab and click Open Project to start working on your new ESP-IDF project in VS Code. To avoid issues with Intellisense, make sure to generate the compile_commands.json file. You can do this by running the ESP-IDF: Run idf.py reconfigure Task command from the command palette.
Once the project is configured, you can start coding. A typical starting point is the main.c file, which contains a blank app_main function. Add logging functionality by including the esp_log.h header and defining a TAG constant. Use ESP_LOGI in the app_main function to print "Hello world!" to the serial console.
To build the project, use the ESP-IDF: Build Your Project command from the command palette. This will compile the code and generate the binary file. Flashing the project involves uploading the compiled code to your ESP32 board. Connect your ESP32 to your computer, and then use the ESP-IDF: Flash (UART) command. Depending on your platform, you might need to adjust the flashing process to resolve any errors.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.