2. ESP32-S2-Kaluga-1 development environment ESP-IDF construction
[Copy link]
This article introduces the process of building the ESP-IDF environment for ESP32-S2-Kaluga-1.
1. Review of previous pitfalls
I have done ESP32 development with Arduino and MicroPython, and have also tried the Platform IO IDE method. I really want to experience the official IDF, so I purchased an ESP32-LyraT-Mini development board at the beginning of the year.
However, I made a mistake here (let's call it "IDE dependence"): I used VS Code + Espressif IDF plug-in, and relied entirely on the plug-in to download and deploy IDF. In order to adapt to the development board, I also tried to deploy ADF.
The result is predictable. I was extremely anxious due to the poor internet speed on GitHub. I finally managed to download IDF, but failed to download ADF. I fiddled with the console and successfully killed IDF. Finally, I decided to let the LyraT-Mini board gather dust.
2. The IDF process
This time, I participated in the 2022 Digi-Key Innovation Design Competition and applied for the Kaluga kit, so I decided to redeploy IDF and finally successfully achieved build + flash.
1) Select the official download site of Espressif
Because the experience of using GitHub has always been poor, this time I decided to bypass the official download from Espressif. The ESP-IDF document (https://docs.espressif.com/projects/esp-idf/zh_CN/latest/esp32/get-started/windows-setup.html) has an introduction to manual installation and a link to download Windows Installer Download (https://dl.espressif.cn/dl/esp-idf/?idf=4.4).
Figure 2-1 ESP-IDF official website download
2) Installation
Here my IDE dependency syndrome struck again. I downloaded the Espressif-IDE version and installed the IDE (based on Eclipse) and IDF v4.4 at the same time.
After customizing and completely installing all components, three shortcuts are generated on the desktop:
Espressif-IDE: Point to ..\espressif\tools\espressif-ide\2.5.0\espressif-ide.exe to open the IDE.
ESP-IDF 4.4 CMD: Open a CMD window and set the path environment variable. In the opened console, add a temporary variable to the path to point to the IDF build related tools. Also set the Python virtual machine, Git and temporarily create the environment variable IDF_PATH.
ESP-IDF 4.4 PowerShell: Open a PowerShell window in the same way as above.
Figure 2-2 Complete installation and shortcut creation
Figure 2-3 Initial results of ESP-IDF 4.4 CMD operation
3) IDE usage failure
The IDE installed here always prompts to install tools when creating a project, but does not prompt what tools to install, and the installation progress is always stuck at 20% (personally guess it is still a problem with GitHub)
Figure 2-4 Espressif-IDE failed to create an IDF project
4) Console operation is successful
So I just used the console to operate, followed the command instructions step by step, and finally successfully compiled the hello_world project.
First, copy the hello_world project in IDF to your own workspace.
Again, IDF CMD changes to the copied project directory.
Next, execute the command "idf.py set-target esp32s2" to set the device selection. Here, "idf.py menuconfig" is skipped, which is the component configuration step.
Then, execute the command "idf.py build".
Finally, plug in the development board (two micro ports, one for power supply and one for USB-TTL), and execute the command "idf.py -p COMn flash". Note that COMn should be replaced with the number recognized by your PC.
Figure 2-5 IDF CMD compilation process
Figure 2-6 IDF CMD programming process
Figure 2-7 Operation phenomenon
|