cancel
Showing results for 
Search instead for 
Did you mean: 

UART DMA read firing required only once or every time?

Abhishek Kumar
Associate III
Posted on November 20, 2017 at 20:52

MCU: STM32F777II

I have configured DMA for RX on the UART as:

/* UART7 DMA Init */

/* UART7_RX Init */

hdma_uart7_rx.Instance = DMA1_Stream3;

hdma_uart7_rx.Init.Channel = DMA_CHANNEL_5;

hdma_uart7_rx.Init.Direction = DMA_PERIPH_TO_MEMORY;

hdma_uart7_rx.Init.PeriphInc = DMA_PINC_DISABLE;

hdma_uart7_rx.Init.MemInc = DMA_MINC_ENABLE;

hdma_uart7_rx.Init.PeriphDataAlignment = DMA_PDATAALIGN_BYTE;

hdma_uart7_rx.Init.MemDataAlignment = DMA_MDATAALIGN_BYTE;

hdma_uart7_rx.Init.Mode = DMA_CIRCULAR;

hdma_uart7_rx.Init.Priority = DMA_PRIORITY_MEDIUM;

hdma_uart7_rx.Init.FIFOMode = DMA_FIFOMODE_DISABLE;

Just wanted to when I fire off a DMA read using the HAP api:

HAL_UART_Receive_DMA(&UART_DOWN_USB_TO_SERIAL, (uint8_t*)&holder, 1);

Do I need to call  HAL_UART_Receive_DMA() again in the HAL_UART_RxCpltCallback callback function, or it was required only once provided I need to continue reading it infinitely?

#uart #dma
0 REPLIES 0