【AT-START-F403A测评】之四freeRTOS系统基于IAR环境外挂flash(SPIM)运行测评
<p align="left" style="text-align:left; text-indent:24.0pt"><span style="font-size:10.5pt"><span style="layout-grid-mode:char"><span style="font-family:Calibri,sans-serif"><span style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">上次评测实现了外部SPIM外挂QSPI Flash性能粗测,本次测评spim外部flash运行代码执行情况。本次评测将外部flash分为两个部分,</span></span></span></span></span></p><ol start="12" style="list-style-type:lower-alpha">
<li align="left" style="text-align:left" value="50"><span style="font-size:10.5pt"><span style="layout-grid-mode:char"><span style="font-family:Calibri,sans-serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">0x08400000-0x0840FFFF</span></span><span style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">作为数据区域,</span></span></span></span></span></li>
<li align="left" style="text-align:left" value="50"><span style="font-size:10.5pt"><span style="layout-grid-mode:char"><span style="font-family:Calibri,sans-serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">0x08410000-0x093FFFFF</span></span><span style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">作为代码运行区域。将以前评测三个LED点灯任务(线程)运行在这个区域。</span></span></span></span></span></li>
</ol>
<ol>
<li style="text-align:justify; margin-top:22px; margin-bottom:22px"><span style="font-size:22pt"><span style="line-height:normal"><span style="layout-grid-mode:char"><span style="font-family:Calibri,sans-serif"><span style="font-size:14.0pt"><span style="font-family:"微软雅黑","sans-serif"">定制项目链接配置:</span></span></span></span></span></span>
<ol>
<li style="text-align:justify"><span style="font-size:10.5pt"><span style="layout-grid-mode:char"><span style="font-family:Calibri,sans-serif"><span style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">定制链接配置文件,从IAR安装目录\arm\config\linker\ArteryTek目录下复制AT32F403AxG.icf文件到工程项目目录中并更名为AT32F403AxG_extFlash.icf,为方便修改加入项目中,如下图所示。</span></span></span></span></span></li>
</ol>
</li>
</ol>
<p align="center" style="margin-left:66px; text-align:center; text-indent:0cm"></p>
<ol start="11" style="list-style-type:lower-alpha">
<li style="list-style-type:none">
<ol start="2">
<li align="left" style="text-align:left"><span style="font-size:10.5pt"><span style="layout-grid-mode:char"><span style="font-family:Calibri,sans-serif"><span style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">修改链接配置文件,增加ROM空间符号定义分别为:</span></span></span></span></span></li>
</ol>
</li>
<li style="text-align:justify" value="50"><span style="font-size:10.5pt"><span style="layout-grid-mode:char"><span style="font-family:Calibri,sans-serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">define symbol __ICFEDIT_region_ROM_BANK3_start__ = 0x08410000;</span></span></span></span></span></li>
<li style="text-align:justify" value="50"><span style="font-size:10.5pt"><span style="layout-grid-mode:char"><span style="font-family:Calibri,sans-serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">define symbol __ICFEDIT_region_ROM_BANK3_end__ = 0x093FFFFF;</span></span></span></span></span></li>
<li style="text-align:justify" value="50"><span style="font-size:10.5pt"><span style="layout-grid-mode:char"><span style="font-family:Calibri,sans-serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">define region ROM_BANK3_CODE_region =mem:;</span></span></span></span></span></li>
<li style="text-align:justify" value="50"><span style="font-size:10.5pt"><span style="layout-grid-mode:char"><span style="font-family:Calibri,sans-serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">place in ROM_BANK3_CODE_region {readonly section .text object led_task.o};</span></span></span></span></span></li>
</ol>
<p align="center" style="text-align:center"></p>
<ol start="11" style="list-style-type:lower-alpha">
<li style="list-style-type:none">
<ol start="3">
<li style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri,sans-serif"><span style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">指定项目链接配置文件:</span></span></span></span></li>
</ol>
</li>
<li style="text-align:justify" value="50"><span style="font-size:10.5pt"><span style="font-family:Calibri,sans-serif"><span style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">进入菜单project->option,弹出对话框选择Linker->config</span></span></span></span></li>
<li style="text-align:justify" value="50"><span style="font-size:10.5pt"><span style="font-family:Calibri,sans-serif"><span style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">选中Override Default选项,选择修改的链接配置文件</span></span></span></span></li>
</ol>
<p align="center" style="margin-left:28px; text-align:center"></p>
<ol start="2">
<li style="text-align:justify; margin-top:22px; margin-bottom:22px"><span style="font-size:22pt"><span style="line-height:normal"><span style="layout-grid-mode:char"><span style="font-family:Calibri,sans-serif"><span style="font-size:14.0pt"><span style="font-family:"微软雅黑","sans-serif"">定制下载bootloader:</span></span></span></span></span></span>
<ol>
<li style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri,sans-serif"><span style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">复制IAR安装目录\arm\config\flashloader\ArteryTek\AT32F403A\AT32F403ACGT7目录下两个文件到项目工程。</span></span></span></span></li>
</ol>
</li>
</ol>
<ol start="12" style="list-style-type:lower-alpha">
<li style="text-align:justify" value="50"><span style="font-size:10.5pt"><span style="font-family:Calibri,sans-serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">FlashAT32F403ACGT7.flash</span></span></span></span></li>
<li style="text-align:justify" value="50"><span style="font-size:10.5pt"><span style="font-family:Calibri,sans-serif"><span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">FlashAT32F403ACGT7.board</span></span></span></span>
<ol start="2">
<li style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri,sans-serif"><span style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">更名两个文件为AT32F403ACGT7_extFlash.board和AT32F403ACGT7_extFlash.flash,修改AT32F403ACGT7_extFlash.flash中内容如下图所示</span></span></span></span></li>
</ol>
</li>
</ol>
<p style="text-align:justify"></p>
<ol start="11" style="list-style-type:lower-alpha">
<li style="list-style-type:none">
<ol start="3">
<li style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri,sans-serif"><span style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">指定项目bootloaer配置 ,</span></span></span></span></li>
</ol>
</li>
<li style="text-align:justify" value="50"><span style="font-size:10.5pt"><span style="layout-grid-mode:char"><span style="font-family:Calibri,sans-serif"><span style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">进入菜单project->option,</span></span></span></span></span></li>
<li style="text-align:justify" value="50"><span style="font-size:10.5pt"><span style="layout-grid-mode:char"><span style="font-family:Calibri,sans-serif"><span style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">弹出对话框选择Debugger>Download,</span></span></span></span></span></li>
<li style="text-align:justify" value="50"><span style="font-size:10.5pt"><span style="layout-grid-mode:char"><span style="font-family:Calibri,sans-serif"><span style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">选中Override default .board file</span></span></span></span></span></li>
<li style="text-align:justify" value="50"><span style="font-size:10.5pt"><span style="layout-grid-mode:char"><span style="font-family:Calibri,sans-serif"><span style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">更改内容如下图所示</span></span></span></span></span></li>
</ol>
<p style="text-align:justify"></p>
<ol start="12" style="list-style-type:lower-alpha">
<li style="text-align:justify" value="50"><span style="font-size:10.5pt"><span style="layout-grid-mode:char"><span style="font-family:Calibri,sans-serif"><span style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">点击Edit…按钮,更改如下图所示</span></span></span></span></span></li>
</ol>
<p style="text-align:justify"></p>
<ol start="3">
<li style="text-align:justify; margin-top:22px; margin-bottom:22px"><span style="font-size:22pt"><span style="line-height:normal"><span style="layout-grid-mode:char"><span style="font-family:Calibri,sans-serif"><span style="font-size:14.0pt"><span style="font-family:"微软雅黑","sans-serif"">指定调试设备描述文件(DDF):</span></span></span></span></span></span>
<ol>
<li style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri,sans-serif"><span style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">从IAR安装目录\</span></span> <span lang="EN-US" style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">\arm\config\debugger\ArteryTek</span></span><span style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">目录下复制AT32F403AxG.ddf在本目录并更名为AT32F403AxG_extFlash.ddf。</span></span></span></span></li>
<li style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri,sans-serif"><span style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">便于IAR调试观察所下载的代码,需要定制IAR调试的设备描述文件,增加外部flash定制空间定义。如下图</span></span></span></span></li>
</ol>
</li>
</ol>
<p style="text-align:justify"></p>
<ol>
<li style="list-style-type:none">
<ol start="3">
<li style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri,sans-serif"><span style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">指定DDF文件</span></span></span></span></li>
</ol>
</li>
</ol>
<p style="margin-left:66px; text-indent:0cm; text-align:justify"></p>
<ol start="4">
<li style="text-align:justify; margin-top:22px; margin-bottom:22px"><span style="font-size:22pt"><span style="line-height:normal"><span style="layout-grid-mode:char"><span style="font-family:Calibri,sans-serif"><span lang="EN-US" style="font-size:14.0pt"><span style="font-family:"微软雅黑","sans-serif"">SPIM</span></span><span style="font-size:14.0pt"><span style="font-family:"微软雅黑","sans-serif"">相关源代码(略):</span></span></span></span></span></span></li>
</ol>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri,sans-serif"><span style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">见上一篇SPIM初始化说明。</span></span></span></span></p>
<ol start="5">
<li style="text-align:justify; margin-top:22px; margin-bottom:22px"><span style="font-size:22pt"><span style="line-height:normal"><span style="layout-grid-mode:char"><span style="font-family:Calibri,sans-serif"><span style="font-size:14.0pt"><span style="font-family:"微软雅黑","sans-serif"">编译验证:</span></span></span></span></span></span>
<ol>
<li style="text-align:justify"><span style="font-size:10.5pt"><span style="layout-grid-mode:char"><span style="font-family:Calibri,sans-serif"><span style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">编译通过后打开编译存储器映射文件at32403a_eval.map,搜说led_task关键字,如下图所示,放置概述里,已在预定区域。</span></span></span></span></span></li>
</ol>
</li>
</ol>
<p style="text-align:justify"></p>
<ol>
<li style="list-style-type:none">
<ol start="2">
<li style="text-align:justify"><span style="font-size:10.5pt"><span style="layout-grid-mode:char"><span style="font-family:Calibri,sans-serif"><span style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">这两个区域详细描述</span></span></span></span></span></li>
</ol>
</li>
</ol>
<p style="text-align:justify"></p>
<ol start="6">
<li style="text-align:justify; margin-top:22px; margin-bottom:22px"><span style="font-size:22pt"><span style="line-height:normal"><span style="layout-grid-mode:char"><span style="font-family:Calibri,sans-serif"><span style="font-size:14.0pt"><span style="font-family:"微软雅黑","sans-serif"">运行位置验证</span></span></span></span></span></span>
<ol>
<li style="text-align:justify"><span style="font-size:10.5pt"><span style="layout-grid-mode:char"><span style="font-family:Calibri,sans-serif"><span style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">在每个任务中设置相应断点后运行直到遇到断点暂停,观察汇编地址的确在0x08410000所在区域。</span></span></span></span></span></li>
</ol>
</li>
</ol>
<p align="center" style="margin-left:28px; text-align:center; text-indent:0cm"></p>
<p align="center" style="text-align:center; text-indent:.05pt"></p>
<p style="text-align:justify"></p>
<ol start="7">
<li style="text-align:justify; margin-top:22px; margin-bottom:22px"><span style="font-size:22pt"><span style="line-height:normal"><span style="layout-grid-mode:char"><span style="font-family:Calibri,sans-serif"><span style="font-size:14.0pt"><span style="font-family:"微软雅黑","sans-serif"">运行结果</span></span></span></span></span></span></li>
</ol>
<p align="left" style="margin-left:28px; text-align:left; text-indent:0cm"></p>
<ol>
<li style="list-style-type:none">
<ol>
<li align="left" style="text-align:left"><span style="font-size:10.5pt"><span style="layout-grid-mode:char"><span style="font-family:Calibri,sans-serif"><span style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">外部flash运行速度尚未具体测试不能确定,后续补充一下</span></span></span></span></span></li>
<li align="left" style="text-align:left"><span style="font-size:10.5pt"><span style="layout-grid-mode:char"><span style="font-family:Calibri,sans-serif"><span style="font-size:12.0pt"><span style="font-family:"微软雅黑","sans-serif"">下载时被提示有错误,观察调试log信息 Verification error at 0x08410000: mem = 0xFF, file = 0x38,应该是调试器没有正确读取外部flash数据。但实际观察是正确的,如下图所示,并且调试及运行尚未发现问题,后续发现问题再修正或补充。</span></span></span></span></span></li>
</ol>
</li>
</ol>
<p>不错,谢谢分享</p> <p>不错,谢谢分享</p>
<p><a href="https://bbs.eeworld.com.cn/thread-1143018-1-1.html" target="_blank">雅特力AT-START-F403A测评汇总</a></p>
<p>汇总贴:<a href="https://bbs.eeworld.com.cn/thread-1143018-1-1.html" target="_blank">https://bbs.eeworld.com.cn/thread-1143018-1-1.html</a></p>
页:
[1]