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

Many Thanks Bro

Hi

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

Thanks

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.

DGupt
Associate III

Hi

I tried adding the source and include folder manually and it worked for me, you just have to configure few files not to build as mentioned by @seppeltronics_v​  in the attached document.

DGupt
Associate III

Hi

I tried adding the source and include folder manually and it worked for me, you just have to configure few files not to build as mentioned by @seppeltronics_v​  in the attached document.

Thanks

Hi! Im using 1.11.0 and wanted to add CMSIS-DSP to a Cortex-M0 project.

I also struggled at first, but managed to do it pretty easily at the end:

  1. In CubeMX: Go to Software Packs in the title list -> Manage Software Packs -> ARM->CMSIS -> Install it
  2. In CubeMX: Go to Software Packs in the title list --> Select Pack Components -> Search for CMSIS -> Select ARM.CMSIS (in my Case 5.6.0), select "CMSIS-DSP" "Library" in the dropdown
  3. In Cube MX under "Software Packs" in the menu on the left (below Middleware and so on), select arm CMSIS and Tick the box.
  4. Regenerate Code
  5. Add the correct symbol for the preprocessor to tell the lib, which Cortex you are using (in my case "ARM_MATH_CM0").
  6. Add the include "arm_math.h" in main.c
  7. Rebuild everything. It should run through without errors.

Hope this helps!

rclar.6
Senior

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