首页 > 其他 > 详细

rt-thread之rt_kprintf函数输出串口设备更改

时间:2019-01-30 15:23:43      阅读:778      评论:0      收藏:0      [点我收藏+]

@2019-01-30

【小记】

  一般 rt-thread 发布的 bsp 库默认的 rt_kprintf 函数的输出设备是串口1,想要更改输出设备为串口1,以 stm32 为例步骤如下:

首先,打开 UART2 设备

其次,在 menuconfig 中 RT-Thread Kernel --- Kernel Device Object --- Using console for rt_kprintf 修改 the device name for console 的值为 uart2

最后,在文件 <stm32f1xx_hal_msp.c> 中加入串口2相关的时钟、引脚配置信息即可

rt-thread之rt_kprintf函数输出串口设备更改

原文:https://www.cnblogs.com/skullboyer/p/10337838.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!