cancel
Showing results for 
Search instead for 
Did you mean: 

Is the stm32xxxx_hal_conf.h missing in stm32xxxx_hal_***.h?

Hello,

I was creating a new project for STM32WL in STM32CubeMX today, and I wanted to use the "register callbacks" functionality for a timer peripheral. So I have enabled the callback feature and generated the project. When I opened it the symbols for callbacks were not defined. I started digging around and found out that the symbol **USE_HAL_TIM_REGISTER_CALLBACKS** was set to value **1** in the *stm32wlxx_hal_conf.h*. But this header is not included in the *stm32wlxx_hal_tim.h* so callbacks enumeration is not created. The *stm32wlxx_hal_tim.c* is including the *stm32wlxx_hal.h* so the register/unregister functions are created correctly.

Am I missing something? How the HAL driver can work if the structure defined in the header file does not contain callbacks definitions?

Sorry if someone already asked, but I couldn't find any topic that addresses this.

Best regards,

Tomas.

1 ACCEPTED SOLUTION

Accepted Solutions
TDK
Guru

stm32wlxx_hal_tim.c includes stm32wlxx_hal.h:

https://github.com/STMicroelectronics/STM32CubeWL/blob/main/Drivers/STM32WLxx_HAL_Driver/Src/stm32wlxx_hal_tim.c#L187

which includes stm32wlxx_hal_conf.h:

https://github.com/STMicroelectronics/STM32CubeWL/blob/main/Drivers/STM32WLxx_HAL_Driver/Inc/stm32wlxx_hal.h#L30

which includes your definitions, including USE_HAL_TIM_REGISTER_CALLBACKS.

You are possibly assuming that stm32wlxx_hal_tim.c includes stm32wlxx_hal_tim.h directly, which is not the case.

If you feel a post has answered your question, please click "Accept as Solution".

View solution in original post

2 REPLIES 2
TDK
Guru

stm32wlxx_hal_tim.c includes stm32wlxx_hal.h:

https://github.com/STMicroelectronics/STM32CubeWL/blob/main/Drivers/STM32WLxx_HAL_Driver/Src/stm32wlxx_hal_tim.c#L187

which includes stm32wlxx_hal_conf.h:

https://github.com/STMicroelectronics/STM32CubeWL/blob/main/Drivers/STM32WLxx_HAL_Driver/Inc/stm32wlxx_hal.h#L30

which includes your definitions, including USE_HAL_TIM_REGISTER_CALLBACKS.

You are possibly assuming that stm32wlxx_hal_tim.c includes stm32wlxx_hal_tim.h directly, which is not the case.

If you feel a post has answered your question, please click "Accept as Solution".

Damn sorry for the stupid question. I was misled by my IDE which complained about the unknown symbol(s), but everything is included correctly (the compiler can resolve all symbols after all).