2022-10-17 12:21 AM
If I create a STM32 static-lib project there are no linker settings available.
Why?
Please refer the attached image.
Solved! Go to Solution.
2022-10-17 12:56 PM
Hi,
A "static library" project is just a collection of object-files in a zip-file.
The C Linker is therefore not involved in the build process at all.
Normally the build process for a static library includes only the:
The object-files contains the instructions for each function that is built by the library project.
Careful the .o-file is in binary format you will need to use "objdump" to translate back to assembler...
The purpose is to allow customers to build static libraries to be shared across projects or MCUs...
But - I would not use that project type in the screenshot at all. It is a legacy project. Instead refer to the UM2609 as advised by @KDJEM.1 and use the approach shown in the chapter mentioned. That project type has the ability to set the "mcpu=cortex-m?" flag per build configuration which truly enables sharing code in libraries cross products/projects.
2022-10-17 01:54 AM
H @OBorg.1,
When create the STM32 static library project, please make sure to follow properly the steps as described in the User Manual UM2609 available on our Website and precisely Section 2.2.2 Creating a new STM32 static library project.
When your question is answered, please close this topic by choosing Select as Best. This will help other users find that answer faster.
Thank you
Kaouthar
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2022-10-17 02:06 AM
Ok-good hint, thx for the quick answer.
But I am still wondering about the purpose of the static-lib option in the STM32 project wizard (please refer to the attached image).
If the flow in the user manual is recommended... what is the purpose of the wizard's option?
2022-10-17 12:56 PM
Hi,
A "static library" project is just a collection of object-files in a zip-file.
The C Linker is therefore not involved in the build process at all.
Normally the build process for a static library includes only the:
The object-files contains the instructions for each function that is built by the library project.
Careful the .o-file is in binary format you will need to use "objdump" to translate back to assembler...
The purpose is to allow customers to build static libraries to be shared across projects or MCUs...
But - I would not use that project type in the screenshot at all. It is a legacy project. Instead refer to the UM2609 as advised by @KDJEM.1 and use the approach shown in the chapter mentioned. That project type has the ability to set the "mcpu=cortex-m?" flag per build configuration which truly enables sharing code in libraries cross products/projects.
2022-10-17 10:34 PM
Hi,
Thx for the great support, I will follow your suggestions. :thumbs_up: