cancel
Showing results for 
Search instead for 
Did you mean: 

STM32L0 -> DMA, parallel operations

Dude
Associate III

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.

1 ACCEPTED SOLUTION

Accepted Solutions
RBENF.1
ST Employee

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.

View solution in original post

3 REPLIES 3
RBENF.1
ST Employee

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 II

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.

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.