Skip to main content
N B
Associate
April 12, 2017
Question

STM32F205 USART idle interrupt fires for no reason

  • April 12, 2017
  • 1 reply
  • 548 views
Posted on April 12, 2017 at 19:23

Hi

I am implementing a USART driver and would like to use DMA for reception. In order to detect a timeout on the RX line, I use the USART idle interrupt.

The DMA works and I receive the expected characters. However once the line is idle, the IDLE interrupt is fired again and again. I have only enabled the IDLE interrupt, RXNE interrupt is disabled.

Based on the reference manual, I expect the IDLE interrupt to be fired only once after a reception, however this is not the case.

What could be the issue?

    This topic has been closed for replies.

    1 reply

    N B
    N BAuthor
    Associate
    April 13, 2017
    Posted on April 13, 2017 at 09:26

    I will attempt to answer my own question since I was able to resolve the issue. The reason why the interrupt was called repeatedly was that simply clearing the IDLE bit in the SR register was not possible.

    Everything works as expected when the IDLE bit is cleared via the __HAL_UART_CLEAR_IDLEFLAG macro  from the ST HAL library (i.e. reading out the SR register followed by a read to the DR register).