2019-09-10 06:05 AM
Hi, I'd like to know if it is possible to add external libraries on STM32CubeIDE and if yes, how.
In particular, I'd like to use cryptographic functions on my NUCLEO-H753ZI. And I found a library on the web I could use in the form of an archive file (.a) + a header file. How can I integrate this archive in my project so I can use the functions of the library ?
Thank you in advance for your answer.
Solved! Go to Solution.
2022-07-26 04:37 AM
"under Project > Properties > C/C++ Build > Settings > Tool Settings > MCU GCC Linker > Libraries add the .a library name and the path to that file. This shall make the linker happy. Note that you don't enter the "lib" prefix and the extension .a, e.g. when the filename is libmylib.a, enter mylib
Besides, under MCU GCC Compiler > Include paths add the path to the header files to make the compiler happy."
This may have worked in 2019 but it does not appear to work now, Cube IDE v1.10.1.
I have a file called libc-weakened.a (basically the old libc.a but with the mutex symbols weakened using objcopy, so the completely useless empty mutex functions can be replaced with real ones) and can't get it to be recognised. It appears on the LD command line ok, although there is no space after the -l (it shows cannot find -lC:/KDE485/Project1/LIBC/libc-weakened.a) so I tried double quotes and a leading space, still with no luck.