ESP32 — ESP-IDF v6

ESP-IDF v6 — Windows Setup

Install ESP-IDF v6 on Windows using the ESP-IDF Installation Manager (EIM). EIM handles all dependencies automatically — no manual Python environments or PATH configuration needed.


Prerequisites

Before starting, make sure you have:

  • Windows 10 64-bit (version 1903 or later) or Windows 11
  • At least 4 GB of free disk space (8 GB recommended)
  • A stable internet connection for the initial download (~1.5 GB)
  • Git for Windows installed (git-scm.com)

Use PowerShell, not Command Prompt

All commands in this guide should be run in Windows PowerShell (or Windows Terminal with PowerShell). Command Prompt (cmd.exe) may not work correctly with ESP-IDF path setup.


Step 1 — Install EIM via WinGet

Open PowerShell as Administrator and run:

powershell
# Install EIM with a graphical interface
winget install Espressif.EIM

# Or install the CLI-only version (for headless/automation use)
winget install Espressif.EIM-CLI

WinGet not installed?

WinGet is included by default in Windows 11. For Windows 10, install the App Installer package from the Microsoft Store, or download EIM directly from dl.espressif.com.

Verify EIM installed correctly:

powershell
eim --version

Step 2 — Install ESP-IDF v6 via EIM GUI

Option A: Using the EIM GUI (Recommended for first-time users)

  1. Open the EIM application from the Start Menu
  2. Click "New Installation"
  3. Select ESP-IDF v6.0.0 (or the latest v6.x release) from the version dropdown
  4. Choose your target chip (e.g., ESP32, ESP32-S3, ESP32-C6)
  5. Accept the default installation path (C:\Users\<you>\.espressif\)
  6. Click Install and wait for the process to complete (~10–20 minutes)

Option B: Using the EIM CLI

powershell
# Install ESP-IDF v6.0 targeting ESP32
eim install --version v6.0 --target esp32

# For ESP32-S3
eim install --version v6.0 --target esp32s3

# For ESP32-C6
eim install --version v6.0 --target esp32c6

Step 3 — Activate the ESP-IDF Environment

EIM creates a PowerShell activation script. Run it each time you open a new terminal session, or add it to your PowerShell profile.

powershell
# Activate ESP-IDF environment for the current session
. $env:USERPROFILE\.espressif\esp-idf-v6.0\export.ps1

To verify the environment is active:

powershell
idf.py --version
# Expected output: ESP-IDF v6.0.x

Environment is session-scoped

You must run the export.ps1 script every time you open a new PowerShell window. To avoid this, add it to your PowerShell profile (see the VS Code Integration guide for a permanent setup).


Step 4 — Install USB Drivers

Connect your ESP32 board via USB. If Windows does not recognize it automatically:

  1. Open Device Manager (Win + X → Device Manager)
  2. Look for an unknown device under Other Devices
  3. Right-click → Update DriverSearch automatically

If auto-install fails, manually install the driver for your board's USB chip:

USB ChipDriver
CP2102 / CP2104Silicon Labs CP210x
CH340 / CH341CH341SER.exe
FTDI FT232FTDI VCP

After driver installation, your board will appear as COMx in Device Manager (e.g., COM3).


Step 5 — Verify the Installation

Create a test project to confirm everything works:

powershell
# First, activate the environment
. $env:USERPROFILE\.espressif\esp-idf-v6.0\export.ps1

# Copy the hello_world example
cd C:\Users\<YourName>\Documents
idf.py create-project-from-example "esp_system:hello_world"
cd hello_world

# Set target chip (change to esp32s3 or esp32c6 if needed)
idf.py set-target esp32

# Build the project
idf.py build

A successful build ends with:

text
Project build complete. To flash, run:
idf.py flash

Step 6 — Flash and Monitor

Connect your board and identify its COM port from Device Manager, then:

powershell
# Flash and open the serial monitor in one command
idf.py -p COM3 flash monitor

# To exit the monitor: press Ctrl + ]

You should see:

text
Hello world!
This is esp32 chip with 2 CPU core(s), WiFi/BT/BLE, silicon revision v3.1, 4MB external flash
Restarting in 10 seconds...

🎉 Your ESP-IDF v6 Windows environment is ready!


Troubleshooting

idf.py not found after running export.ps1

Make sure you ran the script with . (dot-space) at the beginning — this sources it into the current shell:

powershell
. $env:USERPROFILE\.espressif\esp-idf-v6.0\export.ps1

cmake version error during build

EIM should install CMake automatically. If you see a CMake version error, open EIM and use "Repair Installation" to reinstall the build tools.

Port access denied

Close any other applications using the COM port (Arduino IDE, PuTTY, etc.) before running idf.py flash.


Next Steps

Previous
Introduction to ESP-IDF