[Solved]Problem with Usart Irq
Hi at all,
Sometime happens that usart2 irq freeze and HAL_UART_RxCpltCallback isn't called.
From this moment I can send data (I use blocking instruction HAL_UART_Transmit), but don't receive any.
When this happens, HAL_UART_ErrorCallback don't called too.
In this situation, HAL_Receive_IT returns always HAL_BUSY.
I tried to solve calling these instruction when the status is different from HAL_OK:
__HAL_UART_CLEAR_OREFLAG(huart);
__HAL_UART_CLEAR_NEFLAG(huart);
__HAL_UART_CLEAR_FEFLAG(huart);
__HAL_UART_DISABLE_IT(huart, UART_IT_ERR);
huart->ErrorCode = HAL_UART_ERROR_NONE;
Uart2Status = HAL_UART_Receive_IT(huart, (uint8_t *)&ch, 1);
This solution seems to solve for some tries only.
At the moment, when IRQ freeze, to solve the problem, I must to restart device.
The problem is random.
Can you help me?
Thanks.
