AnsweredAssumed Answered

IDLE interrupt on STM32F0 fires when enabling it

Question asked by B Zikhali on Jan 31, 2018
Latest reply on May 6, 2018 by Carlos Diaz



I am trying to implement variable message length UART reception using USART IDLE IT and the DMA on the STM32F072 as detailed in this very helpful blog post. I have discovered that the IDLE interrupt fires for absolutely no reason when I enable it: 



SET_BIT(huart2.Instance->CR1, USART_CR1_IDLEIE);


This happens even if I disable and re-enable the UART before and after setting the IDLEIE flag. 


TLDR: Immediately after enabling the UART peripheral using the CR1_EN bit, the ISR_IDLE bit is set to 1. If I clear immediately after this, it will be raised again so I have to wait at least a few functions later to clear it, otherwise setting the CR1_IDLEIE enable will immediately trigger an interrupt.

This behavior is not present on the STM32 F4.