【重要】23集 搭建ESP-IDF和VSCODE开发环境 编译Helloword和AI聊天工程-《MCU嵌入式AI开发笔记》

【重要】23集 搭建ESP-IDF和VSCODE开发环境 编译Helloword和AI聊天工程-《MCU嵌入式AI开发笔记》

参考文档:

https://lceda001.feishu.cn/wiki/Xqx3wH8wMi3BrrkmeTXcgLL7nQk

我们修改了secretkey等,之后我们修改menuconfig

配置menuconfig

之后出现问题了:问题见下面:你遇到这个问题了么?

评论区讨论留言

里面有个error:

---------------------------ERROR--------------------------

CMake Error at D:/ESP-IDF/tools/cmake/build.cmake:544 (message):

ERROR: Because espressif/esp_lcd_touch_ft5x06 (1.0.6) depends on

espressif/esp_lcd_touch (^1.0.4) which doesn't match any versions,

那我们看

esp_lcd_touch_ft5x06 (1.0.6)这个没有依赖。

我们在乐鑫官网上找一下

https://components.espressif.com/components?q=esp_lcd_touch_ft5x06

我们点进去

之后在vscode里面执行这个命令:

idf.py add-dependency esp_lcd_touch_ft5x061.0.0
但是出现如下错误:
PS D:\workspace\esp-idf\ai_chat> idf.py add-dependency esp_lcd_touch_ft5x061.0.0

idf.py : 无法将"idf.py"项识别为 cmdlet、函数、脚本文件或可运行程序的名称。请检查名称的拼写,如果包括路径,请确保路径正确

,然后再试一次。

所在位置 行:1 字符: 1

  • idf.py add-dependency esp_lcd_touch_ft5x06==1.0.0
