ESP-IDF: Create Template ESP32 Project using VS Code

This is a quick guide for getting started using ESP-IDF with the ESP32. Learn how to create a template on VS Code to program your ESP32 using ESP-IDF.

ESP-IDF Create Template ESP32 Project using VS Code

Prerequisites

Before following this guide, you need to install the ESP-IDF extension on VS Code IDE (Microsoft Visual Studio Code). Follow the next guide to install it, if you haven’t already:

You will also need an ESP32 development board model of your choice.

Creating an ESP-IDF Template App Project for the ESP32

The ESP-IDF extension on VS Code can easily create a new ESP-IDF project for the ESP32 with all the needed files and configurations automatically.

To create a new ESP-IDF project on VS Code, follow these steps:

  1. Open the ESP-IDF Espressif extension
  2. Expand the “Advanced” menu
  3. Click the “New Project Wizard” option
  4. Choose the “Use ESP-IDF v5.4.1” to select the framework version
ESP-IDF ESP32 Create Open New Project Wizard Menu

A new window opens, you need to fill in these fields:

  • Project Name: type the desired project name;
  • Enter Project Directory: click the folder icon and select the target folder to save all your project files. You can use any directory. Note: do NOT use a Google Drive / One Drive / Dropbox folder, because it will write/create many files during the building process—if it’s on a cloud folder, this process might be extremely slow;
  • ESP-IDF Target: select the target device chip, I’m using an ESP32 with the esp32s3 chip;
  • ESP-IDF Board: for the esp32s3 chip, I also need to select the configuration: ESP32-S chip (via builtin USB-JTAG);
  • Serial Port: while having your ESP32 board connected to your computer, select the correct COM port number that refers to your ESP32;
  • Choose Template: click the blue button to create a new project using a template.
ESP-IDF ESP32 Create Open New Project Wizard Menu Select Directory Board Template

In the menu, select the “template-app” sample project and press the “Create project using template template-app” button.

ESP-IDF ESP32 Create New Project Select Template App Option

Opening the ESP-IDF Project on VS Code

After a few seconds, a small notification will appear at the bottom right of VS Code. You can click “Yes” to open the newly created ESP-IDF project template.

ESP-IDF ESP32 Open Project in a New Window VS Code

IMPORTANT: if you didn’t see the notification that allows you to automatically open the ESP-IDF project on VS Code, you can easily do it by following these instructions:

Go to File > Open Folder…

ESP-IDF ESP32 Open Project Folder VS Code File Menu

Browse on your computer for the esp-idf-project folder (your project folder name that you’ve previously defined) and “Select Folder“.

ESP-IDF ESP32 Open Project VS Code Select Folder

That’s it! Your new ESP-IDF project template has been successfully created and opened.

Programming ESP32 with ESP-IDF using VS Code

That’s it, your first project has been created. You can get started programming your ESP32 boards with your first Blink project by following our guide ESP-IDF: ESP32 Blink LED Example.

ESP-IDF Extension Installation Completed VS Code ESP32

Wrapping Up

In this tutorial, you learned how to create a template ESP32 project using VS Code. You can now program your ESP32 board using ESP-IDF.

Here are some ESP-IDF tutorials that you may find helpful:

You can check our ESP32 resources (with Arduino IDE) to learn more about the ESP32 board:

Thanks for reading.



Learn how to build a home automation system and we’ll cover the following main subjects: Node-RED, Node-RED Dashboard, Raspberry Pi, ESP32, ESP8266, MQTT, and InfluxDB database DOWNLOAD »
Learn how to build a home automation system and we’ll cover the following main subjects: Node-RED, Node-RED Dashboard, Raspberry Pi, ESP32, ESP8266, MQTT, and InfluxDB database DOWNLOAD »

Recommended Resources

Build a Home Automation System from Scratch » With Raspberry Pi, ESP8266, Arduino, and Node-RED.

Home Automation using ESP8266 eBook and video course » Build IoT and home automation projects.

Arduino Step-by-Step Projects » Build 25 Arduino projects with our course, even with no prior experience!

What to Read Next…


Enjoyed this project? Stay updated by subscribing our newsletter!

Leave a Comment

Download Our Free eBooks and Resources

Get instant access to our FREE eBooks, Resources, and Exclusive Electronics Projects by entering your email address below.