cancel
Showing results for 
Search instead for 
Did you mean: 

Stm32 HAL library timer

Amine cheriti
Associate II

Hi guys,

So I used an example of the HAL library to configure an input capture with a timer on a stm32f373vct6 microcontroller.

Now I want to include this example in my project, but when I do so and try to build the compiler says :

Error: L6218E: Undefined symbol HAL_TIM_IC_Init (referred from)

I properly included the stm32f3xx_hal.h library and the stm32f3xx_hal_conf.h but still it does not work.

From previous thread(https://community.st.com/s/question/0D50X00009XkhxaSAB/error-l6218e-undefined-symbol-haladcinit-referred-from-maino) I saw that you need to define some params.

I went into the stm32f3xx_hal_conf.h library, and removed the ifdef condition for the stm32f3xx_hal_tim.h library but still it does not work.

Thank you for the help !

1 ACCEPTED SOLUTION

Accepted Solutions

Got to also add the source files for the library to your project.

So "Add existing files to project", and then navigate up and across to the drivers directories

STM32Cube_FW_F3_V1.10.0\Drivers\STM32F3xx_HAL_Driver\Src\stm32f3xx_hal_tim.c

STM32Cube_FW_F3_V1.10.0\Drivers\STM32F3xx_HAL_Driver\Src\stm32f3xx_hal_tim_ex.c

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

View solution in original post

2 REPLIES 2

Got to also add the source files for the library to your project.

So "Add existing files to project", and then navigate up and across to the drivers directories

STM32Cube_FW_F3_V1.10.0\Drivers\STM32F3xx_HAL_Driver\Src\stm32f3xx_hal_tim.c

STM32Cube_FW_F3_V1.10.0\Drivers\STM32F3xx_HAL_Driver\Src\stm32f3xx_hal_tim_ex.c

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

Hello Clive,

Thank you for your answer, it solved my problem.

I will leave this here for anyone who would face the same issue : 

This linker error means you're program did not find some functions. So find the file with the missing function, add it to your project(make sur this file properly finds the libraries it needs). 

This file will also probably call some functions that are not defined anywhere in your project. You will need to find the source file, add it to your project and make sur this file properly finds the libraries it need.... 

After adding a couple of source files and libraries you will be able to use the STM32 HAL(in my case HAL_Timer) in your project without any issues.

Hope this helps.

tags : STM32 HAL,HAL_Timer,HAL_ADC, Error: L6218E: Undefined symbol HAL_