Skip to main content
nicolas
Senior II
November 19, 2025
Solved

HAL_UART_Init() assert with LPUART at high baudrate

  • November 19, 2025
  • 2 replies
  • 138 views

I call HAL_UART_Init() with LPUART1 at 20Mbaud but when I activate assertion it fail at IS_UART_BAUDRATE().
The IS_UART_BAUDRATE() is not correct for LPUART that can have a baudrate up to 53.3 Mbaud.
Also for UART, the comparaison in IS_UART_BAUDRATE() should be <= instead of < like in IS_LL_USART_BAUDRATE().

2 replies

TDK
Super User
November 19, 2025

> LPUART that can have a baudrate up to 53.3 Mbaud

This can't possibly be correct. What clock settings are getting you up to 53.3 Mbaud?

 

> Also for UART, the comparaison in IS_UART_BAUDRATE() should be <= instead of < like in IS_LL_USART_BAUDRATE()

Agreed.

"If you feel a post has answered your question, please click ""Accept as Solution""."
nicolas
nicolasAuthor
Senior II
November 20, 2025

Why wouldn't it be possible ? LPUART can generate 9600 baud from 32768 Hz.

From RM: lpuart_ker_ck_pres must range from 3 x baud rate to 4096 x baud rate.

So with 160 MHz, 53.3 Mbaud is possible.

You can also check with CubeMX.

nicolas
nicolasAuthor
Senior II
November 24, 2025

Because of lack of official response, i have open an issue on github:

https://github.com/STMicroelectronics/stm32u5xx-hal-driver/issues/28