ESP-IDF Setup
This tutorial walks through installing ESP-IDF inside Visual Studio Code. By the end, you will have a working toolchain that can compile and flash firmware to the ESP32-P4.
Platform prerequisites
Section titled “Platform prerequisites”Before installing VSCode and the ESP-IDF extension, your operating system needs certain build dependencies.
Install the required system packages:
sudo apt updatesudo apt install git wget flex bison gperf python3 python3-pip \ python3-venv cmake ninja-build ccache libffi-dev libssl-dev \ dfu-util libusb-1.0-0See the full list at Espressif’s Linux prerequisites.
Install Xcode command line tools and Homebrew dependencies:
xcode-select --installbrew install cmake ninja dfu-util python3See Espressif’s macOS prerequisites for details.
Windows requires fewer manual prerequisites since the ESP-IDF installer bundles most tools. You will need:
- Git for Windows: git-scm.com
- Python 3.9+: python.org (check “Add to PATH” during install)
See Espressif’s Windows prerequisites for the full walkthrough.
Install VSCode
Section titled “Install VSCode”-
Download Visual Studio Code from code.visualstudio.com.
-
Run the installer for your platform.
-
Launch VSCode and verify it opens correctly.
Install the ESP-IDF extension
Section titled “Install the ESP-IDF extension”-
Open VSCode and navigate to the Extensions panel (Ctrl+Shift+X / Cmd+Shift+X).
-
Search for “ESP-IDF” and install the extension published by Espressif Systems.
-
After installation, the ESP-IDF setup wizard should open automatically. If it does not, open the Command Palette (Ctrl+Shift+P / Cmd+Shift+P) and run ESP-IDF: Configure ESP-IDF Extension.
-
Select EXPRESS install mode. This is the simplest path — it downloads and configures everything for you.
-
When prompted for the ESP-IDF version, select v5.3.1 or later (v5.4.x is recommended if available).
-
Choose an installation directory. The defaults are usually fine:
- Linux/macOS:
~/esp/esp-idf - Windows:
C:\Espressif\frameworks\esp-idf
- Linux/macOS:
-
Click Install and wait for the process to complete.
Verify the installation
Section titled “Verify the installation”-
Open the Command Palette and run ESP-IDF: Show Examples Projects.
-
Select hello_world from the
get-startedcategory. -
Choose a directory to create the project in.
-
At the bottom status bar, click the chip target selector and choose ESP32-P4.
-
Open the integrated terminal (Ctrl+`) and run:
Terminal window idf.py --versionYou should see the ESP-IDF version (v5.3.1+).
Notes on ESP32-P4 clock speed
Section titled “Notes on ESP32-P4 clock speed”The ESP32-P4 features a dual-core RISC-V processor. The current ESP-IDF SDK configures the CPU clock at 360 MHz by default. While the silicon supports 400 MHz, full SDK support for that clock rate is not yet available. For most workloads the difference is negligible, and 360 MHz provides stable operation across all supported peripherals.
What to do next
Section titled “What to do next”Your toolchain is ready. Proceed to First Flash to connect the board and upload your first program.