[STM32F4] STM32F4中使用DSP库时遇到的问题

[复制链接]
362|11
SocialButterfly 发表于 2025-9-15 10:05 | 显示全部楼层 |阅读模式
在STM32CubeIDE(STM32F4)中使用DSP库(例如arm_math.h)时遇到的问题。使用CubeIDE v1.0时遇到了相同的问题。我已将arm_math.h、const_structs.h和arm_common_tables.h复制到Drivers/CMSIS/DSP/Include目录中。

在通过以下操作之前,我一直无法找到arm_math.h:进入Project > Properties > C/C++ General > Paths and Symbols > Includes,并添加Drivers/CMSIS/DSP/Include路径。这解决了找不到arm_math.h的问题。

但在此之后,遇到了一系列错误:

__uint32_t

../Drivers/CMSIS/DSP/Include/arm_math.h:6612:3: error: unknown type name 'uint32_t'; did you mean '__uint32_t'?

uint32_t blockSize);

...

...

../Drivers/CMSIS/DSP/Include/arm_math.h:6873:16: error: unknown type name '__STATIC_INLINE'

CMSIS_INLINE __STATIC_INLINE q15_t arm_bilinear_interp_q15(

    ^~~~~~~~~~~~~~~

../Drivers/CMSIS/DSP/Include/arm_math.h:6873:38: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'arm_bilinear_interp_q15'

CMSIS_INLINE __STATIC_INLINE q15_t arm_bilinear_interp_q15(

          ^~~~~~~~~~~~~~~~~~~~~~~

../Drivers/CMSIS/DSP/Include/arm_math.h:6951:16: error: unknown type name '__STATIC_INLINE'

CMSIS_INLINE __STATIC_INLINE q7_t arm_bilinear_interp_q7(

classroom 发表于 2025-9-15 14:55 | 显示全部楼层
路径是否正确?
cr315 发表于 2025-9-15 15:56 | 显示全部楼层
项目配置可能有误!
duo点 发表于 2025-9-15 16:57 | 显示全部楼层
检查Drivers/CMSIS/DSP/Include是否实际包含arm_math.h等文件。
elephant00 发表于 2025-9-15 14:57 | 显示全部楼层
缺少<stdint.h>头文件。
jcky001 发表于 2025-9-15 17:58 | 显示全部楼层
手动包含头文件
flycamelaaa 发表于 2025-9-15 19:59 | 显示全部楼层
是否启用了C99标准,STM32CubeIDE默认可能未启用。
powerantone 发表于 2025-9-15 19:00 | 显示全部楼层
头文件包含顺序错误。
onlycook 发表于 2025-9-15 20:00 | 显示全部楼层
建议使用IDE自带的版本,避免手动复制文件导致冲突。
powerantone 发表于 2025-9-15 21:01 | 显示全部楼层
可以清理重建项目。
probedog 发表于 2025-9-15 22:01 | 显示全部楼层
用最新版STM32CubeIDE和ARM GCC工具链。
stormwind123 发表于 2025-9-15 15:32 | 显示全部楼层
可能是库文件损坏了。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

55

主题

55

帖子

0

粉丝
快速回复 在线客服 返回列表 返回顶部