Skip to main content
HPate.5
Associate II
October 12, 2022
Question

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

  • October 12, 2022
  • 5 replies
  • 2685 views

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.

This topic has been closed for replies.

5 replies

gbm
Super User
October 12, 2022

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
HPate.5Author
Associate II
October 12, 2022

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
HPate.5Author
Associate II
October 17, 2022

Any Update ? Or anything else ?

Pavel A.
October 17, 2022

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.

HPate.5
HPate.5Author
Associate II
October 18, 2022

But, I have't enable intterrupt through HAL_UART_Receive_IT.