cancel
Showing results for 
Search instead for 
Did you mean: 

Using ARM CMSIS/DSP libraries on STM32U5

jacopokunak
Associate III

Hi,

I want to migrate a project that I have made on a STM32L4 where I make the spectral analysis of the noise that I read from a digital MEMS microphone using the arm_fft dsp functions to a new board with a STM32U5 mcu.

I have tried to include the "libarm_cortex_Mxx_math.a" library to my new project with the STM32U5  but I cannot find it. Is this library available for the U5 microcontroller family ?

 

I am running  "STM32Cube_FW_U5_V1.4.0" firmware package, but under the STM32Cube_FW_U5_V1.4.0\Drivers\CMSIS\DSP I cannot find the folder "Lib" where the compiled arm library for dsp function is usually located.

Where can I find the library for the cortexM33  of my STM32U5  in order to run dsp signal processing functions?

Has the use of this library changed for this new mcu family ? If yes how can I include and make compile the arm dsp functions into my CubeIDE project ?

 

7 REPLIES 7

Do you have the CMSIS 5.6.0 Pack installed?  Here's the path to mine:

~/STM32Cube/Repository/Packs/ARM/CMSIS/5.6.0/CMSIS/DSP/Lib/GCC/libarm_ARMv8MMLlfsp_math.a

AScha.3
Chief III

But you should have the source (not the .lib ) on your drive.   about this :

STM32Cube/Repository/STM32Cube_FW_H5_V1.1.1/Drivers/CMSIS/DSP/Source/

 

And in CubeIDE can choose even:

 

AScha3_0-1706797114612.png

--> source or lib , to select

If you feel a post has answered your question, please click "Accept as Solution".

Yes I do.

I have CMSIS 6.0.0 Pack installed, but under "Repository\Packs\ARM\CMSIS\6.0.0\CMSIS" there is no DSP folder.

I have installed as well Pack CMSIS-DSP 1.15.0 "\Repository\Packs\ARM\CMSIS-DSP\1.15.0" , but I cannot find the Lib folder.

There are some other folders, including the "Include" one where "arm_math.h" is located, but no folders contaning the libraries ".a" files.

 

Where should I look ?

 

Thanks for your help.

Yes I have the source, and it is included in my CubeIDE project as well.

What should I do then?

Simply Include "arm_math.h" wherever I need it in my code and call the functions ?

With the STM32L4 mcu to make ARM library work I had to define which type of core my MCU was running in the "main.h" file. ( #define ARM_MATH_CM4 ).

Do I have to do the same in my project for STM32U5 ?

 

Many thanks for your help.

 

 

Did you select (what you want) in Cube ? (as in my pic... cmsis core + dsp -> as lib )

AScha3_0-1706798914492.png

 

If you feel a post has answered your question, please click "Accept as Solution".

Yes.

I have selected it:

dsp1.png

It gives me the options "Source" and "Not Selected".

Then I also have selected the two middlewares in the CubeMX:

dsp2.png

I generate the code form CubeMx and open In in CubeIDE  and try to build it as is without any modification and some source files belonging to the CMSIS/DSP middeleware give me some comepile errors, for example:

"StatisticsFunctions.c"

dsp3.png

 

These files are provided by ARM/ST , they should compile and work properly. 

Is this CMSIS DSP 1.15.0 stable and working ?

 

jacopokunak
Associate III

I made the project compile, by modifying the source folder structure and by editing some CMSIS DSP source files

following some ideas from this topic:

https://community.st.com/t5/stm32-mcus-embedded-software/quot-first-defined-here-quot-error-with-cmsis-dsp-1-15/td-p/601583

 

1) The Compile Issues I was having were related to the source files with capital letters of the  ARM_CMSIS/Source/Subfolder_xxx that are added to the project when including the ARM_CMSIS_DSP middleware  to the proyect with CubeMX  i.e ( FilteringFunctions.c ) 

  Such files only contain a list of  #include that try to include other .c files 

  ( i.e: "arm_biquad_cascade_df1_32x64_init_q31.c" )  and when you try to build the project you get compile error "No such file or directory".

2) To fix this error I had to manually Import the "Source" folder from my STM32Cube Repository for the STM32U5

 "STM32Cube\Repository\STM32Cube_FW_U5_V1.4.0\Drivers\CMSIS\DSP\Source" which contains all the source files that theses files like "FilteringFunction.c" try to include.

3) Once I replaces the "Source" folder this way I got a different copile error which stated that the functions like for example "arm_biquad_cascade_df1_f32" where already defined in another file.

4) To fix this error I had to comment out all the content from the capital letters starting files like "FilteringFunctions.c" so that in my main file when I include "arm_math.h" and call any mathematic function like "arm_biquad_cascade_df1_f32" the source code of such functions is linked to the definitions that are made in the individual files for each functions linke "arm_biquad_cascade_df1_f32.c" that are present inside the "Source" folder that I manually have imported into the project.

5) To resume the "Source" folder created by CubeMX when adding the ARM_CMSIS_DSP middleware to the project is useless and has to be replaced with the one in the "STM32Cube\Repository\STM32Cube_FW_U5_V1.4.0\Drivers\CMSIS\DSP\Source" excluding all the files that start with capital letters in every subfolder.

 

I think that adding the CMSIS_DSP version 1.15 Middleware to the project by using CubeMX should be reviewed and fixed by ST to make it work properly.

Moreover, the guide and the documentation available online is related to the previous way of adding the CMSIS DSP library where only the ".a" file was needed and this is kind of obsolete if you want to use the new STM32 mcu families.

 

Thank you @lehl for explaining how you solved your issue with CMSIS DSP 1.15, without your explaination I think I wouldnt be able to solve my problem.