Skip to main content
Dude
Associate III
February 14, 2023
Solved

STM32L0 -> DMA, parallel operations

  • February 14, 2023
  • 3 replies
  • 1413 views

Dumb question,

can the DMA perform separate, parallel operations with the different channels? For example, could I use the DMA to transmit with the UART and the SPI devices at the same time without one interrupting the other? I'm unclear from reading through the DMA datasheet whether its possible to have parallel operations or whether the DMA controller only lines up and allows one at a time.

Provided those operations don't conflict by needing to access the same resources, of course.

This topic has been closed for replies.
Best answer by RBENF.1

Hello @Dude​,

When using a single DMA controller with multiple channels, an arbitration is performed for AHB bus access.

0693W00000YAjSuQAL.pngTo achieve parallel operation, you would need to use two different DMA controllers, as long as they are not conflicting within the bus matrix. You can refer to AN2548 for detailed information.

Regards,

Ryan

When your question is answered, please close this topic by choosing Select as Best. This will help other users find that answer faster.

3 replies

RBENF.1
RBENF.1Best answer
ST Employee
February 14, 2023

Hello @Dude​,

When using a single DMA controller with multiple channels, an arbitration is performed for AHB bus access.

0693W00000YAjSuQAL.pngTo achieve parallel operation, you would need to use two different DMA controllers, as long as they are not conflicting within the bus matrix. You can refer to AN2548 for detailed information.

Regards,

Ryan

When your question is answered, please close this topic by choosing Select as Best. This will help other users find that answer faster.

Danish1
Lead III
February 15, 2023

There’s a subtlety to your question:

When you say parallel, do you mean at precisely the same time (down to the same processor clock-tick) or are you just after both DMA channels to run seemingly at the same time, bus accesses for each as-and-when their peripherals are ready (where the occasional singe-processor-cycle delay due to bus contention is not a problem).

if the latter, you just need different channels; they can be on the same DMA controller. You don’t need to do anything special - just set one running then set the other running.

Dude
DudeAuthor
Associate III
July 4, 2023

You are right, due to the speed of the DMA controller I don't need precisely at the same time. Simply being able to request multiple transfers on different channels is sufficient. 

Also, I got this working but forgot to follow up. thanks.