在usart.c文件底部添加一下代码

#include "stdio.h"

int fputc(int ch,FILE *f)
{
    HAL_UART_Transmit(&huart1,(uint8_t*)&ch,1,10);
    return(ch);
}

其中&huart1是你所使用的串口指针,添加代码后会报错FILE *f未定义,需要添加引用#include "stdio.h"

相关文章:

  • 2021-09-02
  • 2022-12-23
  • 2021-08-03
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-03
  • 2022-12-23
猜你喜欢
  • 2021-07-18
  • 2022-12-23
  • 2022-02-03
  • 2021-09-25
  • 2021-04-01
  • 2021-07-07
  • 2022-12-23
相关资源
相似解决方案