VS Code + ESP-IDF: the official environment with JTAG included

How to set up VS Code with the official ESP-IDF extension: install, create a project, menuconfig, build, flash, monitor and debug over JTAG.

Also available in: EN, ES

Series Introduction to the ESP32 Part 18 View the series →
VS Code with ESP-IDF and the ESP32

If you have decided to use ESP-IDF, the official VS Code extension gives you the best of both worlds: a modern editor and real JTAG debugging.

Installation

  1. In VS Code, install the ESP-IDF extension (by Espressif).
  2. Run the setup wizard (ESP-IDF icon → Setup). The extension downloads ESP-IDF, the toolchain and Python.
  3. Pick the version: today ESP-IDF 6.1.

It takes a while because it downloads everything (ESP-IDF is big). That is normal.

Create a project

ESP-IDF: New Project → template (sample_project, blink…), name and chip. The layout is ESP-IDF’s:

my-project/
├── CMakeLists.txt
├── sdkconfig
└── main/
    ├── CMakeLists.txt
    └── main.c

ESP-IDF: SDK Configuration Editor opens menuconfig in an integrated web view: change options, search by text and it saves sdkconfig. Much nicer than the terminal.

Build, flash and monitor

The bottom bar has the buttons:

  • Build, Flash, Monitor and Build + Flash + Monitor.
  • Serial port and monitor speed selection.
  • Target selection (esp32, esp32s3, esp32c3…).

It is equivalent to:

idf.py build
idf.py -p /dev/ttyUSB0 flash monitor

JTAG debugging

Here is the gem. With an ESP32-S3/C3 board (and its native USB) or an external probe, you get breakpoints, step over, variable inspection and call stacks — no printf.

In ESP-IDF it is set up with idf.py openocd, and the extension integrates it. This is one of the biggest time savers when a bug refuses to show itself.

Extensions that pair well

  • C/C++ (IntelliSense) — the extension configures it.
  • clang-format — automatic formatting on save.
  • Error Lens — errors inline, without opening the console.

When to choose it

  • Yes: you are serious about ESP-IDF, want a comfortable menuconfig and JTAG debugging.
  • No: if you use Arduino or MicroPython (not applicable) or the command line is enough.

Summary

  • The ESP-IDF extension installs the SDK and the toolchain for you.
  • Integrated menuconfig, with search.
  • Build/flash/monitor buttons and chip/port selection.
  • JTAG for real debugging (S3/C3 or an external probe).
  • Current ESP-IDF version: 6.1.

Next step: the hands-on block: blink an LED with what you already have set up. Or go back to the series hub.

Related posts

↑↓ navigate ↵ open Esc close