cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F3 UART Interrupt Bug

ArsRoberto
Associate II

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?

1 REPLY 1
berendi
Principal

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.