源码如下,主要想实现串口发送功能,可是ICE调试的时候串口并没有发送,新手没碰过ARM,源码如下
#include<stdio.h>
#include"NUC1xx.h"
#include"DrvSys.h"
#include"DrvGPIO.h"
#include"DrvUART.h"
//#include"NUC122.h"
#include"DrvTimer.h"
void ARMTargetInit(void)
{
STR_UART_T sParam;
UNLOCKREG(); // 解锁系统寄存器
SYSCLK->PWRCON.OSC22M_EN = 1;// 初始化系统时钟
SYSCLK->PWRCON.XTL12M_EN = 1;
SYSCLK->CLKSEL0.HCLK_S = 0;
sParam.u32BaudRate = 115200; //初始化UART
sParam.u8cDataBits = DRVUART_DATABITS_8;
sParam.u8cStopBits = DRVUART_STOPBITS_1;
sParam.u8cParity = DRVUART_PARITY_NONE;
sParam.u8cRxTriggerLevel= DRVUART_FIFO_1BYTES;
DrvSYS_SelectIPClockSource(E_SYS_UART_CLKSRC, 0);
DrvUART_Open(UART_PORT0, &sParam);
DrvGPIO_InitFunction(E_FUNC_UART0);
}
int main (void)
{
ARMTargetInit();
printf("run task2,the OsfasfSTime is ");
printf("run task2,the OSTime is ");
printf("run task2,thddsfs ");
printf("run task2,the OfadfSTime is ");
printf("run task2,the OafdfSTime is ");
} |