STM32F3 UART Interrupt Bug
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2020-03-16 4: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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2020-03-16 5: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.
