【Silicon Labs BG22-EK4108A 蓝牙开发评测】评测三 尝试Keil/IAR开发
本帖最后由 单笑寒 于 2022-1-22 17:32 编辑<p align="center" style="text-align:center"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="宋体">评测三</font> 尝试<font face="Calibri">Keil/IAR</font><font face="宋体">开发</font></span></span></span></span></p>
<p style="text-indent:21.0000pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="Calibri">BLE5.2</font><font face="宋体">的新特性包括:</font></span></span></span></span></p>
<ul>
<li style="text-align:justify" value="50"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="Calibri">Enhanced Attribute Protocol</font></span></span></span></span></li>
<li style="text-align:justify" value="50"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="Calibri">LE Power Control</font></span></span></span></span></li>
<li style="text-align:justify" value="50"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="Calibri">LE Isochronous Channels</font><font face="宋体">(</font><font face="Calibri">LC3 Codec Audio</font><font face="宋体">)</font></span></span></span></span></li>
</ul>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="宋体">本想尝试一把蓝牙</font><font face="Calibri">mesh</font><font face="宋体">的兼容性问题,但</font><font face="Calibri">Simplicity Studio</font><font face="宋体">的编译速度确实捉急,考虑先移植到别的开发平台。这几天在进行</font><font face="Calibri">EFR32BG22</font><font face="宋体">的上手时,每次编译要经过漫长的等待,动则</font><font face="Calibri">15</font><font face="宋体">分钟过去,效率也是生产力,</font></span></span></span></span></p>
<p class="imagemiddle" style="text-align: center;"></p>
<p align="center" style="text-indent:21.0000pt; text-align:center"> <span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="宋体">图</font><font face="Calibri">1 </font><font face="宋体">漫长的编译时间(耗时</font><font face="Calibri">13</font><font face="宋体">分钟)</font></span></span></span></span></p>
<p style="text-indent:21.0000pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="宋体">无论编译器选择自带</font><font face="Calibri">GNU</font><font face="宋体">还是</font><font face="Calibri">IAR_ICC</font><font face="宋体">亦或是</font><font face="Calibri">SES</font><font face="宋体">均很慢,想到同是</font><font face="Calibri">ARM M33</font><font face="宋体">核,何不试试常用的</font><font face="Calibri">Keil-MDK</font><font face="宋体">和</font><font face="Calibri">IAR</font><font face="宋体">,由于官方没有给相应例子,于是只得从</font><font face="Calibri">0</font><font face="宋体">开始动手。</font></span></span></span></span></p>
<ol>
<li style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><b><span style="font-size:10.5000pt"><span style="font-family:宋体"><span style="font-weight:bold"><font face="Calibri">keil</font><font face="宋体">建工程</font></span></span></span></b></span></span></li>
</ol>
<p style="text-indent:21.0000pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="宋体">首先我的环境是</font><font face="Calibri">Keil v5.27</font><font face="宋体">,由于没有</font><font face="Calibri">EFR32BG22</font><font face="宋体">对应</font><font face="Calibri">DFP</font><font face="宋体">,去官网</font></span></span><a href="https://www.keil.com/dd2/" title="https://www.keil.com/dd2/"><u><span class="15" style="font-family:宋体"><span style="color:#0000ff"><span style="text-decoration:underline"><span style="text-underline:single"><font face="Calibri">https://www.keil.com/dd2/</font></span></span></span></span></u></a><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="宋体">下载包,下载完后在工程属性</font><font face="Calibri">Define</font><font face="宋体">定义</font><font face="Calibri">SDK</font><font face="宋体">宏</font><font face="Calibri">StudioSdkPath=E:\studysoftware\SiliconLabs\SimplicityStudio_v5\developer\sdks\gecko_sdk_suite\v3.2</font><font face="宋体">,在</font><font face="Calibri">C/C++ Include Paths</font><font face="宋体">包含必须文件(我也是报错什么添加什么,好心酸):</font></span></span></span></span></p>
<p class="imagemiddle" style="text-align: center;"></p>
<p align="center" style="text-indent:21.0000pt; text-align:center"> <span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="宋体">图</font></span></span><span style="font-size:10.5000pt"><span style="font-family:Calibri">2 Keil<font face="宋体">文件路径</font></span></span></span></span></p>
<p style="text-indent:21.0000pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="宋体">当提示需要启动文件,于是同样见山过山去寻找启动文件,结果在路径</font><font face="Calibri">{$StudioSdkPath}\platform\Device\SiliconLabs\EFR32BG22\Source</font><font face="宋体">下发现只支持</font><font face="Calibri">IAR</font><font face="宋体">和</font><font face="Calibri">GCC</font><font face="宋体">,于是有了下一章节:</font></span></span></span></span></p>
<p class="imagemiddle" style="text-align: center;"></p>
<p align="center" style="text-indent:21.0000pt; text-align:center"> <span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="宋体">图</font><font face="Calibri">3 </font><font face="宋体">启动文件</font></span></span></span></span></p>
<ol start="2">
<li style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><b><span style="font-size:10.5000pt"><span style="font-family:宋体"><span style="font-weight:bold"><font face="Calibri">IAR</font><font face="宋体">建工程</font></span></span></span></b></span></span></li>
</ol>
<p style="text-indent:21.0000pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="Calibri">IAR</font><font face="宋体">不像</font><font face="Calibri">Keil</font><font face="宋体">架构会有芯片包类似插件,缺哪个装哪个</font><font face="Calibri">DFP</font><font face="宋体">,但</font><font face="Calibri">IAR</font><font face="宋体">不是,手头的</font><font face="Calibri">IAR v8.40</font><font face="宋体">,于是又重新下载安装了</font><font face="Calibri">IAR v9.10</font><font face="宋体">(最新版好像到了</font><font face="Calibri">9.2x</font><font face="宋体">),历经曲折破解完成,开始建工程,芯片类型终于有</font><font face="Calibri">EFR32BG22C224F512IM40</font><font face="宋体">:</font></span></span></span></span></p>
<p class="imagemiddle" style="text-align: center;"></p>
<p align="center" style="text-indent:21.0000pt; text-align:center"> <span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="宋体">图</font><font face="Calibri">4 IAR</font><font face="宋体">制定目标芯片型号</font></span></span></span></span></p>
<p style="text-indent:21.0000pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="宋体">同时添加繁多的路径:</font></span></span></span></span></p>
<p class="imagemiddle" style="text-align: center;"></p>
<p align="center" style="text-indent:21.0000pt; text-align:center"> <span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="宋体">图</font><font face="Calibri">5 IAR</font><font face="宋体">文件路径图</font></span></span></span></span></p>
<p style="text-indent:21.0000pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="宋体">添加预定义宏</font>“<font face="Calibri">EFR32BG22C224F512IM40</font><font face="宋体">”(</font></span></span><span style="font-size:10.5000pt"><span style="font-family:宋体"><span style="color:#ff0000"><font face="宋体">不然</font><font face="Calibri">em_device.h</font><font face="宋体">会报错</font><font face="Calibri">PART NUMBER undefined</font></span></span></span><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="宋体">):</font></span></span></span></span></p>
<p class="imagemiddle" style="text-align: center;"> <span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="宋体">图</font><font face="Calibri">6 IAR</font><font face="宋体">预定义宏</font></span></span></span></span></p>
<p style="text-indent:21.0000pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="宋体">启动文件也有,编译,结果陷入沉思,提示一堆库接口</font><font face="Calibri">sl_xx</font><font face="宋体">找不到,时间有限,只好作罢。</font></span></span></span></span></p>
<ol start="3">
<li style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><b><span style="font-size:10.5000pt"><span style="font-family:宋体"><span style="font-weight:bold"><font face="宋体">总结</font></span></span></span></b></span></span></li>
</ol>
<p style="text-indent:21.0000pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="Calibri">Keil</font><font face="宋体">有对应芯片</font><font face="Calibri">DFP</font><font face="宋体">但缺启动文件,</font><font face="Calibri">IAR</font><font face="宋体">要很新的版本才有目标芯片型号和启动文件,但众多的库接口找不到定义,</font><font face="Calibri">SS</font><font face="宋体">全有,但编译速度着实让人沉思,下次接着本次的工作接着</font><font face="Calibri">IAR</font><font face="宋体">的进度做下去。</font></span></span></span></span></p>
<p>IAR和Keil给有千秋</p>
<p>使用IAR不断更新的软件版本</p>
<p>我用SSv5生成的IAR工程文件在IAR下做工程,小工程没问题,比如“Blink Bare-metal”之类,但大工程比如“Bluetooth - SoC Blinky”就不行,卡在编译上不动,后来只好放弃。</p>
<p>看了这帖子的标题还以为......,结果......</p>
<p>编译过程不出任何错误信息,就是卡住不动</p>
<p> </p>
zhang1gong 发表于 2022-1-23 17:38
我用SSv5生成的IAR工程文件在IAR下做工程,小工程没问题,比如“Blink Bare-metal”之类,但大工 ...
<p>我找到编译慢的原因了,编译时一定要关掉360安全卫士一些软件,每个编译进程cc.exe/ar.exe/gcc-arm.exe等全被360扔进沙箱严重拖慢进度,ESP32 msys2编译也有这个问题,打开360在后台编译时间经常15min+,关掉后世界清静了,编译耗时只1min左右</p>
页:
[1]