AnsweredAssumed Answered

How to use two preipherals with the same DMAxStreamY

Question asked by nilsson.hjalmar on Jan 31, 2017
Latest reply on Jan 31, 2017 by waclawek.jan

Hi,

 

I'm having no problem using the DMA in basic functionality,  but I've run into something I can't figure out by my self.

 

I'm having a STM32F207 processor and try to use SPI2 at the same time as UART4.

the TX interrupts of these peripherals are on the same DMA1Stream4 but different channels (0 and 4).

Obviously I need to share the interrupt of these two DMA TXCI (tx complete interrupt) but HOW on earth do I distinguage between the two? Also, CAN I use both channels at the same time on the same stream or do I in software need a mutex to know if the stream is free to use? (the ref man claims there's an arbitrator between different channels).

 

I don't see how I can, while for instance a long DMA to UART 4 is running, configure the same DMA but different channel to start a transfer to the SPI2 port since I can't write to the DMA1S4PAR register if the DMA1S4CR EN bit is set, and it will be set since I've started the UART4 transfer.

 

What am I missing?

 

kind regards

Hjalmar

Outcomes