Skip to main content
JHorv
Visitor II
January 26, 2019
Question

STM32CubeMX HAL drivers: UART - DMA and Receive Timeout Interrupt for variable buffer sizes

  • January 26, 2019
  • 3 replies
  • 1029 views

Regarding to the question posted here:

https://community.st.com/s/question/0D50X00009XkaG2SAJ/using-stm32fcubemx-hal-drivers-for-uart-rx-with-unknown-size-data

I have the exact same problem using a STM32-L432KC. Is there any sample code showing how to implement a Receive Timeout Interrupt handler using HAL?

Thanks in advance

This topic has been closed for replies.

3 replies

S.Ma
Principal
January 26, 2019

Dma needs depend on the baudrate. 115200bps makes 1 byte per 100usec. If the core runs at 48Mhz, thats 4800 cycles: byte by byte interrupt might be an intermediate step?

waclawek.jan
Super User
January 26, 2019
Associate II
January 27, 2019

If you want to check for every single received byte, I'd rather suggest using LL drivers, enable RXNE interrupt and process it within the ISR.

If you want to use DMA, i always suggest the creation of a protocol stack with chunked transfers. This approach solves the fixed-length buffer required by DMA.