注意:
需要配置UART驱动为Buffer Queue模式,因为Console系统服务使用的是该方式;而且输入使用了数据流方式,所以还得使能“Read/Write Model Support”功能。
UART引脚PPS配置:
生成代码:
在app.c里增加如下测试代码:
void APP_Initialize ( void )
{
/* Place theApp state machine in its initial state. */
appData.state = APP_STATE_INIT;
/* TODO:Initialize your application's state machine and other
*parameters.
*/
SYS_MESSAGE("My first Test Message\r\n");
SYS_PRINT("Test print: appData.state =%x\r\n", appData.state);
}
编译下载测试:
如果有连接到PC,串口助手会得到你的打印信息:
My first Test Message
Test print: appData.state = 0