2024-04-15 9:13 AM - edited 2024-04-16 12:20 AM
STM32CubeMX offers the user an option to register their own callback functions under the advanced settings tab:
In this example i have enabled the callback registration for CAN aswell as the SDADC. After generating the code my stm32f3xx_hal_conf.h file looks like this:
...
#define USE_HAL_ADC_REGISTER_CALLBACKS 0U /* ADC register callback disabled */
#define USE_HAL_CAN_REGISTER_CALLBACKS 1U /* CAN register callback enabled */
#define USE_HAL_COMP_REGISTER_CALLBACKS 0U /* COMP register callback disabled */
#define USE_HAL_CEC_REGISTER_CALLBACKS 0U /* CEC register callback disabled */
#define USE_HAL_DAC_REGISTER_CALLBACKS 0U /* DAC register callback disabled */
#define USE_HAL_SRAM_REGISTER_CALLBACKS 0U /* SRAM register callback disabled */
#define USE_HAL_SMBUS_REGISTER_CALLBACKS 0U /* SMBUS register callback disabled */
#define USE_HAL_NAND_REGISTER_CALLBACKS 0U /* NAND register callback disabled */
#define USE_HAL_NOR_REGISTER_CALLBACKS 0U /* NOR register callback disabled */
#define USE_HAL_PCCARD_REGISTER_CALLBACKS 0U /* PCCARD register callback disabled */
#define USE_HAL_HRTIM_REGISTER_CALLBACKS 0U /* HRTIM register callback disabled */
#define USE_HAL_I2C_REGISTER_CALLBACKS 0U /* I2C register callback disabled */
#define USE_HAL_UART_REGISTER_CALLBACKS 0U /* UART register callback disabled */
#define USE_HAL_USART_REGISTER_CALLBACKS 0U /* USART register callback disabled */
#define USE_HAL_IRDA_REGISTER_CALLBACKS 0U /* IRDA register callback disabled */
#define USE_HAL_SMARTCARD_REGISTER_CALLBACKS 0U /* SMARTCARD register callback disabled */
#define USE_HAL_WWDG_REGISTER_CALLBACKS 0U /* WWDG register callback disabled */
#define USE_HAL_OPAMP_REGISTER_CALLBACKS 0U /* OPAMP register callback disabled */
#define USE_HAL_RTC_REGISTER_CALLBACKS 0U /* RTC register callback disabled */
#define USE_HAL_SPI_REGISTER_CALLBACKS 0U /* SPI register callback disabled */
#define USE_HAL_I2S_REGISTER_CALLBACKS 0U /* I2S register callback disabled */
#define USE_HAL_TIM_REGISTER_CALLBACKS 0U /* TIM register callback disabled */
#define USE_HAL_TSC_REGISTER_CALLBACKS 0U /* TSC register callback disabled */
#define USE_HAL_PCD_REGISTER_CALLBACKS 0U /* PCD register callback disabled */
...
I am using STM32CubeMX 6.11.0 with a configured project for the STM32F373CCT6 MCU using the STM32Cube FW_F3 V1.11.4 Firmware Package. I'm currently using STM32CubeIDE 1.14.1. I configured the SDADC peripheral for SDADC1 and SDADC3, both configured as 'Single-Ended zero reference'. After this i enabled the register callback option for SDADC under 'Project Manager>Advanced Settings>Register CallBack'. Then press 'Generate Code'.
Using these steps i can reproduce the code that i added above, where the #define for using the SDADC register callback is completely missing from the stm32f3xx_hal_conf.h file
For a quick fix i was able to define USE_HAL_SDADC_REGISTER_CALLBACKS with value 1 as a symbol in CubeIDE under 'Properties>C/C++ General>Paths and Symbols>Symbols' for all configurations and languages, but i hope this will only be a temporary fix.
Solved! Go to Solution.
2024-04-16 3:12 AM
Hello @Heiko_Gericke ,
The issue is reported internally to our team (Internal ticket number: 179076 ) and this will be fixed as soon as possible.
Thanks.
Mahmoud
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2024-04-16 1:31 AM
Hello @Heiko_Gericke ,
First let me thank you for posting and welcome to the ST Community.
The request is under investigation, and I will get back to you ASAP.
Thanks.
Mahmoud.
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2024-04-16 3:12 AM
Hello @Heiko_Gericke ,
The issue is reported internally to our team (Internal ticket number: 179076 ) and this will be fixed as soon as possible.
Thanks.
Mahmoud
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2024-04-16 3:46 AM
Hey Mahmoud,
the quick reply is appreciated. I'm looking forward for this to be fixed.
Thanks,
Heiko