when uart over run happens by using stm32 hal lib, the system hang
Dear Sir/Madam:
I use three uart of stm32f4 : uart1, uart2 and uart6
I have some problems . when uart1 has overrun error,
all system get stuck there. I read some websites about this.
they mention that in the hal lib, clear ORE does not work, they said, only reading uart data register , this bit will clear. I do that, still do not work:
void HAL_UART_IRQHandler(UART_HandleTypeDef *huart)
{
...
tmp1 = __HAL_UART_GET_FLAG(huart, UART_FLAG_ORE);
tmp2 = __HAL_UART_GET_IT_SOURCE(huart, UART_IT_ERR);
/* UART Over-Run interrupt occurred ----------------------------------------*/
if((tmp1 != RESET) && (tmp2 != RESET))
{
#if 1// I add this , but it does not work, system still hang/stuck when ore happens,
// any clue?
uint8_t sysRxChar; // clear the regular interrupt
sysRxChar = (uint8_t) huart->Instance->DR;
#endif
// if does not really clear big
__HAL_UART_CLEAR_OREFLAG(huart);
huart->ErrorCode |= HAL_UART_ERROR_ORE;
}
...
}
reference link is:
https://github.com/particle-iot/firmware/pull/796/commits/677b4b114b9b6503dcd10ddb83d128c9a65d6640
https://github.com/particle-iot/firmware/issues/776
thanks
roseanne
