AnsweredAssumed Answered

DMA Ringbuffer UART circular mode

Question asked by Brian Dahl on Feb 25, 2018
Latest reply on Feb 27, 2018 by Andrew Neil


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];