SPI DMA on Colibri T20

We are testing the SPI DMA demo code (spi_dma_lib_demo) which uses SPIReadWrite() to trigger a DMA SPI transfer.

We need an acquisition thread implementing continuous SPI DMA data reception, into two buffers (double buffering).

On the oscilloscope hooked to the SPI port, two consecutive calls to SPIReadWrite within the acquisition thread show a >25 useconds latency betwen consecutive bursts of SPI clocks. We loose ADC data due to this dead time.

How can we re-trigger the SPI within the acquisition thread w/o such a huge dead time between consecutive SPI DMA bursts? Max. for our application is 1usecond.

The generic implementation of the SPI library leads to the latency you measured.

We will extend the OS’s resource manager to support double-buffered DMA for SPI. This way you will be able to use the SPI controller in slave mode and implement a continous double-buffered data reception for up to 65536 words (1-32 bits each).
The limitation is given by the SPI controller, which needs to be preconfigured for the number of words to receive.