2022-09-10 09:24 AM
IDE: STM32CubeIDE Version: 1.10.1
Board: NUCLEO H743ZI2
Created STM32 Executable project as follow (Targeted Project Type: STM32Cube):
And configure the device as needed, it runs great without any issues.
Now I wanted this project to be static library so I can use it as base to other projects, I changed the Build Artifact from Executable to Static Library as follow:
Then I created new STM32 Executable project as follow (Targeted Project Type: Empty):
and linked it with the static library of the first project.
The Executable project have temp file with function just to have something, I'm using the main function from the StaticLibrary Project
Now when I run the new executable it goes to function:
__weak void HAL_MspInit(void)
at the file stm32h7xx_hal.c which is empty function and not to the function:
void HAL_MspInit(void)
at file stm32h7xx_hal_msp.c which as the actual code needed
I'v seen topics with this issue, they talk about the flag -ffunction-sections that should resolve the problem, it doesn't help me.
Attach small workspace with the projects that show the problem.
Any suggestions?
2022-09-11 02:53 AM
Maybe help little c++ - __attribute__((weak)) and static libraries - Stack Overflow