先在cube里面下载相应的库,此处使用F407IGHX
找到库位置,下载,并引用(此版本为1.3,对版本有特殊需求的可以手动添加高级版本)
在左侧最下方打开DSP库
之后生成代码
此处用keil打开
在stm32f407xx.h中这个最后一个注释
#define __CM4_REV 0x0001U /*!< Core revision r0p1 */
#define __MPU_PRESENT 1U /*!< STM32F4XX provides an MPU */
#define __NVIC_PRIO_BITS 4U /*!< STM32F4XX uses 4 Bits for the Priority Levels */
#define __Vendor_SysTickConfig 0U /*!< Set to 1 if different SysTick Config is used */
//#define __FPU_PRESENT 1U /*!< FPU present */
即最后一行注释并且
在
加入,ARM_MATH_CM4,__FPU_PRESENT(注意逗号)
编译完成后就可以使用 "arm_math.h"文件了