cancel
Showing results for 
Search instead for 
Did you mean: 

DMA Ringbuffer UART circular mode

Brian Dahl
Associate II
Posted on February 25, 2018 at 21:27

Hi,

i have a ringbuffer, for example an 2d Array of fixed uint8_t Bytes. It's possible that the chip at self or triggered in the Callback can update the DMA buffer address????

For example:

#define lines 8
#define bufferlinesize 36
uint8_t rxBuffer[lines][bufferlinesize]
unsigned nItrWrite=0;
.
.
.
void HAL_UART_RxCpltCallback(UART_HandleTypeDef *huart)
{
nItrWrite= (nItrWrite+ 1) % lines;
huart->pRxBuffPtr = rxBuffer[nItrWriteRing];
}�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?

#uart-dma #stm32-l4
3 REPLIES 3
Tilen MAJERLE
ST Employee
Posted on February 26, 2018 at 21:20

Hello

bd

‌,

once you have RxColtCallback event, you have to start DMA read again.

HAL drivers currently don't support circular receive data over DMA.

Best regards,

Tilen

Posted on February 27, 2018 at 08:45

Hi,

Tilen MAJERLE

Why 

HAL drivers currently don't support circular receive data over DMA?

0690X00000609pWQAQ.png
Andrew Neil
Chief II
Posted on February 27, 2018 at 10:32

i have a ringbuffer, for example an 2d Array

Why would a Ring buffer be a 2D array ??