Loading...
 

SW4STM32 and SW4Linux fully supports the STM32MP1 asymmetric multicore Cortex/A7+M4 MPUs

   With System Workbench for Linux, Embedded Linux on the STM32MP1 family of MPUs from ST was never as simple to build and maintain, even for newcomers in the Linux world. And, if you install System Workbench for Linux in System Workbench for STM32 you can seamlessly develop and debug asymmetric applications running partly on Linux, partly on the Cortex-M4.
You can get more information from the ac6-tools website and download (registration required) various documents highlighting:

System Workbench for STM32


Linker file cannot find my libraries

I am having trouble to link the demo firmware for the STM32F429I-Discovery
All C files compile correctly, but the build fail as the linker cannot find my libraries.
I don’t understand as the library names and directories are correct (we can see see them in the invocation command after -L and -l)
Any idea how to solve this?
I am under the impression the -lxxx options should be placed before the -o option, but I don’t know how to change that

Building target: STM32F429-DISCO_Demo.elf

Invoking: MCU GCC Linker

arm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -L”C:\DATA\projects\eclipse\stm32f429i-disco_hal_lib\Debug” -L”C:\DATA\projects\eclipse\stm32f429i-disco_hal_lib\Middlewares\ST\STemWin\Lib” -T”C:\DATA\projects\eclipse\STM32F429-DISCO_Demo\LinkerScript.ld” -Wl,-Map=output.map -Wl,--gc-sections -o “STM32F429-DISCO_Demo.elf” @”objects.list” -lSTemWin526_CM4_GCC -llibstm32f429i-disco_hal_lib

c:/program files/sw4stm32/plugins/fr.ac6.mcu.externaltools.arm-none.win32_1.1.0.201503101257/tools/compiler/bin/../lib/gcc/arm-none-eabi/4.8.4/../../../../arm-none-eabi/bin/ld.exe: cannot find -lSTemWin526_CM4_GCC

c:/program files/sw4stm32/plugins/fr.ac6.mcu.externaltools.arm-none.win32_1.1.0.201503101257/tools/compiler/bin/../lib/gcc/arm-none-eabi/4.8.4/../../../../arm-none-eabi/bin/ld.exe: cannot find -llibstm32f429i-disco_hal_lib

collect2.exe: error: ld returned 1 exit status

make: *** [STM32F429-DISCO_Demo.elf] Error 1

Hi,

using a GNU toolset in order to link with a library called libstm32f429i-disco_hal_lib (or for sempicity libMyLib) you have to pass the name of library without the prefix “lib”. So in your case -lstm32f429i-disco_hal_lib (or -lMyLib).

Regards,
Stefano



Hi,
I have been the same issue with IDE Eclipse + ARM GCC toolchain. When I add my library to include Path in:
Preferences->C/C++ General-> Pahs and Symbols
1
2
And when I build my project, I have this input. My linker reported this error.
4
Please help me, I tried all advise from google :-(
Best regards,
Daniel

Hi Daniel,

Can you rename your file “MyLib.a” into “libMyLib.a” and change the library reference in Properties > C/C++ General > Paths and Symbols > Libraries from “MyLib.a” into “MyLib”.

As Stefano said, with the GNU GCC toolset, the static library file name should contain the suffix “lib” and the library build (-lxxxx) option is the library name without suffix nor extension.

Hope it will help you,
Kevin.

Just a small remark for more clarification on the very useful comments from Kevin..

”......As Stefano said, with the GNU GCC toolset, the static library file name should contain the suffix “lib” and the library build (-lxxxx) option is the library name without suffix nor extension”

should be read as ..
prefix “lib” (& not suffix “lib”)
“.a” format is the library format. So, while puttin in -(lxxx), the “.a” shall not be mentioned


I have renamed the library and changed the references as stated above, however, still get the following when compiling the code:

undefined reference to `GUI_X_Config’
undefined reference to `LCD_X_Config’
undefined reference to `GUI_X_Init’
undefined reference to `GUI_X_Unlock’
GUI_Task.c:(.text.GUI_Lock+0xa): undefined reference to `GUI_X_Lock’
GUI_Task.c:(.text.GUI_Lock+0xe): undefined reference to `GUI_X_GetTaskId’
GUI_Task.c:(.text.GUI_Lock+0x26): undefined reference to `GUI_X_GetTaskId’
GUI_Task.c:(.text.GUI_Lock+0x30): undefined reference to `GUI_X_Lock’
GUI_Task.c:(.text.GUI_Lock+0x34): undefined reference to `GUI_X_GetTaskId’
GUI_Task.c:(.text.GUI_Lock+0x5c): undefined reference to `GUI_X_GetTaskId’

Anyone managed to figure this out with AC6?

Thanks

Hi gharibi,

I have the same problem: I added “${ProjDirPath}/Middlewares/ST/STemWin/Lib/STemWin528_CM4_GCC.a” in Libraries (Properties -> Paths and Symbols)
I also tried to rename with lib in suffix and prefix and with or without “.a” but always this message : “....ne-eabi/4.9.3/../../../../arm-none-eabi/bin/ld.exe: cannot find -lD:/Users/Guillaume/STM32Projects/test2.0/testa/Middlewares/ST/STemWin/Lib/STemWin528_CM4_GCC.a ”

Why there is a ” -l ” before “D:/Users/Guillaume/STM32Projects/test2.0/testa/Middlewares/ST/STemWin/Lib/STemWin528_CM4_GCC.a “? I think it could be the issue but I tried to change the way in the objects.mk file but because of it’s a derivated file, I can’t do anything.

Thank you,
Guillaume

France

Here, the problem is due to the fact that, for GCC, libraries should have a name starting by “lib” and finish by “.a”; here STemWin528_CM4_GCC.a can’t be included simply

The simplest way to include it needs

  1. To manually rename STemWin528_CM4_GCC.a to, for example, libSTemWin.a
  2. To add two settings, both located in project >> Properties >> C/C++ Build >> Settings >> MCU GCC Linker >> Libraries:
    • in the Libraries (-l) pane, add STemWin
    • in the Library search path pane add ${ProjDirPath}/Middlewares/ST/STemWin/Lib


Then the linker should find the STemWin library

Hope this helps,

Bernard (Ac6)

Dear Bernard,

Thank you for your answer, it perfectly works!

Best regards,

Guillaume

Dear Bernard,

I could not find the mentioned link for my project.
project >> Properties >> C/C++ Build >> Settings >> MCU GCC Linker >> Libraries.

Attached screenshot for referene.