STM32CubeMX HAL drivers: UART - DMA and Receive Timeout Interrupt for variable buffer sizes
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2019-01-26 3:28 AM
Regarding to the question posted here:
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
- Labels:
-
DMA
-
Interrupt
-
STM32CubeMX
-
STM32L4 series
-
UART-USART
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2019-01-26 6:35 AM
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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2019-01-26 11:51 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2019-01-27 4:37 AM
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.
