1. 在main函数前面添加:
int fputc(int ch,FILE *f){ uint8_t temp[1]={ch}; HAL_UART_Transmit(&huart1,temp,1,2); return(ch);}
2. USE Micro Lib