cancel
Showing results for 
Search instead for 
Did you mean: 

CMSIS DSP and STM32CubeIDE

malatuni
Associate II

I hope you are doing well,

So I've got a problem which its driving me crazy. I am trying to implement FIR filters in my stm32cubeide proyect by using CMSIS-DSP library, but I gess I am not importing the lib correctly or something, because everytime I call the func 'arm_fir_init_f32' it just throws an undefined reference error. I have already followed all the tutorials that I found on youtube to integrate the library in this IDE. I have also tried to just manually copy arm_mat.h and reference the file on top of my main, but that didn't solve the problem.

I have the lastest version of both the IDE and the library, downloaded by the software packs in the .ioc file.

If someone knows what could be the cause, please let me know. Thanks in advance.

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Mahmoud Ben Romdhane
ST Employee

Hello @malatuni ,

First let me thank for posting and welcome to the ST Community.

I suggest that you take a look at this Post .

It explains how to integrate a DSP Libraries on STM32 project.

STM32CubeIDE use GCC compiler, so you need to keep the GCC folder.

Thanks.

Mahmoud.

View solution in original post

6 REPLIES 6
Mahmoud Ben Romdhane
ST Employee

Hello @malatuni ,

First let me thank for posting and welcome to the ST Community.

I suggest that you take a look at this Post .

It explains how to integrate a DSP Libraries on STM32 project.

STM32CubeIDE use GCC compiler, so you need to keep the GCC folder.

Thanks.

Mahmoud.

TDK
Guru

If it's a compiler error, ensure the header file is included before you use the function. If it's a linker error, ensure the library is included. If you don't know which it is, show the full error message with surrounding context.

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

@Mahmoud Ben Romdhane wrote:

I suggest that you take a look at this Post .


It's dated early 2021, and uses IDE v1.5.1 - so quite old.

For adding Include Paths, I note that it's now (v1.13.0) possible to do this straight from the right-click menu in the Project Explorer:

AndrewNeil_0-1705937206559.png

 

Thank you Mahmoud, and everyone for your help. So, I just followed carefully this post, and I got further than before. Now the compiler recognises the FIR functions and shift-click works as well. That said, I am facing other errors:

malatuni_0-1705941784283.png

malatuni_1-1705941900923.png

Thanks again guys,

That's progress. :thumbs_up:

That shows that it is now compiling correctly - just the link is failing.

Please post the message as text (copy & paste) rather than a screenshot

malatuni
Associate II

Ok Ok, I made it work. What was causing the earlier problem was that I didn't select the correct library. It seems that, on the MCU GCC Linker Libraries,

malatuni_0-1705946257279.png

for cortex-M7 based MCUs (as my stm32H723), you can link one of these three:

arm_cortexM7l_math

arm_cortexM7lfdp_math

arm_cortexM7lfsp_math

And I was using the M7l_math. It seems that the first one is intended for non-FPU, while the others use FPU. Because my project has FPU enabled, I just needed to change the library for any of the other two. A more experienced mate told me that the difference between these two is that, the M7lfdp uses double precision, while the second one uses single precision. With the first one, you get a more precise result, at the expense of more time spend calculating it.