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:
HAL_UART_Receive_DMA(&huart2, UART_RXBUFFER, UART_RXBUFFERSIZE);
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.