AnsweredAssumed Answered

Restarting DMA with new configuration

Question asked by ayyala on Oct 12, 2016
Latest reply on Oct 13, 2016 by ayyala
Hello,

I am using STM32F030x. I am trying to read the data from the UART using DMA (channel 2 -> Tx and channel 3-> Rx ). I used CubeMx to generate the initial code and configuration. The DMA is configured in NORMAL mode. 

I use HAL_UART_Receive_DMA() to start and receive the data on the UART.

Now, I have to collect the data into another memory location after a certain time while the initial transfer is not complete. To do this I stop the DMA using HAL_UART_DMAStop() and re-enable the new transmission using HAL_UART_Receive_DMA() . 

The problem I am facing is that between this HAL_UART_DMAStop and HAL_UART_Receive_DMA, the chip is taking too much time and I am loosing data which is coming on the UART.

I would like to know if there is another way to reconfigure the DMA memory register and Size without stopping the DMA or in the fastest way possible.

Outcomes