北方 发表于 2021-11-26 09:40

【复旦微FM33LG0系列开发板测评】编译和下载

本帖最后由 北方 于 2021-11-26 10:35 编辑

<p></p>

<p>&nbsp;</p>

<p>1. GPIO工程代码分析</p>

<p>不管东西南北,万事皆可电灯,所以从GPIO开始做起,不过,代码实在是太太简单明了。</p>

<pre>
<code>#include "main.h"
#include "user_init.h"

int main(void)
{
    MF_Clock_Init();
    MF_SystemClock_Config();

    FL_Init();

    MF_Config_Init();

    UserInit();

    while(1)
    {
      LED0_TOG();
      FL_DelayMs(5000);
    }
}
</code></pre>

<p>初始化包括,时钟,板卡,配置和用户自定义,然后就是循环,</p>

<p>&nbsp; &nbsp; &nbsp; &nbsp; LED0_TOG();<br />
&nbsp; &nbsp; &nbsp; &nbsp; FL_DelayMs(5000);</p>

<p>问题就是没有API代码导则,这个肿么整。那么其实还是来自厂家的定义文档,</p>

<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#define LED0_TOG() &nbsp;FL_GPIO_ToggleOutputPin(LED0_GPIO, LED0_PIN)</p>

<p>文件的还是都是来自如下</p>

<p>#include &quot;fm33lg0xx_fl.h&quot;</p>

<p></p>

<p>2. 项目的编译</p>

<p>点击编译,可以直接开始编译,顺利通过。</p>

<p></p>

<p>3. 代码下载</p>

<p>这个板子如果空白的芯片没有焊上,应该就是一个各个引脚引出的裸板,需要自备调试器去下载。</p>

<p>经测试,以下各款老爷调试器都可用,一个是jlink7.0,一个是jlink8.0,看来是芯片没有验证和加锁的流程,其中jlink OB款是限制在厂家用的公版,用起来也不错。</p>

<p></p>

<p>采用SW下载,只需要2根SWO和SCK,分别是数据和时钟下,如下连接。下载的时候,还需要一个reset键置位,下载过程中提示有这个问题,但是没有点reset也顺利下载了。</p>

<p><br />
</p>

<p>控制台输出如下,</p>

<pre>
<code>Build started: Project: FM33LG0XX_Tester
*** Using Compiler 'V5.06 update 6 (build 750)', folder: 'D:\Development\DesignParks\Keil_v5\ARM\ARMCC\Bin'
Build target 'Example'
".\Objects\FM33LC0xx_Tester.axf" - 0 Error(s), 0 Warning(s).
Build Time Elapsed:00:00:00
Load "D:\\Development\\DesignParks\\Keil_v5\\FM33LG0XX\\GPIO 示例\\MDK-ARM\\Objects\\FM33LC0xx_Tester.axf"
* JLink Info: Device "CORTEX-M0" selected.
Set JLink Project File to "D:\Development\DesignParks\Keil_v5\FM33LG0XX\GPIO 示例\MDK-ARM\JLinkSettings.ini"
* JLink Info: Device "CORTEX-M0" selected.

JLink info:
------------
DLL: V6.46 , compiled May 23 2019 17:49:56
Firmware: J-Link ARM-OB STM32 compiled Aug 22 2012 19:52:04
Hardware: V7.00
S/N : 20090928
Feature(s) : RDI,FlashDL,FlashBP,JFlash,GDBFull

* JLink Info: Found SW-DP with ID 0x0BB11477
* JLink Info: Scanning AP map to find all available APs
* JLink Info: AP: Stopped AP scan as end of AP map has been reached
* JLink Info: AP: AHB-AP (IDR: 0x04770021)
* JLink Info: Iterating through AP map to find AHB-AP to use
* JLink Info: AP: Core found
* JLink Info: AP: AHB-AP ROM base: 0xE00FF000
* JLink Info: CPUID register: 0x410CC300. Implementer code: 0x41 (ARM)
* JLink Info: Unknown core, assuming Cortex-M0
* JLink Info: Found Cortex-M0 r0p0, Little endian.
* JLink Info: FPUnit: 4 code (BP) slots and 0 literal slots
* JLink Info: CoreSight components:
* JLink Info: ROMTbl @ E00FF000
* JLink Info: ROMTbl: E000E000, CID: B105E00D, PID: 000BB00D ???
* JLink Info: ROMTbl: E0001000, CID: B105E00D, PID: 000BB00A DWT
* JLink Info: ROMTbl: E0002000, CID: B105E00D, PID: 000BB00B FPB
ROMTableAddr = 0xE00FF000
* JLink Info: Reset: Halt core after reset via DEMCR.VC_CORERESET.
* JLink Info: Reset: Reset device via reset pin
**JLink Warning: RESET (pin 15) high, but should be low. Please check target hardware.

Target info:
------------
Device: FM33LG04X
VTarget = 3.300V
State of Pins:
TCK: 0, TDI: 1, TDO: 1, TMS: 0, TRES: 1, TRST: 1
Hardware-Breakpoints: 4
Software-Breakpoints: 8192
Watchpoints:          1
JTAG speed: 2000 kHz

Erase Done.
Programming Done.
Verify OK.
* JLink Info: Reset: Halt core after reset via DEMCR.VC_CORERESET.
* JLink Info: Reset: Reset device via reset pin
**JLink Warning: RESET (pin 15) high, but should be low. Please check target hardware.
Application running ...
Flash Load finished at 10:16:24</code></pre>

<p>按照上面的说明,如果下载器如果没有专门的下载键,按一下reset就可以了。</p>

<p>原来的delay延时是1秒,1000ms,改成200ms快闪模式还比较顺利,就是有点太闪亮了。</p>

<p></p>

<p>吐槽一下:最近收到了神州数码作为代理的电话,其实还是觉得国产芯片选用这样的美国公司做代理总让人觉得怪怪的,联想能把公司做亏损了再去科创板上市,同时高管上亿年薪秒杀作为老板的李书福。与其这样,我更愿意用TI的产品,如果要选代理也去找艾睿。</p>

<p>&nbsp;</p>

<p>&nbsp;</p>

Jacktang 发表于 2021-11-26 13:06

<p>确定这种jlink7.0,和jlink8.0都能用么</p>

<p>这样就挺好,下载兼容性好</p>

北方 发表于 2021-11-26 13:32

本帖最后由 北方 于 2021-11-26 13:34 编辑

<div class="quote">
<blockquote><font size="2"><a href="forum.php?mod=redirect&amp;goto=findpost&amp;pid=3107118&amp;ptid=1187118" target="_blank"><font color="#999999">Jacktang 发表于 2021-11-26 13:06</font></a></font> 确定这种jlink7.0,和jlink8.0都能用么 这样就挺好,下载兼容性好</blockquote>
</div>

<p>没想到都可以用的.2012年的古董</p>

<ul>
        <li>Firmware: J-Link ARM-OB STM32 compiled Aug 22<span style="color:#e74c3c;"> 2012 </span>19:52:04</li>
        <li>Hardware: V7.00</li>
</ul>

freebsder 发表于 2021-11-26 17:27

<p>谢谢分享,期待后续</p>

hjx12345 发表于 2024-7-19 15:32

<p>复旦微代理商</p>
页: [1]
查看完整版本: 【复旦微FM33LG0系列开发板测评】编译和下载