【复旦微FM33LG0系列开发板测评】编译和下载
[复制链接]
本帖最后由 北方 于 2021-11-26 10:35 编辑
1. GPIO工程代码分析
不管东西南北,万事皆可电灯,所以从GPIO开始做起,不过,代码实在是太太简单明了。
#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);
}
}
初始化包括,时钟,板卡,配置和用户自定义,然后就是循环,
LED0_TOG();
FL_DelayMs(5000);
问题就是没有API代码导则,这个肿么整。那么其实还是来自厂家的定义文档,
#define LED0_TOG() FL_GPIO_ToggleOutputPin(LED0_GPIO, LED0_PIN)
文件的还是都是来自如下
#include "fm33lg0xx_fl.h"
2. 项目的编译
点击编译,可以直接开始编译,顺利通过。
3. 代码下载
这个板子如果空白的芯片没有焊上,应该就是一个各个引脚引出的裸板,需要自备调试器去下载。
经测试,以下各款老爷调试器都可用,一个是jlink7.0,一个是jlink8.0,看来是芯片没有验证和加锁的流程,其中jlink OB款是限制在厂家用的公版,用起来也不错。
采用SW下载,只需要2根SWO和SCK,分别是数据和时钟下,如下连接。下载的时候,还需要一个reset键置位,下载过程中提示有这个问题,但是没有点reset也顺利下载了。
控制台输出如下,
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[1]: Stopped AP scan as end of AP map has been reached
* JLink Info: AP[0]: AHB-AP (IDR: 0x04770021)
* JLink Info: Iterating through AP map to find AHB-AP to use
* JLink Info: AP[0]: Core found
* JLink Info: AP[0]: 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[0] @ E00FF000
* JLink Info: ROMTbl[0][0]: E000E000, CID: B105E00D, PID: 000BB00D ???
* JLink Info: ROMTbl[0][1]: E0001000, CID: B105E00D, PID: 000BB00A DWT
* JLink Info: ROMTbl[0][2]: 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
按照上面的说明,如果下载器如果没有专门的下载键,按一下reset就可以了。
原来的delay延时是1秒,1000ms,改成200ms快闪模式还比较顺利,就是有点太闪亮了。
吐槽一下:最近收到了神州数码作为代理的电话,其实还是觉得国产芯片选用这样的美国公司做代理总让人觉得怪怪的,联想能把公司做亏损了再去科创板上市,同时高管上亿年薪秒杀作为老板的李书福。与其这样,我更愿意用TI的产品,如果要选代理也去找艾睿。
|