CubeMX define "USE_HAL_USART_REGISTER_CALLBACKS"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-04-24 8:14 AM - edited ‎2023-11-20 7:17 AM
Hello,
The CubeMX and the ST HAL has in the files "stm32XXxx_hal_conf.h" the
#define USE_HAL_USART_REGISTER_CALLBACKS
When I looking in the source code, there is no position to find where is this define used:
Searching for 'USE_HAL_USART_REGISTER_CALLBACKS'...
D:\Project\Core\Inc\stm32g4xx_hal_conf.h(108) : #define USE_HAL_USART_REGISTER_CALLBACKS 1U
Lines matched: 1 Files matched: 1 Total files searched: 130
In Activate this configuration with "USART" has no effect (CubeMx).
I think you can delete this define in all your HAL libraries and other software.
Best Regards, Markus
- Labels:
-
STM32CubeMX
-
UART-USART
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-04-25 2:11 AM
It's definitely used. Maybe not with your specific MCU model and STM32CubeMX version. It's used in stm32*_hal_uart.c and stm32*_hal_uart.h with all the MCUs I've used so far. CubeMX has to be compatible with many MCU models and library versions, so it certainly is possible there are unused settings. What's your MCU model and STM32CubeMX version?
Click "Accept as Solution" if a reply solved your problem. If no solution was posted please answer with your own.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-04-25 2:34 AM
- CubeMX: 6.8.0
- STM32G473
- STM32H753
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-04-25 4:39 AM
USE_HAL_UART_REGISTER_CALLBACKS is used, but USE_HAL_USART_REGISTER_CALLBACKS isn't. UARTs, USARTs and LPUARTs use the same code(with checks like IS_LPUART_INSTANCE for the differences) so these callbacks are enabled for all of them or for none of them. They should have changed it so that if USE_HAL_UART_REGISTER_CALLBACKS or USE_HAL_USART_REGISTER_CALLBACKS is set to true that the callbacks are enabled. But they chose to ignore one of them. This is indeed a mistake by ST.
Use the other setting and it should work!
Click "Accept as Solution" if a reply solved your problem. If no solution was posted please answer with your own.
