cancel
Showing results for 
Search instead for 
Did you mean: 

linker not seeing stm32f4xx_hal_tim.h when building project

vbut25
Associate

here's a link to the GitHub issue containing the build output: https://github.com/giff25/MotorTest/issues

I double checked to make sure the HAL_TIM module was enabled, and followed the chain to the .h file itself and still haven't noticed any reason why the linker wouldn't see the TIM functions


Im using a nucleo board and the toolchain is as follows:

built the project using CubeMX (including configuring the timer and pwm channels)
Using VSCode with STM32 VS Code extension

any help would be appreciated

5 REPLIES 5
Pavel A.
Evangelist III

The linker does not see TIM functions likely because the stm32xxx_hal_tim.c or tim_ex.c file is not included in the project. Ensure that these files are included in build.

 

Carl_G
Associate III

Linkers don't really care about header files per se. They are looking for implementations. Can you show the specific negative output or error message?

 

Include files aren't code.

You need to ADD stm32xxx_hal_tim.c or tim_ex.c to the project, so the compiler can generate the objects for the linker to link against.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

Actually I've been so tired and mad about these missing HAL .c files that made this little dirty trick (attached example for STM32H7) .  Build with only this one .c file in sources and remove all other references to the HAL .c files in the project. If some ...hal_.c file is missing, just add it to the list. Hoping no C language purists see us here.

 

 

Carl_G
Associate III

I don't use CubeMX but for CubeIDE there is a place to configure that you want the HAL files. Usually they are enabled but its worth a check.

Carl_G_0-1737421964272.png