使用UART的基本EVB控制台打印

4新职位/ 0
最后发表
libra_13179
离线
最后看到:5年9个月前
加入:2015-06-16有机会
使用UART的基本EVB控制台打印

嗨对话框

1,使用我们的“模板”项目(DA14580_581_583_SDK_3.0.10.1)
2中,我使用P0_4连接T_RxD, P0_7 T_TxD连接
3所示。我修改如下:

@fileda14580_config.h
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
/ * UART控制台打印* /
#定义CFG_PRINTF
# ifdef CFG_PRINTF
#定义CFG_PRINTF_UART2
# endif
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

@file periph_setup.c
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
空白GPIO_reservations(空白)
{
# ifdef CFG_PRINTF_UART2
RESERVE_GPIO (UART2_TX GPIO_PORT_0、GPIO_PIN_4 PID_UART2_TX);
RESERVE_GPIO (UART2_RX GPIO_PORT_0、GPIO_PIN_7 PID_UART2_RX);
# endif
}
空白set_pad_functions(空白)/ /设置gpio端口功能模式
{
# ifdef CFG_PRINTF_UART2
GPIO_ConfigurePin (GPIO_PORT_0 GPIO_PIN_4、输出PID_UART2_TX,假);
GPIO_ConfigurePin (GPIO_PORT_0 GPIO_PIN_7,输入、PID_UART2_RX假);
# endif
}

空白periph_init(空白)
{
/ /启动外围设备的电源领域
SetBits16 (PMU_CTRL_REG PERIPH_SLEEP 0);
而(! (GetWord16 (SYS_STAT_REG) & PER_IS_UP));

SetBits16 (CLK_16M_REG XTAL16_BIAS_SH_ENABLE 1);

/ /罗补丁
patch_func ();

/ /初始化垫
set_pad_functions ();

#如果(BLE_APP_PRESENT)
/ *
*(重新)外围设备进行初始化
即。
uart_init (UART_BAUDRATE_115K2 3);
* /
# endif

# ifdef CFG_PRINTF_UART2
SetBits16 (CLK_PER_REG UART2_ENABLE 1);
uart2_init (UART_BAUDRATE_115K2 3);
# endif

/ /启用垫
SetBits16 (SYS_CTRL_REG PAD_LATCH_EN 1);
}
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

@file arch_main.c
{

/ *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*主循环
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* /
而(1)
{
arch_printf (“Hello World \ r \ n”);
}
而(1)
{
/ /安排所有未决的事件
如果(GetBits16 (CLK_RADIO_REG BLE_ENABLE) = = 1){/ /启用BLE时钟
如果(GetBits32 (BLE_DEEPSLCNTL_REG DEEP_SLEEP_STAT) = = 0 & & ! (rwip_prevent_sleep_get () & RW_WAKE_UP_ONGOING)){/ /祝福正在运行

....
}
}
}

/ / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / /
n的事实,一个“Hello World”的信息没有印在PC串行控制台。
但“18 00 00”(十六进制)memssage印在PC串行控制台。

设备:
libra_13179
离线
最后看到:5年9个月前
加入:2015-06-16有机会
我看到

我看到
@file arch_main.c
/ / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / /
/ *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*主循环
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* /
arch_printf (“Hello World \ r \ n”);

而(1)
{
......................
}
/ / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / /
@ da14580_config.h
#定义CFG_DISABLE_RTS_CTS
使用UART[显示]13控制台打印

修改如下:

添加以下行:
/ *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*主循环
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* /
arch_printf (“Hello World \ r \ n”);

而(1)
{

}

MT_dialog
离线
最后看到:1年3个月前
工作人员
加入:2015-06-08 34
嗨libra_13179,

嗨libra_13179,

对不起,这是否解决了你的问题吗?

由于MT_dialog

libra_13179
离线
最后看到:5年9个月前
加入:2015-06-16有机会
嗨MT_dialog

嗨MT_dialog
解决了我的问题,谢谢

主题锁定