2020-12-16 10:18 PM
Hi,
I started from scratch and successfully created STM3232H7B3I-DK project as in Workshop2020.
Now i added a project library, it compiles and produces .a file but i have this message:
libModuleA.a: file not recognized: File format not recognized.
I suppose I have to setup the correct toolchain but i do not know how.
The current toolchain is Cross GCC CDT internal builder.
Many thanks if someone can help.
Regards
Solved! Go to Solution.
2020-12-17 01:02 AM
The Project properties "C/C++ Build">"Settings"> contains a "Tool Settings" tab. Here the "MCU Settings" node contains configuration of the Floating point ABI.
The easiest way to create a library project and get it work is to crate this as a new STM32 project using "File">"New">"STM32 Project". Select "Static library" instead of "Executable" binary type.
2020-12-16 10:46 PM
Hi FMarr.2,
Did you try to follow the guide in STM32CubeIDE User Guide on how to include libraries in projects?
See chapter 2.5.8
Instead of using "libModuleA.a" as the name in "C Linker">"Libraries" please only use "ModuleA"
2020-12-16 11:37 PM
Hi,
Thanks for reply.
Sorry I probably did not explain myself correctly.
I want to add a library Project to my workspace.
The only way i found to compile it is to choose GCC CDT internal builder. Incuding g++ in the path.
It produces the file, the file libModuleA is found but not recognize as a library file.
The g++ i found in C:\TouchGFX\4.13.0\env\MinGW\bin\g++.exe
I modified the output exetension from .so to .a . Can I ??
I attach the Library project if you want
Thanks very much
2020-12-17 12:22 AM
Update:
Instead of creating a shared library, i create a static library (it is not what i want, just try)
there i can select MCU ARM GCC, in the build artifacts estention modified to a.
Build. OK.
Link fails with this message
error: STM32H7B3I-DK-1.1.08.elf uses VFP register arguments, C:\Progetti\STM_ModuleB\Debug\libModuleB.a(CMachine.o) does not.
Am i moving in the right direction?
2020-12-17 12:29 AM
Update
It seems i am not settings the correct MCU settings like -mfloat-abi=hard.
But i do not know how to do.
2020-12-17 01:02 AM
The Project properties "C/C++ Build">"Settings"> contains a "Tool Settings" tab. Here the "MCU Settings" node contains configuration of the Floating point ABI.
The easiest way to create a library project and get it work is to crate this as a new STM32 project using "File">"New">"STM32 Project". Select "Static library" instead of "Executable" binary type.
2020-12-17 01:10 AM
Yes, it is what i am doing as i wrote previously. But the combo box where select Floating-point unit is empty.
and there is this error to solve
error: STM32H7B3I-DK-1.1.08.elf uses VFP register arguments, C:\Progetti\STM_ModuleB\Debug\libModuleB.a(CMachine.o) does not.
2020-12-17 01:17 AM
I assume the empty combo box is when you open properties for the library project. There might be a problem to do this if the library project was created as a "C/C++ project" instead of a STM32 library project.
Did you try to open the settings and make the change in the executable project?
If it does not work please try to create a STM32 library project and insert your library files into this.
2020-12-17 01:39 AM
It works, thanks
2020-12-17 01:40 AM
Good to hear!