1、重定义错误
d:/software_code/embedded/gcc-arm-none-eabi-10-2020-q4-major/bin/../lib/gcc/arm-none-eabi/10.2.1/../../../../arm-none-eabi/bin/ld.exe: CMakeFiles/F4_FreeRTOS_demo.elf.dir/Core/Src/main.c.obj:D:\software_code\Embedded\blushless\F4_FreeRTOS_demo\Peripheral/lcd_font.h:433: multiple definition of `tfont24'; CMakeFiles/F4_FreeRTOS_demo.elf.dir/Core/Src/freertos.c.obj:D:\software_code\Embedded\blushless\F4_FreeRTOS_demo\Peripheral/lcd_font.h:433: first defined here
d:/software_code/embedded/gcc-arm-none-eabi-10-2020-q4-major/bin/../lib/gcc/arm-none-eabi/10.2.1/../../../../arm-none-eabi/bin/ld.exe: CMakeFiles/F4_FreeRTOS_demo.elf.dir/Core/Src/stm32f4xx_hal_msp.c.obj:D:\software_code\Embedded\blushless\F4_FreeRTOS_demo\Peripheral/lcd_font.h:433: multiple definition of `tfont24'; CMakeFiles/F4_FreeRTOS_demo.elf.dir/Core/Src/freertos.c.obj:D:\software_code\Embedded\blushless\F4_FreeRTOS_demo\Peripheral/lcd_font.h:433: first defined here
d:/software_code/embedded/gcc-arm-none-eabi-10-2020-q4-major/bin/../lib/gcc/arm-none-eabi/10.2.1/../../../../arm-none-eabi/bin/ld.exe: CMakeFiles/F4_FreeRTOS_demo.elf.dir/Core/Src/stm32f4xx_it.c.obj:D:\software_code\Embedded\blushless\F4_FreeRTOS_demo\Peripheral/lcd_font.h:433: multiple definition of `tfont24'; CMakeFiles/F4_FreeRTOS_demo.elf.dir/Core/Src/freertos.c.obj:D:\software_code\Embedded\blushless\F4_FreeRTOS_demo\Peripheral/lcd_font.h:433: first defined here
d:/software_code/embedded/gcc-arm-none-eabi-10-2020-q4-major/bin/../lib/gcc/arm-none-eabi/10.2.1/../../../../arm-none-eabi/bin/ld.exe: CMakeFiles/F4_FreeRTOS_demo.elf.dir/Core/Src/usart.c.obj:D:\software_code\Embedded\blushless\F4_FreeRTOS_demo\Peripheral/lcd_font.h:433: multiple definition of `tfont24'; CMakeFiles/F4_FreeRTOS_demo.elf.dir/Core/Src/freertos.c.obj:D:\software_code\Embedded\blushless\F4_FreeRTOS_demo\Peripheral/lcd_font.h:433: first defined here
d:/software_code/embedded/gcc-arm-none-eabi-10-2020-q4-major/bin/../lib/gcc/arm-none-eabi/10.2.1/../../../../arm-none-eabi/bin/ld.
解决方法在函数前面加上静态声明。
2、程序卡死在if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK)
解决方法:
查看cubemx的设置,使用了外部晶振但是是否把HSE设置为旁路晶振,以下为正确设置: