cancel
Showing results for 
Search instead for 
Did you mean: 

How to add CMSIS DSP libraries in STM32CubeIDE

CDyer.1
Senior

I want to use the DSP functions that are present in CMSIS. I'm using STM32CubeIDE with my target board being the ST32F411RE Discovery. Using CMSIS DSP with Keil uVision is extremely simple, you just select thew pack you want and use it but it's not so simple with STM32CubeIDE. CMSIS is included with the latest firmware pack STM32Cube_FW_F4_V1.24.2 but there doesn't seem to be any option within CubeMX or the IDE to add the DSP libraries (which are present in the firmware pack). The CORE libraries are added by default. I have added the DSP Include and Source folders to my workspace, I have added the include paths to the IDE but when I add

#include "arm_math.h

 to main.c

I get an error telling me that

fatal error: arm_math.h: No such file or directory

 and it is directed at each DSP source file.

I've spent the last few days trying to get past this. Has anyone used the CMSIS DSP functions in STM32CubeIDE and if so, how have they managed to set up CMSIS DSP to work with the IDE? Are there any further things that I could try with my setup? I'm surpised that the integrated CubeMX code generator doesn't provide the option to include DSP.

Many thanks

16 REPLIES 16

Set up your "Include Paths" properly so the compiler can find the files it is looking for.

Files are in ../CMSIS/DSP/Include not ../CMSIS/DSP

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

I knew the issue was a simple one, thank you I am now at least compiling without errors. Is there a way I can add DSP to the project automatically (or just an easier way) without having to copy and paste the DSP folders to the workspace from the firmware pack, adding the include paths AND adding the preprocessor define symbols? Again, thanks for the help.

DParr.1
Associate

I tried a lot of methods and things and I wasn't able to use any of the arm_* 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

Thank you for your comment, you helped me a great deal. Thank you!

The above youtube link helped in adding arm_math.h file

ChahinezC
Lead

Hello,

I know it is an old thread, but in case there are other members facing a similar issue please refer to the Configuring DSP libraries on STM32CubeIDE FAQ article.

Chahinez.

Hi Chahinez,

Thanks. It helped to get started with the DSP lib. There is also need to add __FPU_PRESENT=1 in the preprocessor symbols, otherwise will stuck with the following error:

"Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"

Robmar
Senior III

This no longer relates in 2020 as CMSIS_5 doesn't included precompiled libs. I also can't find any guidance on how to integrate CMSIS_590 into STECubeIDE, which is surprising.

Has anyone solved this?

eLuigi
Associate II

hello @Robmar (Community Member)​ ,

I did it following this tuto Configuring DSP libraries on STM32CubeIDE

And as mentioned on step 2. Including the DSP libraries and header files : 

"Copy <STM32Cube_Repository>\STM32Cube_FW_F4_V.X.XX.X\Drivers\CMSIS\DSP\Include and paste in in the created folder"

precompiled files you are looking for are there

hope this will help you.