cancel
Showing results for 
Search instead for 
Did you mean: 

Adding external GCC libraries to STM32Cube project

NRasm.1
Associate II

Hi,

I was looking on some tutorials to do FFT on the NUCLEO-L476RG board, where they recomended using CMSIS DSP library. The DSP configuration guide from ST (link below) said to add the library path under Project Properties ->Tool Settings ->GCC Linker. The issue is the GCC Linker settings doesn't show up under Tool Settings in my project, as seen in the picture i've attached. I've tried adding it to the G++ Linker instead, but that didn't work, I suppose because the library is written for GCC.

Is there any other way to add libraries, or is there something i need to do to make this setting show up?

Link to guide:

https://community.st.com/s/article/configuring-dsp-libraries-on-stm32cubeide

Picture of tool settings:

0693W00000QLEWvQAP.png

7 REPLIES 7
Nikita91
Lead II

GCC linker can link C libraries.

GCC++ linker can link C and C++ libraries.

You get the GCC++ linker setting because probably you selected C/C++ at the project creation.

"but that didn't work"

What didn't work?

What dit you set in the setting windows (libraries and libraries path)?

NRasm.1
Associate II

I can only see the G++ Linker, and not the GCC++ linker. Is it the same thing?

Adding the library to the G++ linker didn't work. I added the path to the CMSIS DSP Lib folder in the libraries library search path -L section of the G++ linker, as they instructed in the guide.

C:\Users\<username>\STM32CubeIDE\workspace_1.10.0\<project_name>\Drivers\CMSIS\Lib

Include path0693W00000QLJdhQAH.pngLibrary and search path

0693W00000QLJc5QAH.pngSymbol

0693W00000QLJeGQAX.pngError when trying to #include math library

0693W00000QLJf9QAH.png

Nikita91
Lead II

Libraries are different than sources files (.c, .cpp, .h).

If you have the library as object (.a or .lib) add the path in the library window of linker setting .

If the library is in source, add the source and incluse path as usual in the compiler setting.

0693W00000QLKR8QAP.png

NRasm.1
Associate II

I have it as a .a file (libarm_cortexM4lf_math.a), so I added the containing folder under G++ Linker -> Library search path -> add. But it still says Unresolved inclusion: "arm_math.h" when i try to include it in main.

Nikita91
Lead II

Add the path to the library .h files to the incluse path of the compiler (double check the path!)

Add the path to the .a file to the library path of the linker library setting (-L)

Add the . a file to the linker library setting (-l)

NRasm.1
Associate II

Tried remaking the project again, and it works now. I must have made a mistake in the project setup. Thanks for you help and patience!

I am facing same issue , how to resolve this Capture-2.PNGCapture.PNG