1.现象
- 用 Clion 编译 STM32CubeMX 生成的 freertos 代码时报错
C:\Users\1ST-LA~1\AppData\Local\Temp\cc65ZLdd.s: Assembler messages:
C:\Users\1ST-LA~1\AppData\Local\Temp\cc65ZLdd.s:521: Error: selected FPU does not support instruction -- `vstmdbeq r0!,{
s16-s31}'
C:\Users\1ST-LA~1\AppData\Local\Temp\cc65ZLdd.s:543: Error: selected FPU does not support instruction -- `vldmiaeq r0!,{
s16-s31}'
mingw32-make[3]: *** [CMakeFiles\test01.elf.dir\build.make:508: CMakeFiles/test01.elf.dir/Middlewares/Third_Party/FreeRTOS/Source/portable/GCC/ARM_CM4F/port.c.obj] Error 1
mingw32-make[3]: *** Waiting for unfinished jobs....
mingw32-make[2]: *** [CMakeFiles\Makefile2:82: CMakeFiles/test01.elf.dir/all] Error 2
mingw32-make[1]: *** [CMakeFiles\Makefile2:89: CMakeFiles/test01.elf.dir/rule] Error 2
mingw32-make: *** [Makefile:123: test01.elf] Error 2
2.解决方法
- 将
CMakeLists
里浮点数的注释取消后重新编译。
add_compile_definitions(ARM_MATH_CM4;ARM_MATH_MATRIX_CHECK;ARM_MATH_ROUNDING)
add_compile_options(-mfloat-abi=hard -mfpu=fpv4-sp-d16)
add_link_options(-mfloat-abi=hard -mfpu=fpv4-sp-d16)
文章评论