hack4electronics.com

Installing ESP32 IDF in Visual Studio Code: Step-by-Step Guide

Installing ESP32 IDF / ESP-IDF in Visual Studio Code: Step-by-Step Guide : Tutorial 1 ESP32 FreeRTOS

FreeRTOS is an open source real-time operating system kernel that acts as the operating system for ESP-IDF applications and is integrated into ESP-IDF as a component. The FreeRTOS component in ESP-IDF contains ports of the FreeRTOS kernel for all the CPU architectures used by ESP targets (i.e., Xtensa and RISC-V). Furthermore, The ESP32 IDF (IoT Development Framework) is a powerful platform for developing applications for the ESP32 microcontroller. While the official development environment for ESP32 IDF is ESP-IDF, many developers prefer using Visual Studio Code (VS Code) due to its flexibility and rich set of features. This article provides a comprehensive step-by-step guide on installing ESP32 IDF in Visual Studio Code.

Step 1: Install Visual Studio Code for ESP32-IDF / ESP32 FreeRTOS Programming

Start by downloading and installing Visual Studio Code on your computer. VS Code is available for Windows, macOS, and Linux platforms. Visit the official website at https://code.visualstudio.com/ to download the installer and follow the installation instructions.

Step 2 : Set Up ESP32 IDF / ESP-IDF Toolchain

To work with ESP32 IDF, you need to set up the necessary toolchain on your system. Follow these steps based on your operating system:

  • Open the Extensions view by clicking on the Extension icon in the Activity Bar on the side of Visual Studio Code or the View: Extensions command 
  • Search the extension with any related keyword like espressifesp-idfesp32esp32s2, etc.
  • Install ESP-IDF Prerequisites
Install ESP32 IDF Prerequisites

Step 3 To configure the ESP32 IDF / ESP-IDFextension in VS

  1. Press F1 in Visual Studio Code to open the Command Palette.
  2. Type “ESP-IDF: Select where to save configuration settings” and press Enter.
  3. Choose one of the options: User settings, Workspace settings, or workspace folder settings. The default option is User settings.
  4. Alternatively, you can also configure the ESP-IDF extension by selecting the “View” menu in Visual Studio Code, then choosing “Command Palette.” Type “configure esp-idf extension” and select the “ESP-IDF: Configure ESP-IDF extension” option.
  5. In the setup wizard window that appears, you will see several setup options: Express, Advanced, or Use existing setup.
configure the ESP-IDF extension in VS

Step 4 : ESP-IDF / ESP32-IDF Tools download and install

The user will see a page showing the setup progress status showing ESP-IDF download progress, ESP-IDF Tools download and install progress as well as the creation of a python virtual environment

ESP-IDF Tools download and install


If you have selected the “Advanced” option during the ESP-IDF setup, after downloading and extracting ESP-IDF, you will be prompted to choose between downloading ESP-IDF Tools automatically or manually providing the absolute path for each ESP-IDF tool and setting the required environment variables.

 ESP-IDF setup

If you have opted for the Advanced mode during the setup process and have chosen to manually specify the absolute path for each ESP32 IDF tool, please enter the directory containing the executable file for each binary as illustrated below.

 ESP-IDF tool

Once all the necessary installations have been completed successfully, a confirmation message will be displayed, indicating that all settings have been configured. At this point, you are ready to start utilizing the ESP-IDF extension and make the most of its features and functionalities.

Leave a Reply

Your email address will not be published. Required fields are marked *