ESP32学习【1】——开发环境搭建(AiThinkerIDE

    技术2026-08-12  2

    一、准备

    开发环境:AiThinkerIDE_V1.0

    ESP_IDF:ESP_IDF

     

    二、导入项目

    1. 右键→Import

    2. 点开C/C++分支,并选中Existing Code as Makefile Project

    3. 去除C++支持,选中 Gross GCC,选择 esp-idf 路径

    4. 点击 Finish 完成esp-idf的导入

     

    三、配置项目

    1. 项目属性配置,鼠标选中esp-idf,右键菜单选择Properties → C/C++ Build 在 Build directory 选择需要编译的工程路径。

    示例:esp-idf/examples/get-started/hello_world 

    2. 添加IDF路径,在C/C++ Build → Environment中点击Add

    3、Name输入IDF_PATH,Value输入esp-idf 的路径

    4、配置好之后点击Apply,Ok

     

    四、构建menuconfig菜单

    1. 右击项目名称,菜单中选择Make Targets → Create

    2. 在弹出的对话框中取消勾选Same as the target name 与 User builder settings。

    在Target name输入规则名字 menuconfig,Build command中输入mintty.exe -e make menuconfig

    3. 执行上面刚刚创建的Make Targets,在右键菜单Make Targets → Build,在弹出的对话框,选择menuconfig,点击Build

    4.配置完成后,会弹出menuconfig窗口,在这里构建menuconfig

     

    五、编译默认项目

    Build Project :编译项目

    Clean Project:清理项目

    报错: 

    Pyserial is not installed for D:\Professional_Software\Python27\python.exe. Check the README for installation instructions. Traceback (most recent call last): File "E:/Document_Pro/ESP32/ESP-IDF/esp-idf/components/esptool_py/esptool/esptool.py", line 37, in <module> import serial ImportError: No module named serial make[1]: *** [/e/Document_Pro/ESP32/ESP-IDF/esp-idf/components/esptool_py/Makefile.projbuild:67: /e/Document_Pro/ESP32/ESP-IDF/esp-idf/examples/get-started/hello_world/build/bootloader/bootloader.bin] Error 1 make: *** [/e/Document_Pro/ESP32/ESP-IDF/esp-idf/components/bootloader/Makefile.projbuild:41: /e/Document_Pro/ESP32/ESP-IDF/esp-idf/examples/get-started/hello_world/build/bootloader/bootloader.bin] Error 2

    按照提示,需要安装 pySerial 串口通讯模块

    1、WIN + R输入CMD 进入命令窗口,使用 pip 来安装,使用以下命令:pip install pyserial

    2、按照提示执行升级 pip:pip install --upgrade pip 

     

    其他报错:

    esptool.py v2.8 The following Python requirements are not satisfied: future>=0.15.2 cryptography>=2.1.4 pyparsing>=2.0.3,<2.4.0 Please refer to the Get Started section of the ESP-IDF Programming Guide for setting up the required packages. Alternatively, you can run "D:\\Professional_Software\\Python27\\python.exe -m pip install --user -r E:/Document_Pro/ESP32/ESP-IDF/esp-idf\\requirements.txt" for resolving the issue. make: *** [E:\Document_Pro\ESP32\ESP-IDF\esp-idf/make/project.mk:501: check_python_dependencies] Error 1

    按照提示使用命令:python -m pip install --user -r E:/Document_Pro/ESP32/ESP-IDF/esp-idf\\requirements.txt 

     

    经过一番折腾,编译成功:

     

    六、烧录

    参考 ESP32学习【2】——ESP32固件烧录及相关问题解决

    Processed: 0.008, SQL: 9