Wiki
ESP32 Environment Setup
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

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

1.2.Get ESP-IDF

Check which version is currently the latest stable release

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

The image is what success looks like; anything different from the following means the download was unsuccessful. 
1.3.Setup Tool

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


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'

source ~/.bashrc

1.5.Configure VSCode
https://docs.espressif.com/projects/vscode-esp-idf-extension/zh_CN/latest/index.html
- Install the ESP-IDF plugin

- 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

It will automatically help you complete all toolchains

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


Next, configure openOCD:
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

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 
Click the tool to download 
and click to install the latest version, for example, here the latest version is v5.5.2

2.2.Install ESP-IDF
Click the downloaded esp-idf 


Select the hard disk partition where you want to install. For example, if I want to install it onC:\Espressif,那就是如下图这样。
如果你想安装在D盘,就把第一个C改成D。 
Check all the unchecked ones, and click Install 
Then click Finish 
If the pop-up dialog displays like this, the installation was successful 
2.3.Configure the environment
Open any folder, right-clickThis PC(此电脑)and click属性

Here is an advanced system setting 
Point environment variable 
Click New 

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


2.4.Configure VSCode
Install the following plugin

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

Click the first one 
Follow my instructions, then click Install 
This interface indicates the installation was successful 
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
- CP210x driver


Extract the compressed package downloaded earlier 
Right-clicksilabser.infClick安装
Installation complete 
- FTDI driver


Similarly, extract the downloaded archive

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


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