复制代码
    + CategoryInfo          : ObjectNotFound: (idf.py:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException
    + 

要解决VSCODE里面无法识别idf.py这个问题了。

重新安装ESP-IDF

先卸载,我们的版本有问题:

之后打开https://dl.espressif.cn/dl/esp-idf/?idf=4.4,

看一下版本:

选择5.2.2版本的离线安装版本。下载到如下位置:

e:\technology\ESP32\esp-idf-tools-setup-offline-5.2.2.exe

之后点击安装。

这回有framework了,之前安装的版本里面没有。

开始安装。

等待。

安装完成。

我们老老实实的先玩转hello word例程。

把hello word放到如下目录

D:\workspace\esp-idf\hello_world

在vscode里面打开目录到此。
分别设置esp32c3 和menuconfig,把flash设置成8M,之后我们点击build按钮开始编译

等待看看编译结果。

开来这回编译环境是真的搭建正确了。

之后我们打开AI-CHAT工程。menuconfig

但是提示:

0;33mHINT: The component **audio_sal** could not be found. This could be because: component name was misspelled, the component was not added to the build, the component has been moved to the IDF component manager or has been removed and refactored into some other component. Please look out for component in 'https://components.espressif.com' and add using \*\* 'idf.py add-dependency'\*\* command. 所以我们打开https://components.espressif.com 这里找不到这个audio_sal,所以猜测应该是需要再次安装esp-ADF ![在这里插入图片描述](https://i-blog.csdnimg.cn/direct/280e7f721ac94984adb94885e0d965ef.png) 我们安装esp-adf,之后选择本地的目录和gitee。 ![在这里插入图片描述](https://i-blog.csdnimg.cn/direct/be7602d0e13347039342d7957e3bf71c.png) ![在这里插入图片描述](https://i-blog.csdnimg.cn/direct/7bbbe323054543a48d8a0497a46de97d.png) 开始安装 ![在这里插入图片描述](https://i-blog.csdnimg.cn/direct/b7d75c5fc6a54c39a3b4b09d7f54a349.png) 但是安装提示无法clone,应该是下载不了。所以直接下载到本地 e:\\technology\\ESP32\\esp-adf.7z,之后解压到Espressif文件夹内。 下载,等待。 同时在重新安装以下esp-adf 把原来的改名 ![在这里插入图片描述](https://i-blog.csdnimg.cn/direct/d589420d330444d2a17265f9f0bd2111.png) 之后vscode里面重新安装esp-adf ![在这里插入图片描述](https://i-blog.csdnimg.cn/direct/c6de8a0519a246758098761e44769d48.png) ![在这里插入图片描述](https://i-blog.csdnimg.cn/direct/8edfb4434b0942139664b244a276fb6c.png) 看一下这次是否安装成功。还是如下问题,看来 ![在这里插入图片描述](https://i-blog.csdnimg.cn/direct/316ae2f5a54144c9b5280117c135401b.png) 算了,还是消停的等待把esp-adf下载到本地吧 还有一种方法: ![在这里插入图片描述](https://i-blog.csdnimg.cn/direct/2a9340320ba24699a1c0a485ab836e20.png) 看看能否成功。还是不行,还是等下载整个esp-adf包吧。 下载完成,我们直接解压缩,把esp-adf 拷贝到espressif目录下: ![在这里插入图片描述](https://i-blog.csdnimg.cn/direct/0be38c2e224445959e4c98b32c24f31c.png) 安装好后我们看一下 C:\\Users\\phlr\\AppData\\Roaming\\Code\\User\\settings.json ![在这里插入图片描述](https://i-blog.csdnimg.cn/direct/db3eda87c163487fa0e44a2b881b1143.png) 这回我们在看看vscode ![在这里插入图片描述](https://i-blog.csdnimg.cn/direct/6db7094db6864a98b5b841d77bbdfecb.png) 这回看着往下执行了。 等待吧 ### menuconfig配置 1:配置flash ![在这里插入图片描述](https://i-blog.csdnimg.cn/direct/6a60b4c9ce224833b2138da80fc26de4.png) 2:确认分区表选择的是自定义,名称是partitions.csv。 ![在这里插入图片描述](https://i-blog.csdnimg.cn/direct/ffea465b880f400790fcccd41badacd8.png) 3:确认开发板型号,是自定义的板子。 ![在这里插入图片描述](https://i-blog.csdnimg.cn/direct/7fad70bf91bd44fc8b84a0758c9a98cc.png) 4:确定勾选Swap the 2 bytes of RGB565 ![在这里插入图片描述](https://i-blog.csdnimg.cn/direct/a5f01bd37db541049bf9c41a5550934f.png) 5:确定LVGL的内存设置为下图所示: ![在这里插入图片描述](https://i-blog.csdnimg.cn/direct/672d24c3f512438cb836cc8c0e980e28.png) 6:确认勾选允许大量字符。 ![在这里插入图片描述](https://i-blog.csdnimg.cn/direct/3593450c17e1488794a137dc053c665f.png)7:确认LVGL的第三方库GIF解码库被勾选 ![在这里插入图片描述](https://i-blog.csdnimg.cn/direct/92ccaa2d7624430b82c573134ee518ce.png) 经过上面的配置,现在就可以编译下载了,下载好程序后,就可以体验了。 我们save一下。之后编译。 等待: ![在这里插入图片描述](https://i-blog.csdnimg.cn/direct/8cf583681394438cbcf24f7131178033.png) ![在这里插入图片描述](https://i-blog.csdnimg.cn/direct/aaccb6f8d0794e878e3411aa2dd558b2.png) 至此,编译完成。可以下载了,我们下一集开始下载。 附件:错误信息: == SDK Configuration Editor

---------------------------ERROR--------------------------

WARNING: Python interpreter "D:\Espressif\python_env\idf5.2_py3.11_env\Scripts\python.exe" used to start idf.py is not from installed venv "D:/Espressif/python_env/idf5.2_py3.11_env"

-----------------------END OF ERROR-----------------------

Executing action: confserver

Running cmake in directory D:\workspace\esp-idf\ai_chat\build

Executing "cmake -G Ninja -DPYTHON_DEPS_CHECKED=1 -DPYTHON=D:\Espressif\python_env\idf5.2_py3.11_env\Scripts\python.exe -DESP_PLATFORM=1 -DCCACHE_ENABLE=1 D:\workspace\esp-idf\ai_chat"...

-- Found Git: D:/Espressif/tools/idf-git/2.44.0/cmd/git.exe (found version "2.44.0.windows.1")

-- ccache will be used for faster recompilation

-- The C compiler identification is GNU 13.2.0

-- The CXX compiler identification is GNU 13.2.0

-- The ASM compiler identification is GNU

-- Found assembler: D:/Espressif/tools/riscv32-esp-elf/esp-13.2.0_20230928/riscv32-esp-elf/bin/riscv32-esp-elf-gcc.exe

-- Detecting C compiler ABI info

-- Detecting C compiler ABI info - done

-- Check for working C compiler: D:/Espressif/tools/riscv32-esp-elf/esp-13.2.0_20230928/riscv32-esp-elf/bin/riscv32-esp-elf-gcc.exe - skipped

-- Detecting C compile features

-- Detecting C compile features - done

-- Detecting CXX compiler ABI info

-- Detecting CXX compiler ABI info - done

-- Check for working CXX compiler: D:/Espressif/tools/riscv32-esp-elf/esp-13.2.0_20230928/riscv32-esp-elf/bin/riscv32-esp-elf-g++.exe - skipped

-- Detecting CXX compile features

-- Detecting CXX compile features - done

-- git rev-parse returned 'fatal: not a git repository (or any of the parent directories): .git'

-- Could not use 'git describe' to determine PROJECT_VER.

-- Building ESP-IDF components for target esp32c3

Dependencies lock doesn't exist, solving dependencies.

Using component placed at D:\workspace\esp-idf\ai_chat\components\espressif__esp_lcd_touch_ft5x06 for dependency espressif/esp_lcd_touch_ft5x06(^1.0.6), specified in D:/workspace/esp-idf/ai_chat/main\idf_component.yml

...Using component placed at D:\workspace\esp-idf\ai_chat\components\espressif__esp_lcd_touch_ft5x06 for dependency espressif/esp_lcd_touch_ft5x06(^1.0.6), specified in D:/workspace/esp-idf/ai_chat/main\idf_component.yml

---------------------------ERROR--------------------------

CMake Error at D:/ESP-IDF/tools/cmake/build.cmake:544 (message):

ERROR: Because espressif/esp_lcd_touch_ft5x06 (1.0.6) depends on

espressif/esp_lcd_touch (^1.0.4) which doesn't match any versions,

-----------------------END OF ERROR-----------------------

---------------------------ERROR--------------------------

espressif/esp_lcd_touch_ft5x06 is forbidden.

So, because project depends on espressif/esp_lcd_touch_ft5x06 (1.0.6),

version solving failed.

Call Stack (most recent call first):

D:/ESP-IDF/tools/cmake/project.cmake:605 (idf_build_process)

CMakeLists.txt:8 (project)

-----------------------END OF ERROR-----------------------

...-- Configuring incomplete, errors occurred!

See also "D:/workspace/esp-idf/ai_chat/build/CMakeFiles/CMakeOutput.log".

---------------------------ERROR--------------------------

cmake failed with exit code 1, output of the command is in the D:\workspace\esp-idf\ai_chat\build\log\idf_py_stderr_output_19612 and D:\workspace\esp-idf\ai_chat\build\log\idf_py_stdout_output_19612

-----------------------END OF ERROR-----------------------

---------------------------ERROR--------------------------

SDK Configuration editor confserver process exited with code: 2

-----------------------END OF ERROR----------------------- ==

相关推荐
ccut 第一混9 分钟前
c# 使用yolov5模型
人工智能·深度学习
PHOSKEY10 分钟前
应用案例丨3D工业相机如何实现「焊接全工序守护」
人工智能
喜欢吃豆38 分钟前
从指令到智能:大型语言模型提示词工程与上下文工程的综合分析
人工智能·语言模型·自然语言处理·大模型·提示词工程·上下文工程
Fuly102442 分钟前
prompt构建技巧
人工智能·prompt
XXX-X-XXJ1 小时前
二:RAG 的 “语义密码”:向量、嵌入模型与 Milvus 向量数据库实操
人工智能·git·后端·python·django·milvus
艾醒(AiXing-w)1 小时前
探索大语言模型(LLM):大模型微调方式全解析
人工智能·语言模型·自然语言处理
科兴第一吴彦祖1 小时前
基于Spring Boot + Vue 3的乡村振兴综合服务平台
java·vue.js·人工智能·spring boot·推荐算法
姚瑞南1 小时前
【AI 风向标】四种深度学习算法(CNN、RNN、GAN、RL)的通俗解释
人工智能·深度学习·算法
_李小白1 小时前
【OPENGL ES 3.0 学习笔记】第一天:认识渲染管道
笔记·学习
future14121 小时前
单片机学习日记
单片机·嵌入式硬件·学习