Skip to main content
con3
Senior
January 24, 2018
Solved

Timer DMA requests through DMA1 clarification

  • January 24, 2018
  • 17 replies
  • 2586 views
Posted on January 24, 2018 at 10:32

Hey everyone,

I need some clarification on this, as it will help my program run smoother.

I want to run 2 DMA's simultaneously. One which will send data out using the SDMMC1, which is linked to DMA2. Then I'd like to read in data using DMA1 connected to Either of the Timer peripherals that allow a DMA request from GPIO to memory. Which here would be for example Timer 2 of DMA 1 stream 1.

0690X00000604I3QAI.jpg

It doesn't seem like I can read in data from the GPIO to memory using DMA1 as seen in the image below from application note an 4 I've read on some forums that this could be because there is no direct connection between the DMA1 P and the bus matrix. So It would require me to go through a direct path. Is this possible as I haven't been able to get this going?

0690X00000604IIQAY.jpg

I'd like to have the two DMA's running independently to avoid a clash.

Thanks in advance for any help.

dma-gpio stm32f7-dma stm32f7

This topic has been closed for replies.
Best answer by waclawek.jan
Posted on January 26, 2018 at 13:09

what the direct path is that they refer to in an4031

That's when you access a peripheral through the dual-AHB/APB bridge (ie. when on the peripheral side of DMA, you use an address within its 'respective' APB address range).

This is the only option in DMA1. In DMA2, the other case - when you access APB through the bus matrix - happens if you access one of the APB1 peripherals from DMA2.

JW

17 replies

waclawek.jan
Super User
January 24, 2018
Posted on January 24, 2018 at 21:30

You  can't use DMA1 for GPIO-to-memory access, fullstop.

You can have as many streams enabled simultaneously on DMA2 as much you want. They don't work simultaneously, but they follow the priorities assigned and natural, when several are triggered simultaneously.

You always will have some 'clash' on the buses between several busmasters, if this is your concern. It's highly nontrivial to estimate its impact on any of the processes going on.

Read AN4031.

JW

con3
con3Author
Senior
January 26, 2018
Posted on January 26, 2018 at 12:55

Hi JW,

Firstly thank you for the reply.

I completely agree , although would you mind explaining what the direct path is that they refer to in an4031? I can see it throughout the application note.

0690X00000604G3QAI.jpg

I'll try to calculate the clash on the bus using an4

Thank you for all the help

waclawek.jan
waclawek.janBest answer
Super User
January 26, 2018
Posted on January 26, 2018 at 13:09

what the direct path is that they refer to in an4031

That's when you access a peripheral through the dual-AHB/APB bridge (ie. when on the peripheral side of DMA, you use an address within its 'respective' APB address range).

This is the only option in DMA1. In DMA2, the other case - when you access APB through the bus matrix - happens if you access one of the APB1 peripherals from DMA2.

JW

Clive1 (HNL)
Explorer
January 24, 2018
Posted on January 24, 2018 at 21:43

The Figure 11 seems to describe an F4 part, but your post more generally is about the F7

Some contention will occur due to the cycles involved, the system should manage most of these situations (check errata)

Both DMA1 and DMA2 have 8 independent internal units, so the system should be able to juggle 16 concurrent DMA operations.

waclawek.jan
Super User
January 24, 2018
Posted on January 24, 2018 at 22:03

The 'F7 have very same arrangement of the two DMA units as the 'F4, AFAIK. There may be details such as one, two or three RAM slave lines in the matrix, and DMA1 can connect to just several or all of them on its memory port, but IMO that's immaterial for this discussion.

JW

Tesla DeLorean
Guru
January 24, 2018
Posted on January 24, 2018 at 22:35

My issue here is two fold, 1) mixed documentation is being reviewed, best to stick to the one for the platform being used lest wires get crossed or more confusion created, 2) ST has an F4 diagram in F7 documentation.

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