USARTx DMA ring buffer for STM32F779-Eval board

Google+ Pinterest LinkedIn Tumblr +

I have recently been playing with UART and DMA, although i’m still getting my head around it,.

DMA allows you to transfer large amounts of data through the system without getting the processor core involved. Rather than the CPU laboriously reading a byte, the writing a byte from one buffer to another, you’d give the DMA controller a pointer to the start of a source buffer, a pointer to the start of the destination buffer, and then specify how many bytes you need moved. The DMA hardware would then handle the data transfer between the buffers, while the CPU would be free to do other things. It DMA controller can also do this with little overhead, whereas an interrupt is going to, as its name states, interrupt the CPU in order to handle whatever the interrupt needs to be done.

DMA is very efficient for transmission when a block of data is to be sent. However, It can however become a bit complicated when flow control can cause the block to have to be suspended during mid-transmission.

The following source code is a simple library for USART(1-3-6) of the STM32F779NI-Eval Board.




Leave A Reply