Skip to main content
AlexSmart
Associate III
November 26, 2021
Solved

STM32H7 DMA Speed

How fast is DMA on STM32H7 mcus? I didnt find any description on how many ticks takes one transaction.

I linked DMA to a timer, transfer from memory to port. With system clock 480 MHz and timer DMA request frequency 40 MHz it doesnt seem to work fast enough. 20 MHz DMA requests works fine...

Memory buffer located in SRAM1, DMA1 is used, D-cache disabled.

This topic has been closed for replies.
Danish1
Danish1Best answer
Lead III
November 29, 2021

I think you might be misreading that table. My reading of it is that e.g. Master Type DMA1 to slave Type APB4 Peripheral has Route=23 and you have to look at footnote 3 to see that Route 23 means 2 = via AHB bus matrix in D2 and 3 = via AHB bus matrix in D3

So it is in clock domains 2 and 3 via the AHB matrix. I guess it might take one clock cycle of the faster clock domain plus two cycles of the slower clock domain worst-case.

Not that it will take 23 cycles!

Regards, Danish

13 replies

TDK
November 26, 2021

It depends on many things including where the data is going and how busy the rest of the system is with the relevant buses. Generally, in the tens of MBps, which is consistent with your observations.

Access to GPIO pin registers is generally slower than other things as they're in the D3 domain.

0693W00000GZ5sqQAD.png

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

I see. So if want to reduce latency I need to put My memory buffer in SRAM4, and use BDMA instead of DMA1?

TDK
November 26, 2021
As far as I understand, yes, that should help considerably. Please report results if you check.
"If you feel a post has answered your question, please click ""Accept as Solution""."
Tesla DeLorean
Guru
November 26, 2021

Quick hack on the H723 with a simple Mem-to-Mem transfer from SRAM4 to GPIOB->BSRR, looked to be 10 MHz (5 MHz square wave from pattern buffer)

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
waclawek.jan
Super User
November 29, 2021

Generally, AN2548 applies to BDMA and AN4031 to DMA.

The devil is of course in the details, of which in the 'H7 are just too many.

JW

AlexSmart
AlexSmartAuthor
Associate III
November 30, 2021

AN4031 is pretty good document for STM32F mcus, pitty there is no such document on H7.

BTW, it seems like STM32F4 would be faster for my case than H7 :>

Pavel A.
December 1, 2021

>  it seems like STM32F4 would be faster for my case than H7

Or not. If your H7's are already in stock and F4 would take a year to arrive...

waclawek.jan
Super User
December 1, 2021

> AN4031 is pretty good document for STM32F mcus, pitty there is no such document on H7.

AN4031 does apply to DMA1 and DMA2 in H7, except that the overcomplicated bus/matrices structure has to be taken into consideration when talking about timing.

> BTW, it seems like STM32F4 would be faster for my case than H7

It might quite well be the case.

JW

AlexSmart
AlexSmartAuthor
Associate III
December 2, 2021

Thanks everyone, Ill keep trying and see what will work good enough for me