STMicroelectronics / stm32f4xx-hal-driver

Provides the STM32Cube MCU Component "hal_driver" of the STM32F4 series.
BSD 3-Clause "New" or "Revised" License
119 stars 50 forks source link

UART IDLE line callback not called #23

Closed Alex-Trusk closed 1 year ago

Alex-Trusk commented 1 year ago

Hi. I'm using UART in circular DMA mode with Idle Line detection, because of variable packet sizes. (STM32F411re) Everything works well but one thing. Assume that RX buffer size is 32 bytes, and the last packet ends precisely on 32th byte. Then TC interrupt is called, but not IDLE line detected interrupt after that. This happens because of these lines in _stm32f4xx_haluart.c: https://github.com/STMicroelectronics/stm32f4xx_hal_driver/blob/f0cfb43dcb15d8c8771f19f062436a1ef5c8f008/Src/stm32f4xx_hal_uart.c#L2489-L2494 I wonder why someone intentionally stopped IDLE detection interrupt parsing? It will be very useful to know if I should wait to some more data or can start parsing function. Can it be changed in future releases?

ASELSTM commented 1 year ago

Hi @Alex-Trusk,

The purpose of the IDLE line is to detect any pause in UART reception flow. However, in your case, the end-of-transfer interrupt is triggered, so the IDLE line is of no use now since the entire package has been received. Therefore there is no point in keeping the IDLE line interrupt active once the transfer complete.

With regards,

ASELSTM commented 1 year ago

Hi @Alex-Trusk,

Please allow me to close this thread as no activity. You may reopen it at anytime if you have any details to share with us in order to help you to solve the issue. Thank you for your comprehension.

With regards,