Userspace SPI with DMA


the internal ADC of our “CC-9M-2443-LX” evalboard unfortunately uses no DMA. So we cannot sample signals in the range of several kHz (kbps) when we use Linux (schedulers or interrupt systems latency is too poor). Digi confirmed this and recommended us to use an external ADC connected by the SPI protocol.

So we switched to an external SPI-ADC. No we want to read the samples of our SPI-ADC (with 20 kHz speed).

Question 1:
Is the userspace implementation of the Linux SPI driver of a ConnectCore 9M 2443 DMA capable ? Is ioctl() and SPI_IOC_MESSAGE the correct approach ?

Question 2:
Userspace or not: Does anyone know some good sample-code that reads some bytes into a buffer using SPI and DMA(!) ?

Thank you,
Roelof Berg


we solved this issue. The linux userspace driver sample in the Linux kernel code folder is sufficient (approach: Using SPI_IOC_MESSAGE which starts sending/reading from/to data-buffers in parallel using Full-Duplex-Mode). We can sample now 14 kHz with 25% CPU Load (probably optimizations are possible).

However, I wonder if DMA is used by the driver we use now from the Linux BSP provided by Digi. Does anyone know ?