[原创] [ESP32-Audio-Kit音频开发板测评]之二vs code环境下ESP-ADF踩坑之旅

wo4fisher   2021-9-5 12:03 楼主
adminFish@DESKTOP-TF1T2RT MINGW64 ~/.espressif/esp-gitee-tools (master)
$ ./submodule-update.sh ../esp-adf
Submodule 'components/esp-adf-libs' (https://github.com/espressif/esp-adf-libs) registered for path 'components/esp-adf-libs'
Submodule 'components/esp-sr' (https://github.com/espressif/esp-sr.git) registered for path 'components/esp-sr'
Submodule 'esp-idf' (https://github.com/espressif/esp-idf) registered for path 'esp-idf'
Cloning into 'C:/Users/adminFish/.espressif/esp-adf/components/esp-adf-libs'...
remote: Enumerating objects: 72, done.
remote: Counting objects: 100% (72/72), done.
remote: Compressing objects: 100% (60/60), done.
remote: Total 1815 (delta 13), reused 0 (delta 0), pack-reused 1743
Receiving objects: 100% (1815/1815), 93.12 MiB | 6.00 MiB/s, done.
Resolving deltas: 100% (833/833), done.
Cloning into 'C:/Users/adminFish/.espressif/esp-adf/components/esp-sr'...
remote: Enumerating objects: 101, done.
remote: Counting objects: 100% (101/101), done.
...........
Submodule 'components/unity/unity' (https://github.com/ThrowTheSwitch/Unity) registered for path 'components/unity/unity'
Submodule 'examples/build_system/cmake/import_lib/main/lib/tinyxml2' (https://github.com/leethomason/tinyxml2) registered for path 'examples/build_system/cmake/import_lib/main/lib/tinyxml2'
Cloning into 'C:/Users/adminFish/.espressif/esp-adf/esp-idf/components/asio/asio'...
remote: Enumerating objects: 48394, done.
remote: Total 48394 (delta 0), reused 0 (delta 0), pack-reused 48394
Receiving objects: 100% (48394/48394), 15.55 MiB | 1.63 MiB/s, done.
Resolving deltas: 100% (33826/33826), done.
Cloning into 'C:/Users/adminFish/.espressif/esp-adf/esp-idf/components/aws_iot/aws-iot-device-sdk-embedded-C'...
remote: Enumerating objects: 14308, done.
remote: Counting objects: 100% (14308/14308), done.
remote: Compressing objects: 100% (5774/5774), done.
remote: Total 15920 (delta 8172), reused 14280 (delta 8151), pack-reused 1612
Receiving objects: 100% (15920/15920), 21.10 MiB | 1.99 MiB/s, done.
Resolving deltas: 100% (9113/9113), done.
Cloning into 'C:/Users/adminFish/.espressif/esp-adf/esp-idf/components/bt/lib'...
remote: Enumerating objects: 38, done.
remote: Counting objects: 100% (38/38), done.
.......
remote: Counting objects: 100% (5/5), done.
remote: Compressing objects: 100% (5/5), done.
remote: Total 5865 (delta 0), reused 0 (delta 0), pack-reused 5860
Receiving objects: 100% (5865/5865), 6.53 MiB | 838.00 KiB/s, done.
Resolving deltas: 100% (3647/3647), done.
Cloning into 'C:/Users/adminFish/.espressif/esp-adf/esp-idf/examples/build_system/cmake/import_lib/main/lib/tinyxml2'...
remote: Enumerating objects: 4, done.
remote: Counting objects: 100% (4/4), done.
remote: Compressing objects: 100% (4/4), done.
remote: Total 4460 (delta 0), reused 0 (delta 0), pack-reused 4456
Receiving objects: 100% (4460/4460), 3.12 MiB | 510.00 KiB/s, done.
Resolving deltas: 100% (2996/2996), done.
Submodule path 'components/asio/asio': checked out '55efc179b76139c8f9b44bf22a4aba4803f7a7bd'
Submodule path 'components/aws_iot/aws-iot-device-sdk-embedded-C': checked out '299183238ffe7a3e6a5ca0af9db19c10eaca62cf'
Submodule path 'components/bt/lib': checked out '4d64d12dde72113f2fcbb3c2a4045c55fa477237'
Submodule path 'components/coap/libcoap': checked out '6468887a12666f88b8704d797fc176cd4f40ee4c'
Submodule path 'components/esp32/lib': checked out '0274e09d48723be1eaef64a13cc8c7aa83020211'
......
Submodule path 'examples/build_system/cmake/import_lib/main/lib/tinyxml2': checked out '7e8e249990ec491ec15990cf95b6d871a66cf64a'
Entering 'components/asio/asio'
Entering 'components/aws_iot/aws-iot-device-sdk-embedded-C'
......
Entering 'components/nghttp/nghttp2'
Submodule 'third-party/mruby' (https://github.com/mruby/mruby) registered for path 'third-party/mruby'
Submodule 'third-party/neverbleed' (https://github.com/h2o/neverbleed.git) registered for path 'third-party/neverbleed'
Cloning into 'C:/Users/adminFish/.espressif/esp-adf/esp-idf/components/nghttp/nghttp2/third-party/mruby'...
remote: Enumerating objects: 1404, done.
remote: Counting objects: 100% (1404/1404), done.
remote: Compressing objects: 100% (1325/1325), done.
remote: Total 65500 (delta 783), reused 0 (delta 0), pack-reused 64096
Receiving objects: 100% (65500/65500), 16.21 MiB | 1.42 MiB/s, done.
Resolving deltas: 100% (41499/41499), done.
Cloning into 'C:/Users/adminFish/.espressif/esp-adf/esp-idf/components/nghttp/nghttp2/third-party/neverbleed'...
remote: Enumerating objects: 234, done.
remote: Total 234 (delta 0), reused 0 (delta 0), pack-reused 234
Receiving objects: 100% (234/234), 54.68 KiB | 965.00 KiB/s, done.
Resolving deltas: 100% (146/146), done.
Submodule path 'third-party/mruby': checked out '22464fe5a0a10f2b077eaba109ce1e912e4a77de'
Submodule path 'third-party/neverbleed': checked out 'da5c2ab419a3bb8a4cc6c37a6c7f3e4bd4b41134'
Entering 'third-party/mruby'
Entering 'third-party/neverbleed'
Entering 'components/nimble/nimble'
Entering 'components/protobuf-c/protobuf-c'
Entering 'components/spiffs/spiffs'
Entering 'components/unity/unity'
Entering 'examples/build_system/cmake/import_lib/main/lib/tinyxml2'

adminFish@DESKTOP-TF1T2RT MINGW64 ~/.espressif/esp-gitee-tools (master)

以上为第一趴,ESP-ADF框架是基于ESP-IDF基础上开发的音频应用框架,在ESP-ADF中有一些子模块,esp-idf、components\esp-sr、components\esp-adf-libs三个主要的submodules是以引用的形式存在于EDP-ADF中,因此,在下载ESP-ADF之后,还需要更新子模块内的源码文件。

但是折腾了两天,发现github经常抽抽,没有架梯子的话,会经常失败。

这里,乐鑫开源https://gitee.com/EspressifSystems中给了另外一个方案,乐鑫开源 / esp-gitee-tools,在此方案中,有详细的使用说明。

需要说明的是,ESP-ADF的开发对ESP-IDF有版本要求,并不是向上兼容或者是向下兼容的,因此,在测评一中通过VSC中添加插件的方式安装ESP-IDF的时候要选择ESP-ADF兼容的版本,这里选择了ESP-IDF V4.1版本。

 

image.png

 总结:

1.安装路径

ESP-IDF:C:\Users\adminFish\esp-idf        //通过vscode中的esp-idf插件安装;也可以先安装好,注意版本兼容要求。

ESP TOOLS:C:\Users\adminFish\.espressif   //通过vscode中的esp-idf插件安装(参考测评一)

ESP-ADF:C:\Users\adminFish\.espressif\esp-adf     ////通过vscode中的esp-idf插件命令安装    ctrl+shift+p

 

image.png  

esp-gitee-tools:C:\Users\adminFish\.espressif\esp-gitee-tools  //使用gitee的git源,通过git clone安装

2、步骤

2.1 安装vs code

2.2 在插件商店查找esp-idf插件,通过插件安装esp-idf、esp tools、git、python虚拟环境等等

2.3 通过esp-idf命令安装esp-adf

2.4 更新esp-adf的submodules

2.5 在vs code的命令面板选择    展示示例项目,这时候会显示两个示例选择,一个是IDF的,另外一个是ADF的,这里选择ADF.

 

image.png

 

image.png    

2.6  在examples界面,选中一个示例后,单击create project using example...,然后选择新项目文件夹,完成项目文件的复制。

image.png

  2.7 在打开的项目中,单击左下角编译快捷工具。

 

image.png

  2.8 等待编译完成

esptool.py v2.9-dev
Generated E:/wo4fisher/Documents/vscode_esp32/play_mp3_control/build/bootloader/bootloader.bin
[1056/1056] Generating binary image from built executable
esptool.py v2.9-dev
Generated E:/wo4fisher/Documents/vscode_esp32/play_mp3_control/build/play_mp3_control.bin

如果出现类似上边的结果,恭喜你,愉快的玩耍吧。

3 踩过的坑

3.1 git clone ,submodule更新、branch操作等遇到了一些问题,可以通过网络搜索到解决方法,总的来说就是要熟悉git代码管理的一些常用操作。

3.2 esp-idf、esp-adf框架使用cmake来编译,使用的make环境,一部分玩家是不太能够玩的转的,包括我。51、stm32之类的开发环境使用习惯了,make方式是一大挑战。

3.3 乐鑫官方给了在线或者离线安装工具,但是今天尝试了一下,安装失败。  不明所以,暂时放弃了。 最后还是返回vs code插件安装成功。

image.png

3.4 本来想手动逐项安装,但是基于对各类环境依赖基本上没认识,从新手入门的角度来看,官方也没有手动安装的步骤。所以最后也放弃了。 

 

最后的最后,ESP-ADF中的例程是基于乐鑫官方的开发板来设计的,因此本次测评使用的板子有引脚兼容的问题。使用的话,有两个思路

一是在官方的基础上进行重新引脚的适配,完成例程的移植

二是下载安信可的git仓库源码,尝试通过移花接木的方式,完成例程"移植"。

4 一些地址

4.1 https://github.com/donny681/esp-adf   安信可sdk

4.2 https://gitee.com/EspressifSystems    乐鑫开源

4.3 https://docs.espressif.com/projects/esp-idf/en/latest/esp32/#     ESP-IDF Programming Guide

4.4 https://docs.espressif.com/projects/esp-adf/en/latest/    Espressif Audio Development Guide

4.5 https://aithinker.blog.csdn.net/article/details/117479162  安信可ESP32语音开发板专题2

4.6 https://aithinker.blog.csdn.net/article/details/104457259 安信可ESP32语音开发板专题①

本帖最后由 wo4fisher 于 2021-9-5 21:22 编辑
水不撩不知深浅 人不拼怎知输赢

回复评论 (1)

踩坑经验很有用,谢谢分享。

加油!在电子行业默默贡献自己的力量!:)
点赞 (1) 2021-9-6 10:03
电子工程世界版权所有 京B2-20211791 京ICP备10001474号-1 京公网安备 11010802033920号
    写回复