How to add external libraries in STM32CubeIDE
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2019-09-10 6: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.
- Labels:
-
Cryptography
-
STM32CubeIDE
-
STM32H7 Series
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-03-10 7:15 AM
Hi @Romain DIELEMAN​ I successfully included the library configuring following:
Properties -> C/C++ General -> Paths and Symbols -> Source Location -> Middlewares -> EditProperties -> C/C++ General -> Paths and Symbols -> Library PathsProperties -> C/C++ General -> Paths and Symbols -> Includes -> AssemblyProperties -> C/C++ General -> Paths and Symbols -> Includes -> GNU CProperties -> C/C++ General -> Paths and Symbols -> Includes -> GNU C++Properties -> C/C++ Build -> Settings -> Tool Settings -> MCU GCC Assembler -> Include PathsProperties -> C/C++ Build -> Settings -> Tool Settings -> MCU GCC Compiler-> Include Paths & filesProperties -> C/C++ Build -> Settings -> Tool Settings -> MCU G++ Compiler -> Include Paths & filesProperties -> C/C++ Build -> Settings -> Tool Settings -> MCU G++ Linker -> Include Paths
EDIT: I am uncertain if I chose the correct Folder to add the library to, I would appreciate if you could reply with the correct folder to add "external" libraries" to:
- \TouchGFXProjects\ProjectName\Middlewares\Third_Party\
EDIT2: I ended up only getting a shared library (.so) which is not possible to flash on the MCU since it has to be a static library as I read.
(I am still a beginner therefore such basic mistakes...)
/Rafael
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-05-07 5:09 AM
Hello!
How can i include cryptolyb library .a files into STM32CubeIDE project?
Project doesn't recognize them for now. I put them in source directory in project files catalog.
The following errors occur:
" ../Src/main.c:313: undefined reference to `RSA_PKCS1v15_Encrypt' "
" ../Src/main.c:297: undefined reference to `RNGinit' "
Then i followed instructions from best answer of this topic
And i got another errors:
" c:\st\stm32cubeide_1.4.0\stm32cubeide\plugins\com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.9-2020-q2-update.win32_1.5.0.202011040924\tools\arm-none-eabi\bin\ld.exe: error: STM32L476RG-Nucleo_PollingTagDetect_rbld.elf uses VFP register arguments, C:\git_repos\STM32L476RG-Nucleo_PollingTagDetect_rbld\Middlewares\ST\STM32_Cryptographic\Lib\libSTM32CryptographicV3.0.0_CM4_GCC.a(crypto.o) does not "
" :\st\stm32cubeide_1.4.0\stm32cubeide\plugins\com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.9-2020-q2-update.win32_1.5.0.202011040924\tools\arm-none-eabi\bin\ld.exe: failed to merge target specific data of file C:\git_repos\STM32L476RG-Nucleo_PollingTagDetect_rbld\Middlewares\ST\STM32_Cryptographic\Lib\libSTM32CryptographicV3.0.0_CM4_GCC.a(crypto.o) "
Best regards!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-05-07 6:41 AM
@Wladimir​ My 2 cents looking at your snashot. If 'Libraries (-l)' area takes care.
1) To add ':' char as first character of your library file
2) To add '.a' libray file extension ... full file name including extension as to be provided
Then possibly if linker process still fail reorder our library files ... GCC is order sensitive here ...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-05-07 11:11 AM
Hello Cartu38 OpenDev,
Unfortunately, it didn't help, the error has changed, now can't find the library file. The path to the library file I tried is both absolute and relative to the workspace.
The error is:
" c:\st\stm32cubeide_1.3.0\stm32cubeide\plugins\com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.9-2020-q2-update.win32_1.5.0.202011040924\tools\arm-none-eabi\bin\ld.exe: cannot find -l:STM32CryptographicV3.0.0_CM4_GCC.a "
Best regards, Vladimir
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-05-07 1:19 PM
Have a try about relative path ... works for me
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-05-08 12:47 AM
Hello,
It doesn't help, same error, "can't find -l:STM32CryptographicV3.0.0_CM4_GCC.a"
I entered the path string manually
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-05-08 12:12 PM
@Wladimir​ works for me doing hash computation. Please get a try based on attached project (Please just add back to such delivery middlewares part I've removed because such crypto pack content delivery is under special legal terms ... just copy/paste from pack you have)
Note: I rely on STM32CubeIDE 1.6.1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-05-08 12:54 PM
Thanks, its builded without errors.
Don't understand what is my issue, i'll try to figure it out.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-05-08 11:58 PM
Hello Cartu38 OpenDev,
Do the same in my project and have this errors again:
" c:\st\stm32cubeide_1.4.0\stm32cubeide\plugins\com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.9-2020-q2-update.win32_1.5.0.202011040924\tools\arm-none-eabi\bin\ld.exe: error: STM32L476RG-Nucleo_PollingTagDetect_rbld.elf uses VFP register arguments, C:\git_repos\STM32L476RG-Nucleo_PollingTagDetect_rbld\Middlewares\ST\STM32_Cryptographic\Lib\libSTM32CryptographicV3.0.0_CM4_GCC.a(crypto.o) does not "
" :\st\stm32cubeide_1.4.0\stm32cubeide\plugins\com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.9-2020-q2-update.win32_1.5.0.202011040924\tools\arm-none-eabi\bin\ld.exe: failed to merge target specific data of file C:\git_repos\STM32L476RG-Nucleo_PollingTagDetect_rbld\Middlewares\ST\STM32_Cryptographic\Lib\libSTM32CryptographicV3.0.0_CM4_GCC.a(crypto.o) "
Then i changed floating point settings and it works!)
Have changed from hardware implementation to mixed.
And my project building ok for now!
Best regards!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-05-09 12:09 AM
Yep about VFP message such is right setup to do (by the way part of project I've shared to you).
Such message was not primary one you've shared ... first ones were really archive '.a' file access issue. VFP error is coming when '.a' is linked (found so :-))
Happy you're now able to move on ! Well done.
