Skip to main content
Johannes
Senior
March 29, 2020
Solved

STM32F2xx "USE_HAL_xx_REGISTER_CALLBACKS": where to set them in CubeIDE?

  • March 29, 2020
  • 4 replies
  • 1361 views

I use CUBEIDE 1.3.0 with MCU Package STM32F2 V1.9.0 for Nucleo F207.

This package generates a file "stm32f2xx_hal_config.h". In this file, all "USE_HAL_***_REGISTER_CALLBACK" defines are set / not set.

What is the proper way to enable these defines? I don't find a switch within the CubeIDE environment. These defines are not in a Begin_user / End-User section. If I enable one, it got overwritten by next time code-generation.

Other CPU types like STM32L4 MCU Packages don't generate these defines, I normally set these as global define with the compiler preprocessor settings.

With F2xx MCU Package, this does not help. The compiler complains about "redefinition" of these defines.

File: stm32f2xx_hal_config.h
 
#define USE_HAL_SPI_REGISTER_CALLBACKS 0U /* SPI register callback disabled */
#define USE_HAL_TIM_REGISTER_CALLBACKS 0U /* TIM 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 */

This topic has been closed for replies.
Best answer by jnewcomb

Now supported in CubeMX. From the help PDF:

0693W000007D0XnQAK.png 

4 replies

Imen GH
ST Employee
March 31, 2020

​Hello @Johannes​,

Your reported case will be raised internally to take in consideration.

Regards

Imen

Khouloud OTHMAN
Associate
April 6, 2020

Hello jvisser,

Could you please share your ioc file ?

Thanks,

Khouloud

Johannes
JohannesAuthor
Senior
April 6, 2020

See attached file. This file is for STM32F072, happens here as well. (from CUBE_IDE)

Johannes

jnewcomb
jnewcombBest answer
Associate
January 28, 2021

Now supported in CubeMX. From the help PDF:

0693W000007D0XnQAK.png