cancel
Showing results for 
Search instead for 
Did you mean: 

How to compile arm_math.h source in STM32CubeIDE?

NNada.1
Associate II

Hello All,  

   I am trying to include arm_math.h for STM32F401RE project, I have all the source file of math.h 

However when I try to build it. I am getting multiple defination  error at linking stage.

NNada1_0-1715784456438.png

Can anyone suggest me how to solve this?

 I am not trying to add the lib. But I want to understand how to add the source files of arm_math.h.

Thank you

 

5 REPLIES 5
Andrew Neil
Evangelist III

When you get a 'Multiple Definition' error, it tells you where both of the definitions are - so remove one!

Copy & paste the complete error as text rather than an image.

@Andrew Neil 

Hello Andrew, 

  you are right. However when I search for the mentioned function, there is only one defination. 

 

 

D:/Newton/Courses/Digital Signal Processing/Coding/HAL_WITH_ARM_MATH_H/Debug/..

/Drivers/CMSIS/DSP/Source/TransformFunctions/arm_rfft_q31.c:211:

multiple definition of `arm_split_rfft_q31';

./Drivers/CMSIS/DSP/Source/TransformFunctions/TransformFunctions.o:

D:/Newton/Courses/Digital Signal Processing/Coding/HAL_WITH_ARM_MATH_H/Debug/

../Drivers/CMSIS/DSP/Source/TransformFunctions/arm_rfft_q31.c:211:

first defined here

 

 

Here is the error. I am not able to make any sense out of it. Could you please help me with it?

D:/Newton/Courses/Digital Signal Processing/Coding/HAL_WITH_ARM_MATH_H/Debug/../Drivers/CMSIS/DSP/Source/TransformFunctions/arm_rfft_q31.c:211:

multiple definition of `arm_split_rfft_q31';

./Drivers/CMSIS/DSP/Source/TransformFunctions/TransformFunctions.o:

D:/Newton/Courses/Digital Signal Processing/Coding/HAL_WITH_ARM_MATH_H/Debug/../Drivers/CMSIS/DSP/Source/TransformFunctions/arm_rfft_q31.c:211:

first defined here

So it's telling you that you have multiple definitions of arm_split_rfft_q31

And it tells you that one definition is in the file TransformFunctions.o

And the other definition is in the file arm_rfft_q31.c at line 211

 

Now TransformFunctions.o is a pre-built binary file, and arm_rfft_q31.c is a C source file

 

You need to choose either one or the other - you can't have both in your Project!

@Andrew Neil 

Thank you for breaking down the problem.

I found that in Transform.c all the .c are included 

NNada1_0-1715788407686.png

 Since DSP is a standard library I believe I should not be modifying it. 

Please suggest me how can I resolve this error?


@NNada.1 wrote:

Please suggest me how can I resolve this error?


Again, you need to choose either one or the other - you can't have both in your Project!

There's a knowledgebase article on how to set up the DSP libraries:

https://community.st.com/t5/stm32-mcus/configuring-dsp-libraries-on-stm32cubeide/ta-p/49637