Skip to main content
MStee.1
Associate II
May 6, 2021
Solved

Can dual circular DMA buffer be implemented on a single RX USART?

  • May 6, 2021
  • 3 replies
  • 1046 views

Hi everyone

I was wondering if it would be possible to implement a DMA setup without interrupts that maintains two circular buffers for the same USART? I would like to save both the SR and DR register values in two separate circular buffers every time data is transfered to the MCU. The one I'm using is a STM32F205RG. I've read some about double buffer mode which looks promising but im honestly unsure at this point and hopefully you guys can help me.

Thanks in advance, Malte

This topic has been closed for replies.
Best answer by waclawek.jan

Dual buffer DMA in STM32 means, that if one buffer is full, it will automatically switch to the other. This is not what you want.

Unfortunately, there's no way to do what you want. The USART_Rx-triggered DMA can't do anything else just read USART_DR.

JW

3 replies

TDK
May 6, 2021

The RXNE interrupt DMA trigger can only do one thing.

Why do you want to save USARTx->SR? Note that reading SR DR has consequences such as clearing the RXNE flag, which have the potential to cause issues/misinformation for you in such a scheme.

"If you feel a post has answered your question, please click ""Accept as Solution""."
MStee.1
MStee.1Author
Associate II
May 7, 2021

Im using a communication standard that uses frame errors to start communication. Capturing the SR register along with the DR is very crucial for our communication standard to work.

waclawek.jan
waclawek.janBest answer
Super User
May 7, 2021

Dual buffer DMA in STM32 means, that if one buffer is full, it will automatically switch to the other. This is not what you want.

Unfortunately, there's no way to do what you want. The USART_Rx-triggered DMA can't do anything else just read USART_DR.

JW

MStee.1
MStee.1Author
Associate II
May 12, 2021

Thought that might have been the case. Thanks for the help :)