Skip to main content
OSala.1
Associate
January 21, 2020
Solved

CubeMX CMSIS-DSP Include problems

  • January 21, 2020
  • 5 replies
  • 4144 views

Hello,

I am including the CMSIS-DSP library on my CubeMX project on Additional Software. Using the Library setting instead of Source. However, when I am trying to call a function from arm_math.h the compiler throws an error that it is not possible to find that function call.

Any ideas? How can I include CMSIS-DSP.

I am using GCC compiler and STMCubeIDE

This topic has been closed for replies.
Best answer by oe3arc

I had the same issue with CubeMX 5.5.5, one has to check on this screen the CMSIS packages:0690X00000Bwda8QAB.png

Then arm_math.h will appear:

0690X00000BwdaXQAR.png

You can compile then, but the linker will miss the libraries. Lost a lot of time and figured out, that it worked for me as follows:

Copy both arm_cortexM4lf_math.lib and libarm_cortexM4lf_math.a to a manually created subfolder:

0690X00000BwdarQAB.png

Set the Path for libraries then:

0690X00000BwdbBQAR.png

And specify the library to be used - without extension!!!!:

0690X00000BwdbGQAR.png

Don't know, why I have to copy both arm_cortexM4lf_math.lib and libarm_cortexM4lf_math.a, took a long time to figure out, which type of libray is the right (I have a STM32F4 - it looks like it's little endian, with FPU). Don't know why I have to specify the library name without an extions. But it seems to work now.

Would be fine, if CubeMX takes the decision and does all the work for me.

The documentation state is bad as well.

Or maybe, I'm just too stupid and/or missed any good document...

hth

Andy

5 replies

Nesrine.JLASSI
Visitor II
January 27, 2020

Hello @OSala.1​ 

Which cubeMX version did you use ?

Please try with the lasted version (5.5.0).

Best regards,

Nesrine

oe3arc
oe3arcBest answer
Associate
January 27, 2020

I had the same issue with CubeMX 5.5.5, one has to check on this screen the CMSIS packages:0690X00000Bwda8QAB.png

Then arm_math.h will appear:

0690X00000BwdaXQAR.png

You can compile then, but the linker will miss the libraries. Lost a lot of time and figured out, that it worked for me as follows:

Copy both arm_cortexM4lf_math.lib and libarm_cortexM4lf_math.a to a manually created subfolder:

0690X00000BwdarQAB.png

Set the Path for libraries then:

0690X00000BwdbBQAR.png

And specify the library to be used - without extension!!!!:

0690X00000BwdbGQAR.png

Don't know, why I have to copy both arm_cortexM4lf_math.lib and libarm_cortexM4lf_math.a, took a long time to figure out, which type of libray is the right (I have a STM32F4 - it looks like it's little endian, with FPU). Don't know why I have to specify the library name without an extions. But it seems to work now.

Would be fine, if CubeMX takes the decision and does all the work for me.

The documentation state is bad as well.

Or maybe, I'm just too stupid and/or missed any good document...

hth

Andy

oe3arc
Associate
January 30, 2020

Correction:

> Copy both arm_cortexM4lf_math.lib and libarm_cortexM4lf_math.a to a manually created subfolder:

It is sufficient to copy only libarm_cortexM4lf_math.a.

> And specify the library to be used - without extension!!!!:

Without extension and without the prefix 'lib', i.e. the file namend libarm_cortexM4lf_math.a has to be specified as libarm_cortexM4lf_math.a in the Path and Symbols dialog.

hth

Andy

P.S.: All this should be a nobrainer, if the CubeMX would work correctly :(

DLim.16
Associate III
January 28, 2020

Hi @OSala.1​ 

I'd like to add to Andy's helpful answer and suggest that you also check out this thread to make sure your libraries are valid:

https://www.avrfreaks.net/forum/problem-including-cmsis-dsp-library-atmel-studio-using-atsame54

Good luck.

OSala.1
OSala.1Author
Associate
January 30, 2020

Thanks Andy! That worked well for me.

In older versions I had to manually add CMSIS DSP just like you stated, I thought that in this new CubeMX version they managed to do the work for the user...

PHoll.1
Associate
July 21, 2020

Answer for me was given in this link. gnu linker adds the lib prefix. So without the lib starting in the name it worked for mer

https://electronics.stackexchange.com/questions/486679/stm32cubeide-issues-with-cmsis-dsp-library-files