34集-35集 【完整版小白上手环境搭建】玩转ESP-ADF实现AIGC大模型对话功能-1-《MCU嵌入式AI开发笔记》
参考文档:
1、ESP32-S3-Korvo-2 V3.0的说明文档:
https://espressif-docs.readthedocs-hosted.com/projects/esp-adf/zh-cn/latest/design-guide/dev-boards/user-guide-esp32-s3-korvo-2.html
2、说明文档里面有esp-adf的get start这篇文档。
https://espressif-docs.readthedocs-hosted.com/projects/esp-adf/zh-cn/latest/get-started/index.html
但是ESP-IDF的S3的S3 stable 5.3的参考文档:
https://docs.espressif.com/projects/esp-idf/zh_CN/stable/esp32s3/index.html
** 里面get-started文档如下:这个重点看的,需要更新安装:**
https://docs.espressif.com/projects/esp-idf/zh_CN/stable/esp32s3/get-started/index.html
3、esp-adf的例子程序里面有说明文档:
https://github.com/espressif/esp-adf/tree/dac74d81c85b5bc4e9da008031f31394943fa2c7/examples/cloud_services/pipeline_baidu_speech_mp3
整理
整体参考文档是ESP32-S3-Korvo-2 V3.0:
https://espressif-docs.readthedocs-hosted.com/projects/esp-adf/zh-cn/latest/get-started/index.html#step-1-set-up-esp-idf
1、卸载之前的安装版本。并在vscode里面卸载插件。
2、根据get-started 重新安装esp-idf
https://docs.espressif.com/projects/esp-idf/zh_CN/stable/esp32s3/get-started/index.html
根据这篇文档指引下载安装:
https://docs.espressif.com/projects/esp-idf/zh_CN/stable/esp32s3/get-started/windows-setup.html
里面根据https://dl.espressif.cn/dl/esp-idf/?idf=4.4,下载esp-idf 5.3 stable版本。
之后开始安装:
使用嵌入式 Python 3.11.2
使用嵌入式 Git :
D:\Espressif\tools\idf-git\2.44.0\cmd\git.exe
即将安装 ESP-IDF 5.3 into:
D:\Espressif\frameworks\esp-idf-v5.3
IDF 工具目录(IDF_TOOLS_PATH):
D:\Espressif
Components:
驱动程序: FTDI Sillicon Labs Espressif WCH
Targets: ESP32 ESP32-C3 ESP32-C6 ESP32-S2 ESP32-S3 ESP32-P4
3、安装完esp-idf之后编译hello_world
还是根据这篇文档https://docs.espressif.com/projects/esp-idf/zh_CN/stable/esp32s3/get-started/windows-setup.html,进行menuconfig,
cd %userprofile%\esp\hello_world
idf.py set-target esp32s3
具体编译命令如下:
之后配置menuconfig:idf.py menuconfig,
出现下面的界面,证明idf环境已经欧克了。
之后
请使用以下命令,编译烧录工程:
idf.py build
之后
请运行以下命令,将刚刚生成的二进制文件烧录至 ESP32-S3 开发板:
idf.py -p PORT flash
烧录完可以可以使用 idf.py -p PORT monitor 命令,监视 “hello_world” 工程的运行情况。注意,不要忘记将 PORT 替换为自己的串口名称。
运行该命令后,IDF 监视器 应用程序将启动。此时,就可以在启动日志和诊断日志之后,看到打印的 “Hello world!” 了。
使用快捷键 Ctrl+],可退出 ESP-IDF 监视器。
这样确定ESP-IDF欧克了。
安装esp-adf
继续参考文档:https://espressif-docs.readthedocs-hosted.com/projects/esp-adf/zh-cn/latest/get-started/index.html#step-2-get-esp-adf
在d:\Espressif\直接执行:
git clone --recursive https://gitee.com/EspressifSystems/esp-adf.git
或者这个命令:git clone https://gitee.com/EspressifSystems/esp-adf.git
之后可能还需单独clone如下两个模块:
git clone https://gitee.com/esp-components/esp-sr.git
git clone https://gitee.com/esp-components/esp-adf-libs.git
35集 【完整版小白上手环境搭建】玩转ESP-ADF实现AIGC大模型对话功能-1-《MCU嵌入式AI开发笔记》
继续安装esp-adf
我们打开:“ESP-IDF Command Prompt” shortcut
之后输入命令D:\Espressif\esp-adf\export.bat
有一个warning:
WARNING: Error while accessing the ESP-IDF version file in the Python environment: [Errno 2] No such file or directory: ‘D:\Espressif\python_env\idf5.3_py3.11_env\idf_version.txt’
我们先记录下来。
后面呢又有一个error
Done! You can now compile ESP-IDF projects.
Go to the project directory and run:
idf.py build
Applying patch D:\Espressif\esp-adf\idf_patches\idf_v5.3_freertos.patch
The following command can be executed now to view detailed usage:
idf.py --help
Compilation example (The commands highlighted in yellow below are optional: Configure the chip and project settings separately)
cd D:\Espressif\esp-adf\examples\cli
idf.py set-target esp32
idf.py menuconfig
idf.py build
The script encountered an error.
我们先跳过这些错误。编译工程:d:\workspace\esp-idf\pipeline_baidu_speech_mp3
执行idf.py set-target esp32s3
之后执行:idf.py menuconfig
我们需要配置一下。
Audio HAL ,已经是我们需要的板卡了
之后执行idf.py build
在build中也会编译bootloader
之后编译esp-adf里面的components,会出现一些warning
最终编译成功:
完活,别忘了个点赞关注!留个脚印哦!