STM32 printf() 重定向到串口UART

1,重定义 fputc 函数

 

2,包含头文件 #include "stdio.h"

 

3,代码中即可使用 printf() 打印

 

✳ 如果编译没有报错但是串口工具没有接收到打印,检查下有没有勾选 MicroLIB

 

posted @ 2021-09-02 00:35  纸船  阅读(185)  评论(0编辑  收藏  举报