Skip to main content
CDyer.1
Associate III
December 18, 2019
Question

How to add CMSIS DSP libraries in STM32CubeIDE

  • December 18, 2019
  • 16 replies
  • 21080 views

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

This topic has been closed for replies.

16 replies

Tesla DeLorean
Guru
December 18, 2019

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 (See Profile) Up vote any posts that you find helpful, it shows what's working..
CDyer.1
CDyer.1Author
Associate III
December 18, 2019

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
Visitor II
June 7, 2020

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

sezgin135
Associate
June 9, 2020

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

ChahinezC
Associate II
April 23, 2021

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.

Jatala
Associate II
May 3, 2021

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 II
November 8, 2022

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?

DGupt
Associate III
November 30, 2022

Hi

Were you able to figure out how to integrate latest CMSIS- DSP which atm is 1.14.2 to stm32 cube ide?

Thanks

Robmar
Senior II
November 30, 2022

I tried manually using the Cmsis github but it wasn't compatible, so I'll have wait until STM fix the problem.​ STMCube32IDE is quite unstable though they've just released a full update. Hoping that might fix it.

eLuigi
Associate
November 8, 2022

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.

rclar.6
Associate III
January 18, 2023

I just set a #define at the top

of file "Drivers/CMSIS/Include/core_cm4.h"

which forced it. Using STM32F446RE btw.

FFTs etc now running fine.

#define __FPU_PRESENT 1U