cancel
Showing results for 
Search instead for 
Did you mean: 

STM32U575 UART stops working if set wrong baud rate at first and then if set correct baud rate

APati.9
Associate

I have configured the STM32U575 UART baud rate to 115200. I tried to send the data from external utility tool with baud rate 9600, since the baud rate is wrong, there won't be any communication.

Now if try to change baudrate to 115200 then also communication is not established.

I have made some workaround to work in the above scenario.

Updated the HAL_UART_IRQHandler(UART_HandleTypeDef *huart) API from stm32u5xx_hal_uart.c

Updated Line:

if((HAL_IS_BIT_SET(huart->Instance->CR3, USART_CR3_DMAR)) ||
((errorcode & (HAL_UART_ERROR_RTO | HAL_UART_ERROR_ORE)) != 0U))

changed to 

if((HAL_IS_BIT_SET(huart->Instance->CR3, USART_CR3_DMAR)) &&
((errorcode & (HAL_UART_ERROR_RTO | HAL_UART_ERROR_ORE)) != 0U))

Is above condition is correct?

0 REPLIES 0