Skip to main content
May 28, 2019 6:43 AM UTC
Question

Using DSP libraries (e.g. arm_math.h) in STM32CubeIDE, STM32F4

Hi I need some help,

I am having the same problem using CubeIDE v1.0. I have copied the arm_math.h, const_structs.h and arm_common_tables.h into Drivers/CMSIS/DSP/Include.

I was not able to find arm_math.h until I went to Project > Properties > C/C++ General > Paths and Symbols > Includes and added in Drivers/CMSIS/DSP/Include. That fixed the problem of not finding arm_math.h

After which I get a whole bunch of errors:

 __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(

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

Thanks!

This topic has been closed for replies.

34 replies

FAsch
Associate
Oct 14, 2019 11:48 AM UTC

Hey,

is there any progress in the topic? Is ST working on that problem?

Sincerely yours Florian

Georgy Moshkin
Senior
Oct 15, 2019 1:21 AM UTC

Last time I've checked it did not performed automatically in CubeIDE. Libraries may be added manually using steps described in "2019/8/21 – Using FFT, FIR and other CMSIS DSP library math functions on STM32F4". "Undefined reference" errors are possible when arm_cortexM4lf_math is not added under Project → Properties → C++ general → Paths and Symbols → "Libraries" / “Library Paths�?. Clean install of CubeMX adds libraries to the project automatically, but this functionality somehow is broken after integration of CubeMX into TrueStudio (CubeIDE). I think this problem is not yet fixed because it does not cause problems when opening existing DSP library projects, and only when generating new ones.

Check my STM32 Bootloader - flash your STM32 with AES-encrypted binaries right from web browser!
chaaalyy
Senior II
Apr 1, 2020 9:42 PM UTC

Step 1: Copy CMSIS/Drivers/DSP/ Include and Source folders like you already did

Step 2: Add /DSP/Include - folder to your include path settings

Step 3: under "Symbols" add TWO of them : a) ARM_MATH_CM7 (for M7 CPUs) b) __FPU_PRESENT (each of them without values)

Step 4: have Fun ;)

It seems, you missed step 4b ...

/Charly

DParr.1
Visitor II
Jun 7, 2020 8:48 PM UTC

I was getting a lot of errors as well, I tried many things and the most I achieved was to be able to have the #include "arm_math.h" in the file without generating compilation error, but I wasn't able to use any of the library functions.

I found a video and following the "Preparations" section [min 2:29-5:00] solved the issues to me.

This is the video:

https://www.youtube.com/watch?v=vCcALaGNlyw

Hope this helps

fdunn
Visitor II
Jun 27, 2020 6:29 PM UTC

Thank You

This answer and video worked for me .

K.G.Boos.1
Visitor II
May 15, 2022 3:55 PM UTC

@weehong.yeo​ Just want to say a HUGE thank you for this thread. Spent hours struggling till I found your excellent description!

May 17, 2022 1:39 AM UTC

No prob! Glad it is helpful! :)