cancel
Showing results for 
Search instead for 
Did you mean: 

Would like to understand why, when CubeMX is used to configure the USART2 the project is set up to ENABLE the UART module as set in the conf.h and not the USART.

GreenGuy
Lead

CubeMX version 6.3.0

CubeIDE version 1.7.0

STM32Cube_FW_H7_V1.9.0

The code section in the conf.h file to enable the USART (line 79) is block commented out and line 78 is not commented out which reads:

#define HAL_UART_MODULE_ENABLED

Also I have ENABLED the Register Callbacks for the USART and see that reflected in the stm32h7xx_conf.h but I do not see any code actually registering my callback functions. In fact if I highlight USE_HAL_USART_REGISTER_CALLBACKS in the conf.h file and search for any references to that text in the project, the search comes up empty.

I must be missing something.

2 REPLIES 2
Pavel A.
Evangelist III

STM32H7 has three kinds of UARTs, called USART, UART and LPUART.

From the HAL library developers view they all are very similar so they just use the driver file named "uart". Because most normal people know this device as UART.

One should need the "usart" driver only for some esoteric modes.

If not using the synchronous modes, the lower function library is used to save code space.​

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..