2020-10-16 01:38 AM
In a similar question it is recommended to carry out the instructions:
void HAL_UART_ErrorCallback (UART_HandleTypeDef * huart)
{
// I implement this .. but eventually you can decide with different approach
// Many macros / proc on this code .. is just to be a hint (mem / rec about this possibility)
__HAL_UART_CLEAR_OREFLAG (huart);
__HAL_UART_CLEAR_NEFLAG (huart);
__HAL_UART_CLEAR_FEFLAG (huart);
/ * Disable the UART Error Interrupt: (Frame error, noise error, overrun error) * /
__HAL_UART_DISABLE_IT (huart, UART_IT_ERR);
// The most important thing when UART framing error occur / any error is restart the RX process
if (huart-> Instance == USART1)
{
// Restarting the RX, .. 1 byte. .. u8DATRxBuffer is My own rx buffer
HAL_UART_Receive_IT (huart, u8DATRxBuffer1, 1);
}
}
But HAL_UART_Receive_IT always returns with HAL_Ko,
blocking reception.
I think further resets are missing ...