Skip to content

Wiki

ESP32 Environment Setup

About 17 min read

1.Linux

Open the following website, https://docs.espressif.com/projects/esp-idf/zh_CN/stable/esp32/get-started/linux-macos-setup.html

1.1.Install dependencies

alt text

First step, follow what is shown on this website; if you are using Ubuntu

sudo apt-get install git wget flex bison gperf python3 python3-pip python3-venv cmake ninja-build ccache libffi-dev libssl-dev dfu-util libusb-1.0-0

If you are using Fedora

sudo dnf -y makecache && sudo dnf install git wget flex bison gperf python3 python3-setuptools cmake ninja-build ccache dfu-util libusbx

alt text

1.2.Get ESP-IDF

alt text

Check which version is currently the latest stable release

alt text

As shown in the figure above, this is version 5.5.2. Next, select a folder where you want to store the firmware. For example, I want to place it in the /home/tungchiahui/UserFolder/Applications/ folder (where /home/tungchiahui can be used~/ instead) Then

cd ~/UserFolder/Applications
mkdir -p ./esp
cd ./esp
# 记得版本号要改成最新稳定版(网络环境一定要好)
git clone -b v5.5.2 --recursive https://github.com/espressif/esp-idf.git

alt text

The image is what success looks like; anything different from the following means the download was unsuccessful. alt text

1.3.Setup Tool

alt text

cd ./esp-idf
# 选择国内服务器
export IDF_GITHUB_ASSETS="dl.espressif.cn/github_assets"
./install.sh all

alt text

alt text

The image above shows what success looks like. Here, you need to copy what I have circled in red (export.shpath), which will be used in the next environment configuration step. For example, the path I copied here is ~/UserFolder/Applications/esp/esp-idf/export.sh

1.4.Set environment variables

At this point, the tools that have just been installed have not yet been added to the PATH environment variable, so they cannot be used through the "Command Prompt." Therefore, some environment variables must be set. This can be done through another script provided by ESP-IDF.

vim ~/.bashrc

Add the following line (here you need to fill in your specific storage path, that is, the path string you just copied; remember to change the~to a $HOMEto increase robustness)

alias get_idf='. $HOME/UserFolder/Applications/esp/esp-idf/export.sh'

alt text

source ~/.bashrc

alt text

1.5.Configure VSCode

https://docs.espressif.com/projects/vscode-esp-idf-extension/zh_CN/latest/index.html

  1. Install the ESP-IDF plugin

alt text

  1. Click Express and choose a download server:

Click as shown in the figure. Since we have already configured the environment, do not select a version here; directly choose to locate it from my computer ESP-IDF

alt text

It will automatically help you complete all toolchains

alt text

If it displays like this in the lower-right corner, it is successful.

alt text

alt text

Next, configure openOCD: alt text Copy the line above, open a terminal (any terminal will do, no need to worry about the path), and run it

sudo cp --update=none /home/tungchiahui/.espressif/tools/openocd-esp32/v0.12.0-esp32-20250707/openocd-esp32/share/openocd/contrib/60-openocd.rules /etc/udev/rules.d

alt text

Finished!

2.Windows

Open the following website, https://docs.espressif.com/projects/esp-idf/zh_CN/stable/esp32/get-started/windows-setup.html

2.1.Download the installer

Check the current latest version, for example, my latest version here is v5.5.2 alt text

Click the tool to download alt text

and click to install the latest version, for example, here the latest version is v5.5.2

alt text

2.2.Install ESP-IDF

Click the downloaded esp-idf alt text

alt text

alt text

Select the hard disk partition where you want to install. For example, if I want to install it onC:\Espressif,那就是如下图这样。 alt text 如果你想安装在D盘,就把第一个C改成D。 alt text

Check all the unchecked ones, and click Install alt text

Then click Finish alt text

If the pop-up dialog displays like this, the installation was successful alt text

2.3.Configure the environment

Open any folder, right-clickThis PC(此电脑)and click属性 alt text

Here is an advanced system setting alt text

Point environment variable alt text

Click New alt text

alt text

Find this directory in the directory where IDF was just installed and click OK.

alt text

alt text

2.4.Configure VSCode

Install the following plugin

alt text

After installation is complete, click Open to start the wizard.

alt text

Click the first one alt text

Follow my instructions, then click Install alt text

This interface indicates the installation was successful alt text

2.5.Download serial port driver

Open the following website https://docs.espressif.com/projects/esp-idf/zh_CN/stable/esp32/get-started/establish-serial-connection.html

  1. CP210x driver

alt text

alt text

Extract the compressed package downloaded earlier alt text

Right-clicksilabser.infClick安装 alt text Installation complete alt text

  1. FTDI driver

alt text

alt text

Similarly, extract the downloaded archive

alt text

Right-click each of the following two items and click Install

alt text

alt text

  1. CH340 driver Open the website below https://www.wch.cn/products/ch340.html

alt text

alt text

alt text

alt text