[ESP32-Audio-Kit音频开发板测评]之二vs code环境下ESP-ADF踩坑之旅
<div class='showpostmsg'> 本帖最后由 wo4fisher 于 2021-9-5 21:22 编辑<pre>
<code class="language-cs">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)
</code></pre>
<p>以上为第一趴,ESP-ADF框架是基于ESP-IDF基础上开发的音频应用框架,在ESP-ADF中有一些子模块,esp-idf、components\esp-sr、components\esp-adf-libs三个主要的submodules是以引用的形式存在于EDP-ADF中,因此,在下载ESP-ADF之后,还需要更新子模块内的源码文件。</p>
<p>但是折腾了两天,发现github经常抽抽,没有架梯子的话,会经常失败。</p>
<p>这里,<a href="https://gitee.com/EspressifSystems">乐鑫开源</a>https://gitee.com/EspressifSystems中给了另外一个方案,<a href="https://gitee.com/EspressifSystems" title="乐鑫开源">乐鑫开源</a> / <a href="https://gitee.com/EspressifSystems/esp-gitee-tools" sa_evt="repoClick" sa_location="仓库页面" sa_repo_id="11339408" sa_url="" target="" title="esp-gitee-tools">esp-gitee-tools</a>,在此方案中,有详细的使用说明。</p>
<p>需要说明的是,ESP-ADF的开发对ESP-IDF有版本要求,并不是向上兼容或者是向下兼容的,因此,在测评一中通过VSC中添加插件的方式安装ESP-IDF的时候要选择ESP-ADF兼容的版本,这里选择了ESP-IDF V4.1版本。</p>
<p> </p>
<p></p>
<p><span style="font-size:20px;"><strong> 总结:</strong></span></p>
<p><strong>1.安装路径</strong></p>
<p>ESP-IDF:C:\Users\adminFish\esp-idf //通过vscode中的esp-idf插件安装;也可以先安装好,注意版本兼容要求。</p>
<p>ESP TOOLS:C:\Users\adminFish\.espressif //通过vscode中的esp-idf插件安装(参考测评一)</p>
<p>ESP-ADF:C:\Users\adminFish\.espressif\esp-adf ////通过vscode中的esp-idf插件命令安装 <strong>ctrl+shift+p</strong></p>
<p> </p>
<p> </p>
<p>esp-gitee-tools:C:\Users\adminFish\.espressif\esp-gitee-tools //使用gitee的git源,通过git clone安装</p>
<p><strong>2、步骤</strong></p>
<p><strong>2.1 安装vs code</strong></p>
<p><strong>2.2 在插件商店查找esp-idf插件,通过插件安装esp-idf、esp tools、git、python虚拟环境等等</strong></p>
<p><strong>2.3 通过esp-idf命令安装esp-adf</strong></p>
<p><strong>2.4 更新esp-adf的submodules</strong></p>
<p><strong>2.5 在vs code的命令面板选择</strong> 展示示例项目,这时候会显示两个示例选择,一个是IDF的,另外一个是ADF的,这里选择ADF.</p>
<p> </p>
<p></p>
<p> </p>
<p> </p>
<p><strong>2.6 在examples界面</strong>,选中一个示例后,单击create project using example...,然后选择新项目文件夹,完成项目文件的复制。</p>
<p></p>
<p><strong> 2.7 在打开的项目中</strong>,单击左下角编译快捷工具。</p>
<p> </p>
<p></p>
<p><strong> 2.8 等待编译完成</strong></p>
<pre>
<code class="language-cpp">esptool.py v2.9-dev
Generated E:/wo4fisher/Documents/vscode_esp32/play_mp3_control/build/bootloader/bootloader.bin
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</code></pre>
<p>如果出现类似上边的结果,恭喜你,愉快的玩耍吧。</p>
<p><strong><span style="font-size:20px;">3 踩过的坑</span></strong></p>
<p><strong>3.1 git clone ,submodule更新、branch</strong>操作等遇到了一些问题,可以通过网络搜索到解决方法,总的来说就是要熟悉git代码管理的一些常用操作。</p>
<p><strong>3.2 esp-idf、esp-adf框架使用cmake来编</strong>译,使用的make环境,一部分玩家是不太能够玩的转的,包括我。51、stm32之类的开发环境使用习惯了,make方式是一大挑战。</p>
<p><strong>3.3 <s>乐鑫官方给了在线或者离线安装工具</s></strong><s>,但是今天尝试了一下,安装失败。 不明所以,暂时放弃了。 最后还是返回vs code插件安装成功。</s></p>
<p></p>
<p><strong>3.4 <s>本来想手动逐项安装</s></strong><s>,但是基于对各类环境依赖基本上没认识,从新手入门的角度来看,官方也没有手动安装的步骤。所以最后也放弃了。 </s></p>
<p> </p>
<p>最后的最后,ESP-ADF中的例程是基于乐鑫官方的开发板来设计的,因此本次测评使用的板子有引脚兼容的问题。使用的话,有两个思路</p>
<p><strong>一是在官方的基础上进行重新引脚的适配,完成例程的移植</strong>。</p>
<p><strong>二是下载安信可的git仓库源码,尝试通过移花接木的方式,完成例程"移植"。</strong></p>
<p><span style="font-size:24px;"><strong>4 一些地址</strong></span></p>
<p>4.1 <a href="https://github.com/donny681/esp-adf " target="_blank">https://github.com/donny681/esp-adf </a> <a href="https://github.com/donny681/esp-adf" target="_blank">安信可sdk</a></p>
<p>4.2 <a href="https://gitee.com/EspressifSystems " target="_blank">https://gitee.com/EspressifSystems </a> <a href="https://gitee.com/EspressifSystems">乐鑫开源</a></p>
<p>4.3 <a href="https://docs.espressif.com/projects/esp-idf/en/latest/esp32/# " target="_blank">https://docs.espressif.com/projects/esp-idf/en/latest/esp32/# </a> <a href="https://docs.espressif.com/projects/esp-idf/en/latest/esp32/#" target="_blank"> ESP-IDF Programming Guide</a></p>
<p>4.4 <a href="https://docs.espressif.com/projects/esp-adf/en/latest/" target="_blank">https://docs.espressif.com/projects/esp-adf/en/latest/</a> <a href="https://docs.espressif.com/projects/esp-adf/en/latest/#" target="_blank">Espressif Audio Development Guide</a></p>
<p>4.5 <a href="https://aithinker.blog.csdn.net/article/details/117479162" target="_blank">https://aithinker.blog.csdn.net/article/details/117479162</a> <a href="https://aithinker.blog.csdn.net/article/details/117479162" target="_blank">安信可ESP32语音开发板专题</a>2</p>
<p>4.6 h<a href="https://aithinker.blog.csdn.net/article/details/104457259" target="_blank">ttps://aithinker.blog.csdn.net/article/details/104457259 安信可ESP32语音开发板专题①</a></p>
</div><script> var loginstr = '<div class="locked">查看本帖全部内容,请<a href="javascript:;" style="color:#e60000" class="loginf">登录</a>或者<a href="https://bbs.eeworld.com.cn/member.php?mod=register_eeworld.php&action=wechat" style="color:#e60000" target="_blank">注册</a></div>';
if(parseInt(discuz_uid)==0){
(function($){
var postHeight = getTextHeight(400);
$(".showpostmsg").html($(".showpostmsg").html());
$(".showpostmsg").after(loginstr);
$(".showpostmsg").css({height:postHeight,overflow:"hidden"});
})(jQuery);
} </script><script type="text/javascript">(function(d,c){var a=d.createElement("script"),m=d.getElementsByTagName("script"),eewurl="//counter.eeworld.com.cn/pv/count/";a.src=eewurl+c;m.parentNode.insertBefore(a,m)})(document,523)</script> <p>踩坑经验很有用,谢谢分享。</p>
页:
[1]