Skip to main content
Tomáš Juřena
Senior
November 11, 2022
Solved

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.

This topic has been closed for replies.
TDK
TDKBest answer
November 11, 2022

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""."

2 replies

TDK
TDKBest answer
November 11, 2022

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""."
Tomáš Juřena
Senior
November 11, 2022

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).