In the K64, SPI1 and SPI2 have only a single DMA trigger source. As far as I can see, this means you can't operate both a transmit and a receive DMA at the same time. In particular, this means that a DMA receive in Master mode is impossible, since it always requires a transmit channel. Is this true? It seems like a significant step back from, say, the K60, where all SPI channels have separate TX and RX DMA triggers.
Any workaround, except to use polling or interrupts?
Thanks,
Eyal Doron
Hi Eyal,
According to the reference manual, the SPI1 and SPI2 only support one trigger source at the same time, then it means that it's unable to transfer the data through the DMA mechanism.
And I'd like to suggest that you can choose the interrupt to instead of the DMA.
Have a great day,
Ping
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Its been a long time, but I found a sort of solution
For transmit I now use a DMA channel triggered from a timer, instead of from the SPI peripheral. This works since the SPI timing is deterministic. The only disadvantage, except for locking down a timer, is that the transfer is slightly slower since I allow some slack