Adding the current CMSIS DSP library to your STM32Cube IDE project

If you program STM32 microprocessors and would like to do some signal processing, you would definitely want to use CMSIS DSP library, which has a rich repository of Math and DSP functions optimised for ARM microprocessors. And if your budget is constrained you would probably use STM32Cube IDE which is free and you can quite easily generate code using the STM32CubeMX capability.

Although adding the current CMSIS DSP manually is quite easy, it is not straightforward to find an official installation procedure. And trying to do it automatically may cause quite a lot of frustration.

The easiest solution I found was in this YouTube Video (from 2:30-5:05). The only trouble is that you cannot find the static library (.a) files in the GitHub repository for CMSIS 5.7 library. You can find them for an older version though.

After some googling I found this reddit post . But in my case automatic code generation caused some issues which I couldn’t resolve.

Instead I recommend going to releases page of the CMSIS 5.7 library and downloading .pack file. I unpacked it using 7zip and then went to .\ARM.CMSIS.5.7.0\CMSIS\DSP\Include and copied “arm_math.h” into an include folder of my project which in my case was: “project_folder\Core\Inc” and then from “.\ARM.CMSIS.5.7.0\CMSIS\DSP\Lib\GCC” I copied an appropriate library file (in my case “libarm_cortexM4lf_math.a” but it may be different for your microprocessor). And then followed instructions from the Youtube video.

NB don’t use .zip file as the library files there are just 1KB, whereas normally they are around 6MB and unpacked folder has just around 100MB where .pack unpacked is around 300MB. I don’t know the reason for that. Maybe I’m missing something or maybe that’s a bug. If you know let me know in the comments.

OK, so far so good, it compiles. I’ll let you all know if I have any issues. And if you have any issues let me know in the comments.

Leave a comment

Your email address will not be published. Required fields are marked *