ESPRESSIF IDF Extension For Visual Studio Code Table of Contents (TOC)
ESPRESSIF IDF Extension For Visual Studio Code Table of Contents (TOC)
e80c37e148
brianignacio5 fix docs links and show prerequisites link in setup wizard (#528) …
1 contributor
NOTE: Make sure to install the extension prerequisites and, if using WSL2, the
required packages specified in WSL Documentation.
https://github.com/espressif/vscode-esp-idf-extension/blob/HEAD/docs/SETUP.md 1/6
2021/12/25 vscode-esp-idf-extension/SETUP.md at e80c37e14833851afcf8b7d24026a60e8a2dea2e · espressif/vscode-esp-idf-extension · Git…
When you start ESP-IDF extension, it will try to self-configure by looking for existing
ESP-IDF directory in IDF_PATH environment variable, $HOME/esp/esp-idf on
MacOS/Linux and %USERPROFILE%\esp\esp-idf or %USERPROFILE%\Desktop\esp-idf in
Windows. It will look for ESP-IDF Tools and ESP-IDF Python virtual environment in
IDF_TOOLS_PATH environment variable, $HOME\.espressif on MacOS/Linux and
%USERPROFILE%\.espressif on Windows.
If ESP-IDF and corresponding ESP-IDF tools are found, these paths will be saved as
Visual Studio Code Configuration settings, which are located in Command Palette (F1 or
View Menu -> Command Palette) and type Preferences: Open Settings (UI) or
Command Palette (F1 or View Menu -> Command Palette) and type Preferences: Open
Settings (JSON) .
NOTE: Visual Studio Code has many places where to set configuration settings.
This extension uses the idf.saveScope configuration setting to determine where
to save settings, Global (User Settings), Workspace and WorkspaceFolder. Please
review the visual studio code settings precedence.
If ESP-IDF and ESP-IDF tools are not available, you can use the Setup Wizard to
download them and configure the extension for you or manually configure the
extension as explained in JSON Manual Configuration or Settings UI Manual
Configuration .
Setup Wizard
With Visual Studio Code Command Palette (F1 or View Menu -> Command Palette) and
type ESP-IDF: Configure ESP-IDF extension.
https://github.com/espressif/vscode-esp-idf-extension/blob/HEAD/docs/SETUP.md 2/6
2021/12/25 vscode-esp-idf-extension/SETUP.md at e80c37e14833851afcf8b7d24026a60e8a2dea2e · espressif/vscode-esp-idf-extension · Git…
iii. Create python virtual environment with required packages on existing ESP-IDF
Tools directory.
Advanced install: Configurable option.
i. Choose to either download selected ESP-IDF version or find ESP-IDF in your
system.
ii. Download or use existing ESP-IDF Tools:
Choose directory for ESP-IDF Tools and install ESP-IDF Tools. This step will
update the existing value in idf.toolsPath or idf.toolsPathWin .
Specify directory than contains executable for each required ESP-IDF tool
with matching version.
iii. Create python virtual environment with required packages in chosen ESP-IDF
Tools directory.
Use existing setup: This option will use an existing setup if:
i. esp-idf.json is found in the current idf.toolsPath (MacOS/Linux users) or
idf.toolsPathWin (Windows users). This file is generated when you install
ESP-IDF with the IDF Windows installer or using IDF-ENV.
ii. ESP-IDF is found in idf.espIdfPath or idf.espIdfPathWin , IDF_PATH
environment variable, $HOME/esp/esp-idf on MacOS/Linux and
%USERPROFILE%\esp\esp-idf or %USERPROFILE%\Desktop\esp-idf in Windows.
iii. ESP-IDF Tools and ESP-IDF Python virtual environment for the previos ESP-IDF
are found in idf.toolsPath or idf.toolsPathWin , IDF_TOOLS_PATH
environment variable, $HOME\.espressif on MacOS/Linux and
%USERPROFILE%\.espressif on Windows.
NOTE: Make sure that IDF_PATH and IDF_TOOLS_PATH doesn't have any spaces to
avoid any build issues.
After choosing any of the previous options, a status page is displayed showing ESP-IDF,
tools and python environment setup progress status. When the setup is finished, a
message is shown that "All settings have been configured. You can close this window."
1. With Visual Studio Code Command Palette (F1 or View Menu -> Command
Palette) and type Preferences: Open Settings (JSON). This will open the user
global settings for Visual Studio Code.
https://github.com/espressif/vscode-esp-idf-extension/blob/HEAD/docs/SETUP.md 3/6
2021/12/25 vscode-esp-idf-extension/SETUP.md at e80c37e14833851afcf8b7d24026a60e8a2dea2e · espressif/vscode-esp-idf-extension · Git…
NOTE: The user could choose to modify its workspace settings.json for a
workspace limited configuration or a project limited configuration in the
project's .vscode/settings.json . Please take a look at Working with multiple
projects.
MacOS/Linux
{
"idf.espIdfPath": "path/to/esp-idf",
"idf.customExtraPaths": "UPDATED_PATH",
"idf.customExtraVars": "{\"OPENOCD_SCRIPTS\":\"OPENOCD_FOLDER/share/openocd/scr
"idf.pythonBinPath": "PYTHON_INTERPRETER",
"idf.openOcdConfigs": [
"interface/ftdi/esp32_devkitj_v1.cfg",
"board/esp32-wrover.cfg"
],
"idf.port": "DEVICE_PORT"
}
Windows
{
"idf.espIdfPathWin": "path/to/esp-idf",
"idf.customExtraPaths": "UPDATED_PATH",
"idf.customExtraVars": "{\"OPENOCD_SCRIPTS\":\"OPENOCD_FOLDER/share/openocd/scr
"idf.pythonBinPathWin": "PYTHON_INTERPRETER",
"idf.openOcdConfigs": [
"interface/ftdi/esp32_devkitj_v1.cfg",
"board/esp32-wrover.cfg"
],
"idf.portWin": "DEVICE_PORT"
}
where:
https://github.com/espressif/vscode-esp-idf-extension/blob/HEAD/docs/SETUP.md 4/6
2021/12/25 vscode-esp-idf-extension/SETUP.md at e80c37e14833851afcf8b7d24026a60e8a2dea2e · espressif/vscode-esp-idf-extension · Git…
NOTE: Make sure that your configurations settings doesn't have any spaces to
avoid any build issues.
Make sure to install the extension and extension debug adapter Python requirements
by running the following commands in your terminal:
where EXTENSION_PATH is
%USERPROFILE%\.vscode\extensions\espressif.esp-idf-extension-VERSION on
Windows
$HOME/.vscode/extensions/espressif.esp-idf-extension-VERSION on Linux/MacOS
UI Manual Configuration
This is the same as JSON Manual Configuration but the name of each configuration
setting is the description given in the ESP-IDF Settings. This method also need to install
extension and debug adapter requirements.txt as shown in the previous section.
/home/myUser/.espressif/python_env/idf4.0_py3.5_env/bin/python
C:\Users\myUser\.espressif\python_env\idf4.0_py3.5_env\Scripts\python.exe
https://github.com/espressif/vscode-esp-idf-extension/blob/HEAD/docs/SETUP.md 5/6
2021/12/25 vscode-esp-idf-extension/SETUP.md at e80c37e14833851afcf8b7d24026a60e8a2dea2e · espressif/vscode-esp-idf-extension · Git…
Linux/MacOS
/home/myUser/.espressif/tools/openocd/version/openocd-
esp32/bin:/home/myUser/.espressif/tools/xtensa-esp32/version/xtensa-esp32/bin
Windows
C:\Users\myUser\.espressif\tools\openocd-esp32\version\openocd-
esp32\bin;C:\Users\myUser\.espressif\tools\xtensa-esp32\version\xtensa-
esp32\bin
"idf.customExtraVars": "
{\"OPENOCD_SCRIPTS\":\"/home/myUser/.espressif/tools/openocd-
esp32/version/openocd-esp32/share/openocd/scripts\"}"
https://github.com/espressif/vscode-esp-idf-extension/blob/HEAD/docs/SETUP.md 6/6