第一步,CubeMX配置串口(GPIO配置略) 第二步,包含头文件 c 1 #include<stdio.h> 第三步,勾选Use Microlib 第四步,重定向printf,此处需要将huart2改为上面配置的串口 c 1 2 3 4 5 intfputc(intc, FILE *stream) { HAL_UART_Transmit(&huart2, (unsignedchar*)&c,1,1000); return1; } 此时即可...