cancel
Showing results for 
Search instead for 
Did you mean: 

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

MStee.1
Associate II

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

1 ACCEPTED SOLUTION

Accepted Solutions

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

View solution in original post

4 REPLIES 4
TDK
Guru

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
Associate II

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.

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

Thought that might have been the case. Thanks for the help 🙂