微波EDA网,见证研发工程师的成长!
首页 > 硬件设计 > 嵌入式设计 > 9G-NUC140 新唐CM0+EWARM入门开发过程简介

9G-NUC140 新唐CM0+EWARM入门开发过程简介

时间:11-29 来源:互联网 点击:

rtupiarstartup_NUC1xx.s”解压到
“D:works9G-CM09G-NUC140spBoot”,把“NUC100SeriesBSPCMSISCM0DeviceSupportNuvotonNUC1xx”下的H和C文件及“NUC100SeriesBSPCMSISCM0CoreSupport”下的H和C文件解压到
“D:works9G-CM09G-NUC140spCmsis”;

3,在“EWARM”的IDE菜单中选择“Project”->“Options”中的“General Options”的“Target”中的“Device”中选择“Nuvoton NUC140xE”,在“Linker”菜单中选择“Linker configuration file”里选择
“override default”并填上“$PROJ_DIR$configNUC140_Flash.icf,在“Library Configuration”下的库选项用“FULL”在“Library Opitions”下的“printf”和“scanf”格式也用“FULL”;

4,在“Options for node nuc140”的“Category:”中选择上“Debugger”,在“Setup”->“Driver”中选择“Third-Party Driver”,然后在“Third-Party Driver”选择驱动到
“C:Program FilesNuvoton ToolsNu-Link_IARNu-Link_IAR.dll”,在“C/C++ Compiler”下的“Preprocessor”下面的方框内填上:
$PROJ_DIR$..inc
$PROJ_DIR$..sp
$PROJ_DIR$..spCmsis
$PROJ_DIR$..spDriver

5,在“Debugger”的“Download”勾选择“Use flash loader”和“override default .board file”并填入“$TOOLKIT_DIR$configflashloaderNuvotonNUC100_APROM.board”,把
“C:Program FilesNuvoton ToolsNu-Link_IARSamplesNUC140_PWMconfig”下的“NUC140_Flash.icf”和“NUC140_Ram.icf”复制到“D:works9G-CM09G-NUC140prjconfig”,
把“C:Program FilesNuvoton ToolsNu-Link_IARSamplesNUC140_PWM”下的“SH_retarget.c”和“SH_startup_NUCxxx_iar.s”复制到“D:works9G-CM09G-NUC140spBoot”;

6,在“IAR Embedded Workbench IDE”的“Workspace”下的“Files”中右击选择“Add”->“Add Group”并填入“sys”,另外同样建立“bsp”,“drv”,“src”等目录,然后在“sys”上右击
选择“Add”->“Add Files” 然后选择“D:works9G-CM09G-NUC140spBoot”下的“SH_retarget.c”,“SH_startup_NUCxxx_iar.s”和“D:works9G-CM09G-NUC140spCmsis”下的
“core_cm0.c”和“system_NUC1xx.c”;同样用“Add”->“Add Files”把“D:works9G-CM09G-NUC140spDriver”的文件添加到“bsp”目录;(retarget.c和DrvUSB.c除外)

7,在“D:works9G-CM09G-NUC140src”中建立“main.c”,然后添加到工程的“src”中,并在“main.c”中填入下面内容:
#include
#include
#include

int main(void)
{
uint32_t i=0;

/* Output a message on Hyperterminal using printf function */
printf("");
printf("*** 9G-NUC120 V1.00 Build byyuanxihua@21cn.comon ("__DATE__ " - " __TIME__ ")");
printf("*** 9G-NUC120 V1.00 Rebooting ...");

while(1)
{
GPA_DOUT =0xffff;
for(uint32_t j = 0; j <1000000; j++);
GPA_DOUT =0x0000;
for(uint32_t j = 0; j <1000000; j++);

printf("*** 9G-NUC140 V1.00 Running %d Times...",i++);
}
}

(编译时会有与core_cm0.h与“C:Program FilesIAR SystemsEmbedded Workbench 6.0arminccintrinsics.h”相冲突时,
把有问题的uint32_t改回相应的 unsigned long即可;)

8,在“Debugger”的“Download”勾选择“Use flash loader”和“override default .board file”并填入“$TOOLKIT_DIR$configflashloaderNuvotonNUC100_LDROM.board”,可以把
相应的程序烧进LDROM区;

9,在“EWARM”的IDE菜单中选择“Nu-Link”->9,在“EWARM”的IDE菜单中选择“Nu-Link”->“ICP Programming Tool”中,可以不擦除整片FLASH直接

Copyright © 2017-2020 微波EDA网 版权所有

网站地图

Top