2020-03-16 04:36 AM
Hi, if I call: HAL_UART_Receive_IT, and I disable all the error IRQ (I don't want to be waken if I sleep) with the following instruction: __HAL_UART_DISABLE_IT(&huartx,UART_IT_ERR) ;
The uC stops to run because the HAL doesn't manage the IRQ error if they are disabled even if there are some pending interrupt so, inside the user code of the USARTx_IRQHandler() I have to put this code:
if((__HAL_UART_GET_IT(&huart1, UART_IT_FE) != RESET))
{
__HAL_UART_CLEAR_IT(&huart1, UART_CLEAR_FEF);
return;
}
Is there a better solution?
2020-03-16 05:48 AM
So you have changed a bit in a hardware register, and HAL got confused. It is certainly a bug, but not necessarily in HAL.
> Is there a better solution?
Yes. Replacing HAL functions with your own, implementing exactly the functionality you need, as documented in the reference manual.