IDLE interrupt on STM32F0 fires when enabling it
Hi,
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
https://community.st.com/0D50X00009XkW2nSAF
. 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);
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. #usart-idle #hal-usart #uart-dma #uart-it #stm32-f0 #f0
