cancel
Showing results for 
Search instead for 
Did you mean: 

Without enabling UART_IT_ERR(UART error interruption), getting frame error interrupt in STM32L071CBT6TR

HPate.5
Associate II

We are using STM32L071CBT6TR controller.

We are receiving data through UART based on intterupt, for that we have enabled UART_IT_RXNE intterrupt.

We have just enabled UART_IT_RXNE. But still we are getting frame error intterupt, we dont want frame error intterupt.

5 REPLIES 5
gbm
Lead III

I suspect what you get is not a frame error interrupt but rather RXNE interrupt with FE flag being set. The usual solution is to use SR value anded with CR1 value for checking the interrupt flags.

My STM32 stuff on github - compact USB device stack and more: https://github.com/gbm-ii/gbmUSBdevice
HPate.5
Associate II

We are using HAL_UART_IRQHandler function to decode intterupt.

As per attached image we are getting frame error intterupt(Highlighted with yellow colour).

But as per attached image we haven't enable error intterupt(circled as red colour).

So, handler will not go to clear frame error intterrupt and we are getting continuously it.

Note : if we enable error interrupt then MCU is clearing frame error interrupt and we are not getting it continuously

HPate.5
Associate II

Any Update ? Or anything else ?

The ISR of HAL_UART_Receive_IT assumes that the error interrupt is enabled.

Because HAL_UART_Receive_IT enables this interrupt:

https://github.com/STMicroelectronics/STM32CubeL0/blob/00db5bdf2702687f645b65cd800ddc19c6e55878/Drivers/STM32L0xx_HAL_Driver/Src/stm32l0xx_hal_uart.c#L3415

So, you're breaking the contract.

But, I have't enable intterrupt through HAL_UART_Receive_IT.