cancel
Showing results for 
Search instead for 
Did you mean: 

SPI - DMA Tx and Rx priorities

matic
Associate III
Posted on October 09, 2015 at 20:03

Is it important how to set priorities for TX and RX DMA channels for SPI?

Thanks

#spi-dma
4 REPLIES 4
matic
Associate III
Posted on October 11, 2015 at 08:49

Nobody knows?

tm3341
Associate II
Posted on October 11, 2015 at 13:44

If you yet the same priority to both, then lower stream number has higher priority.

But if there would be need for that (never has this trouble) I would set RX to higher priority. Why?

If data is ready from SPI to memory, RX should transmit this faster then TX DMA fill another SPI. In this case, you can't miss any data.

But DMA uses FIFO also so somehow there is no need to worry about that.

matic
Associate III
Posted on October 11, 2015 at 21:49

Thanks Tilen.

jpeacock
Associate III
Posted on October 12, 2015 at 13:58

In master mode to avoid an RX overrun condition the RX DMA should be at a higher priority than TX.  TX also clocks in RX data so the RX data register has to be clear. 

In slave mode the remote master will clock both RX and TX so the TX data register has to be loaded in advance of the first byte arriving.  For this case you will want the TX priority to be higher than RX.

  Jack Peacock