uuxz99 发表于 2020-10-12 09:37

【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:&quot;微软雅黑&quot;,&quot;sans-serif&quot;">上次评测实现了外部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:&quot;微软雅黑&quot;,&quot;sans-serif&quot;">0x08400000-0x0840FFFF</span></span><span style="font-size:12.0pt"><span style="font-family:&quot;微软雅黑&quot;,&quot;sans-serif&quot;">作为数据区域,</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:&quot;微软雅黑&quot;,&quot;sans-serif&quot;">0x08410000-0x093FFFFF</span></span><span style="font-size:12.0pt"><span style="font-family:&quot;微软雅黑&quot;,&quot;sans-serif&quot;">作为代码运行区域。将以前评测三个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:&quot;微软雅黑&quot;,&quot;sans-serif&quot;">定制项目链接配置:</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:&quot;微软雅黑&quot;,&quot;sans-serif&quot;">定制链接配置文件,从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:&quot;微软雅黑&quot;,&quot;sans-serif&quot;">修改链接配置文件,增加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:&quot;微软雅黑&quot;,&quot;sans-serif&quot;">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:&quot;微软雅黑&quot;,&quot;sans-serif&quot;">define symbol __ICFEDIT_region_ROM_BANK3_end__&nbsp; = 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:&quot;微软雅黑&quot;,&quot;sans-serif&quot;">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:&quot;微软雅黑&quot;,&quot;sans-serif&quot;">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:&quot;微软雅黑&quot;,&quot;sans-serif&quot;">指定项目链接配置文件:</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:&quot;微软雅黑&quot;,&quot;sans-serif&quot;">进入菜单project-&gt;option,弹出对话框选择Linker-&gt;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:&quot;微软雅黑&quot;,&quot;sans-serif&quot;">选中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:&quot;微软雅黑&quot;,&quot;sans-serif&quot;">定制下载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:&quot;微软雅黑&quot;,&quot;sans-serif&quot;">复制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:&quot;微软雅黑&quot;,&quot;sans-serif&quot;">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:&quot;微软雅黑&quot;,&quot;sans-serif&quot;">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:&quot;微软雅黑&quot;,&quot;sans-serif&quot;">更名两个文件为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:&quot;微软雅黑&quot;,&quot;sans-serif&quot;">指定项目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:&quot;微软雅黑&quot;,&quot;sans-serif&quot;">进入菜单project-&gt;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:&quot;微软雅黑&quot;,&quot;sans-serif&quot;">弹出对话框选择Debugger&gt;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:&quot;微软雅黑&quot;,&quot;sans-serif&quot;">选中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:&quot;微软雅黑&quot;,&quot;sans-serif&quot;">更改内容如下图所示</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:&quot;微软雅黑&quot;,&quot;sans-serif&quot;">点击Edit&hellip;按钮,更改如下图所示</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:&quot;微软雅黑&quot;,&quot;sans-serif&quot;">指定调试设备描述文件(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:&quot;微软雅黑&quot;,&quot;sans-serif&quot;">从IAR安装目录\</span></span> <span lang="EN-US" style="font-size:12.0pt"><span style="font-family:&quot;微软雅黑&quot;,&quot;sans-serif&quot;">\arm\config\debugger\ArteryTek</span></span><span style="font-size:12.0pt"><span style="font-family:&quot;微软雅黑&quot;,&quot;sans-serif&quot;">目录下复制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:&quot;微软雅黑&quot;,&quot;sans-serif&quot;">便于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:&quot;微软雅黑&quot;,&quot;sans-serif&quot;">指定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:&quot;微软雅黑&quot;,&quot;sans-serif&quot;">SPIM</span></span><span style="font-size:14.0pt"><span style="font-family:&quot;微软雅黑&quot;,&quot;sans-serif&quot;">相关源代码(略):</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:&quot;微软雅黑&quot;,&quot;sans-serif&quot;">见上一篇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:&quot;微软雅黑&quot;,&quot;sans-serif&quot;">编译验证:</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:&quot;微软雅黑&quot;,&quot;sans-serif&quot;">编译通过后打开编译存储器映射文件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:&quot;微软雅黑&quot;,&quot;sans-serif&quot;">这两个区域详细描述</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:&quot;微软雅黑&quot;,&quot;sans-serif&quot;">运行位置验证</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:&quot;微软雅黑&quot;,&quot;sans-serif&quot;">在每个任务中设置相应断点后运行直到遇到断点暂停,观察汇编地址的确在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:&quot;微软雅黑&quot;,&quot;sans-serif&quot;">运行结果</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:&quot;微软雅黑&quot;,&quot;sans-serif&quot;">外部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:&quot;微软雅黑&quot;,&quot;sans-serif&quot;">下载时被提示有错误,观察调试log信息 Verification error at 0x08410000: mem = 0xFF, file = 0x38,应该是调试器没有正确读取外部flash数据。但实际观察是正确的,如下图所示,并且调试及运行尚未发现问题,后续发现问题再修正或补充。</span></span></span></span></span></li>
        </ol>
        </li>
</ol>

RCSN 发表于 2020-10-12 21:59

<p>不错,谢谢分享</p>

freebsder 发表于 2020-10-14 22:07

<p>不错,谢谢分享</p>

okhxyyo 发表于 2020-10-19 09:49

<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]
查看完整版本: 【AT-START-F403A测评】之四freeRTOS系统基于IAR环境外挂flash(SPIM)运行测评