- This topic has 1 reply, 2 voices, and was last updated 7 years, 9 months ago by .
Viewing 2 posts - 1 through 2 (of 2 total)
Viewing 2 posts - 1 through 2 (of 2 total)
- You must be logged in to reply to this topic.
Home › Forums › Mastering STM32 book support forum › HAL_UART_Receive_DMA with unknown number of bytes?
Hi Carmine, Thanks for the excellent book. If I understand chapter 9 correctly, UART RX using DMA in interrupt mode, will interrupt after a given number of bytes received. If I don’t know how may bytes are being transferred, then I would have to set the len argument to 1 and interrupt on each byte received, and add it to an RTOS queue (or ringbuffer) that I can service when my app has time. In this use case, does using DMA provide any performance benefit over a non DMA RX interrupt?
Hi,
No. There is no performance improvement at all. The cost to configure/arm the DMA is much higher. DMA works well with fixed length messages, and when the message has a sufficient length. I think that interrupt mode is the best solution for your application.