AnsweredAssumed Answered

STM32 HAL UART Error managment

Question asked by gualdi.mauro on Oct 12, 2015
Latest reply on Oct 27, 2015 by sinacori.francesco
Hi All,
i have a problem with the managment of the UART Error.
Particularly when the error occurs in "HAL_UART_ERROR_ORE", the device is locked and I can not clear the error.
I tried using the following instructions, under callback error funcion:

void HAL_UART_ErrorCallback(UART_HandleTypeDef *huart)
{
__HAL_UART_SEND_REQ (Huart, UART_RXDATA_FLUSH_REQUEST);
uint8_t tmp = (uint8_t) huart-> Instance-> RDR;
__HAL_UART_CLEAR_OREFLAG (Huart);

huart->ErrorCode = HAL_UART_ERROR_NONE;
}

But the error flag continues to recover, and the UART remains locked.

Thank you,
Mauro.

Outcomes