STM32CubeMX点亮LED,UART

1、创建STM32CubeMX工程STM32CubeMX点亮LED,UART
2、选择芯片型号
STM32CubeMX点亮LED,UART
3、UART时种选择为异步时钟
STM32CubeMX点亮LED,UART
4、串口中断
STM32CubeMX点亮LED,UART
STM32CubeMX点亮LED,UART
5、选择LED输出

STM32CubeMX点亮LED,UART
6、选择外部时钟
STM32CubeMX点亮LED,UART
6、GPIO-LED设置
STM32CubeMX点亮LED,UART
STM32CubeMX点亮LED,UART
STM32CubeMX点亮LED,UART
7、时钟树设置

STM32CubeMX点亮LED,UART
8、选择编译环境、堆栈选大
STM32CubeMX点亮LED,UART
9、每个外设(led、uart)单独文件保留
STM32CubeMX点亮LED,UART
10、ok
STM32CubeMX点亮LED,UART
11、在uart.c中添加一下代码

int fputc(int ch,FILE *f)
{
return HAL_UART_Transmit(&huart1,(uint8_t *)&ch,1,0xffff);
}
STM32CubeMX点亮LED,UART
12、在主函数中年添加
STM32CubeMX点亮LED,UART
13、successful!
STM32CubeMX点亮LED,UART