2024-01-22 04:59 AM
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.
Solved! Go to Solution.
2024-01-22 06:29 AM
2024-01-22 06:29 AM
2024-01-22 06:31 AM
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.
2024-01-22 07:28 AM
@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:
2024-01-22 08:45 AM
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:
Thanks again guys,
2024-01-22 09:03 AM - edited 2024-01-22 09:26 AM
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
2024-01-22 10:01 AM - edited 2024-01-22 10:13 AM
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,
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.