Use one-key installation tool to quickly build ESP-IDF development environment (Windows)

We have received feedback from users that the ESP-IDF SDK software development environment is difficult to build and the threshold is high. In order to solve the problems of users in this regard. To this end, we launch this tutorial to introduce the use of one-click installation tools to quickly build an ESP-IDF development environment under the Windows operating system.

You can watch the tutorial video below, or read the graphic tutorial in the following article.

【Espressif Tutorial】|Use one-click installation tool to quickly build ESP-IDF development environment (Windows)

This tutorial is divided into the following three parts:

Part 1: Use the one-key installation tool to quickly build the ESP-IDF SDK software compilation environment——Windows

1. Download the ESP-IDF tool installer

2. Install the ESP-IDF software compilation environment

3. Simultaneously run multiple versions of the SDK software compilation environment in the same Windows environment

Part 2: Use the ESP-IDF CMD command line terminal to compile SDK routines——ESP-loT-Bridge

Part 3: Use VS Code to write SDK code or perform secondary development

Tips: Recommended operating system: 64 bit Windows 10 and above.

When setting up the development environment, please temporarily turn off the anti-virus software on the computer to avoid deleting files by mistake.


Part 1: Use the one-key installation tool to quickly build the ESP-IDF SDK software compilation environment——Windows

1. Download the ESP-IDF tool installer

First of all, we need to visit Espressif’s official website, search for “Programming Guide” in Support – Technical Documentation , and find “ ESP-IDF Programming Guide ”. The Quick Start chapter in the ESP-IDF Programming Guide is an introduction to quickly setting up the ESP-IDF development environment. Here we can find the installation instruction "Windows Installer" of ESP- IDF .

 Find the ESP-IDF tool installer on the page after the jump, and click the download link to download.

You can also directly click this link to download the ESP-IDF Tools Installer: ESP-IDF Tools Installer .

After the jump is successful, you can see the online version and offline version installation package of ESP-IDF .

 Regarding which version of the installation package to choose, we have the following suggestions:

  • If you use the Release version or Master version of the ESP-IDF SDK software development environment, you need to use the online installation package.
  • When using the online installation package to install, it is recommended that the computer be connected to a wired network to speed up the network speed.
  • If domestic users have difficulty accessing Github, it is recommended to check the Gitee mirror.

  • If you want to use the Tag version of the ESP-IDF SDK software development environment, it is recommended to use the offline installation package.
  • The offline installer does not require any network connection, and the installer includes all required dependency files such as Python, Git, cross-compiler, CMake, and Ninja build tools. These are all necessary tools for building firmware in ESP-IDF, so We prefer to use the offline installer for beginners.

The ESP-IDF SDK software environment is compatible with all Espressif ESP32 series products, but different series of ESP32 products require different ESP-IDF SDK versions, and the specific corresponding versions can be viewed in the ESP-IDF SDK software release notes on the official  website .

Note here:

  • If you need to use ESP32-C6 or ESP32-H2 series products, you need to select the Master version of the SDK in the ESP-IDF version selection.
  • If there is no special requirement, we recommend using the latest Tag or Release version of the SDK.

In addition, for the development workflow of ESP-IDF and the specific differences between different versions, you can visit the link to view: ESP-IDF Version Introduction - ESP32 - — ESP-IDF Programming Guide latest document

In this tutorial, the offline version installation package is used to demonstrate the software compilation environment for installing ESP-IDF Tag v5.0.

2. Install the ESP-IDF software compilation environment

First, click Run to install the package and select a locale.

 Tick ​​to agree to this agreement and proceed to the next step.

 Wait for the system check to complete before proceeding to the next step.

 Select the path where the ESP-IDF compilation tool is installed, and click Next.

 In the configuration interface, you can choose to install the serial port driver and USB driver for the ESP series products, and you can also check the required product series. After the setting is complete, go to the next step.

 Check the installation path and click Install to complete. It takes about 4 minutes to wait here.

 After the installation is complete, the ESP-IDF CMD terminal is generated on the desktop, open the terminal, and when the terminal successfully prints the "idf.py build" command, it means that our environment has been installed successfully.

3.   Simultaneously run multiple versions of the SDK software compilation environment in the same Windows environment

We have noticed that people have doubts about "whether multiple versions of the SDK software compilation environment are supported in the same Windows environment". In fact, multiple versions of the SDK can coexist in the same Windows environment.

We run the "idf.py build" command to compile the code in two terminals in different environments. We can see that when we use different versions of the SDK CMD terminal compilation environment to compile routines, they can be compiled successfully independently without any restrictions. , will not interfere with each other. After the compilation is completed, the log will be printed, which will display the firmware generated by the current compilation project and the download address of the corresponding firmware, and prompt us to use the "idf.py -p (PORT) flash" command to burn the firmware.

 If we want to switch the chip environment , we can run the target command, such as: "idf.py set-target esp32s3", where S3 is the specific chip environment. After switching the chip environment, we recompile the routine to see that the chip environment has been switched successfully.

 So far, the quick construction of the ESP-IDF SDK software compilation environment using the one-click installation tool in the Windows environment has been completed.

Part 2: Use the ESP-IDF CMD command line terminal to compile SDK routines——ESP-loT-Bridge

Next, we will demonstrate how to use the ESP-IDF CMD software compilation environment to compile the SDK routines of other Espressif solutions. Here we demonstrate the software compilation of the ESP-IoT-Bridge gateway solution SDK .

We can use the terminal environment of ESP-IDF CMD to first clone the required SDK source code. Enter the upper directory, put all the SDKs to be cloned into the ESP directory, and we get the clone link in the SDK directory: https://github.com/espressif/esp-iot-bridge.git

Here we clone the Master version of the ESP-IoT-Bridge SDK. If we need a specific version of the SDK, we only need to add -b branch (branch is the specific version number) to the clone command to specify to clone a specific version of the SDK.

 After the SDK is cloned, you also need to clone the sub-warehouse corresponding to the SDK:

  • Run the "git submodule update --init --recursive" command to clone the subrepo
  • Run the "git pull" command to confirm that the current SDK is the latest

 Then we need to check the IDF version number supported by the ESP-IoT-Bridge SDK , and we can see that it has been adapted to IDF Release v5.0.

Next, test the corresponding SDK routines. Run the "dir" command to view the current directory.

 We use the cd command to enter the directory of the routine, and then use the "idf.py build" command to compile the routine.

 Now we can see that we use the ESP-IDF v5.0 version of the CMD terminal environment to compile the routines under ESP-IoT-Bridge has been successfully compiled. The firmware generated by the current compilation project and the download address of the corresponding firmware will be displayed in the compiled log.

 Similarly, compiling other SDK routines such as ESP-IoT-Solution and ESP-Mesh-Lite is the same as the above operation steps.

Part 3: Use VS Code to write SDK code or perform secondary development

If the user needs to carry out secondary development based on the routines in the SDK, we can run the "code ." command on the "ESP-IDF CMD" terminal, and use the VS Code code editing environment to open our SDK for code writing and secondary development.

 We recommend using "ESP-IDF CMD project compilation environment + VS Code code editor", which has the following advantages:

  • Easy version maintenance, update and management
  • Software environment that supports easy switching of different chips
  • Support compiling SDK routines of other application solutions released by Espressif.

The above is the entire content of this teaching session. The resources involved in this teaching session can be obtained by referring to the relevant links below. If you have any questions, you can go to Espressif’s official website to view relevant technical documents for help. Welcome to leave a message in the comment area for discussion, or contact us at any time .


Related Links

Guess you like

Origin blog.csdn.net/espressif/article/details/131207240