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

@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相关的时钟、引脚配置信息即可

猜你喜欢

转载自www.cnblogs.com/skullboyer/p/10337838.html