DEV Community

EffessDev
EffessDev

Posted on • Edited on

Starting an ESP-IDF project in VS Code

Development environment setup

  1. Install ESP-IDF (and the drivers if using Windows) using EIM (official docs)
  2. Install the ESP-IDF VS Code extension by Espressif Systems

Creating a project

  1. Open the command palette (Ctrl + Shift + P) and select ESP-IDF: New Project
  2. Choose the template named sample_project and create the project

After this, you can initialize the repository and push it to GitHub:

git init
git add -A
git commit -m "initial commit"
git branch -M main
git remote add origin https://github.com/user/repo.git
git push -u origin main
Enter fullscreen mode Exit fullscreen mode

For Linux users (skip this if you use Windows)

Run this command, log out, and log back in (or reboot):

sudo usermod -aG dialout $USER
Enter fullscreen mode Exit fullscreen mode

You have to do it only once.

Building and flashing

You can use the commands from the VS Code command palette:

  1. ESP-IDF: Build Your Project
  2. ESP-IDF: Flash Your Project

Note for Windows users (skip this if you use Linux)

If you are on Windows, flashing might show this error:

A fatal error occurred: Could not connect to an Espressif device on any of the 1 available serial ports.
Enter fullscreen mode Exit fullscreen mode

If that happens, press and hold the BOOT button on your board as soon as
you see Connecting....

Top comments (0)