Loading... # 使用CLion开发-STM32F4开启FPU并调用DSP库 ## 下载DSP库 - 可以在ST官网下载 - 可以在Arm这下载最新版本的库https://github.com/ARM-software/CMSIS_5/releases - 下载.pack,用压缩软件打开查看 - 进入`CMSIS\DSP\Lib\GCC\`提取libarm_cortexM4lf_math.a - 进入`CMSIS\DSP\Include\`提取arm_math.h - 在CMakeList.txt中添加链接 ```cmake include_directories(包含arm_math.h的文件夹路径) target_link_libraries(${PROJECT_NAME}.elf ${CMAKE_SOURCE_DIR}/...你自己的路径/libarm_cortexM4lf_math.a) ``` ## 开启FPU - 只需要在CMakeLists中`#Uncomment for hardware floating point`下的配置去除注释就可以了,不需要额外的define标签。 - 之所以不用像Keil一样额外的define,因为在`stm32f407xx.h(2017)`中第52行默认是已经是 `#define __FPU_PRESENT 1U`, 而且在`core_cm4.h(V5.0.8)`中第100行,在__GNUC__默认是 `#define __FPU_USED 1U` © 允许规范转载