cancel
Showing results for 
Search instead for 
Did you mean: 

HAL_UART_Init() assert with LPUART at high baudrate

nicolas
Senior II

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().

3 REPLIES 3
TDK
Super User

> 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".

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
Senior II

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

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