Skip to main content
nanotronicsnss
Associate III
May 25, 2021
Solved

DMA_UART_Receive_Problem_Reg

  • May 25, 2021
  • 4 replies
  • 1976 views

Hi,

I am using STM32H750VB Controller. I am using DMA transmit and Receive(Circular Mode) .In receive I am defining an DMA array of fixed size of 10 bytes. My problem is that when 5 bytes of data(first data) is received the array gets updated (Position 0 - 5) and when after some seconds if I receive the second data with 6 bytes the array gets updated (Position 6 to 10).Is there a way to update or reinitialize the DMA array so that if second data comes it starts from array initial position.(Position 0 to 6) .

I have also tried with normal DMA mode and also Circular DMA mode. Have attached the settings screenshot.

This topic has been closed for replies.
Best answer by TDK

You'll need to stop the first transfer with HAL_UART_Abort and start another one.

4 replies

TDK
TDKBest answer
May 25, 2021

You'll need to stop the first transfer with HAL_UART_Abort and start another one.

"If you feel a post has answered your question, please click ""Accept as Solution""."
nanotronicsnss
Associate III
May 26, 2021

thank u for your help...

waclawek.jan
Super User
May 25, 2021

Or just set the Circular mode, and remember where was the end of the previous data - from there you will start to pick the new data.

JW

Pavel A.
May 25, 2021

Use the Receive timeout (RTO) feature with circular DMA to detect the pause between data blocks.

Enable RTO interrupt and handle the data received before. Then mark the current receive position and repeat.