开发板:STM32F411RETX
串口输出选择PA2 PA3串口2作为打印口
串口配置
在usart.c中,加入如下代码,huart2是cube自动生成的一个结构体变量,根据自己生成的修改
#include "stdio.h"
#ifdef __GNUC__
/* With GCC, small printf (option LD Linker->Libraries->Small printf
set to 'Yes') calls __io_putchar() */
#define PUTCHAR_PROTOTYPE int __io_putchar(int ch)
#else
#define PUTCHAR_PROTOTYPE int fputc(int ch, FILE *f)
#endif /* __GNUC__ */
PUTCHAR_PROTOTYPE
{
/* Place your implementation of fputc here */
/* e.g. w