We are using the DM365 SPI2 interface to transfer data from a slave device. The SPI interface is being used in DMA mode with spidev providing the interface to the user level. In general, the transfers complete correctly, but in some cases the driver returns the original transmit buffer contents as the received data. As the processor load increases the error frequency increases. Looking at the driver implementation in spidev, it is notable that spidev uses a common buffer for transmit and receive. Reading the TI documentation, it appears acceptable to use a common buffer for DMA transmit and receive.
The test application I wrote, simply transmits an incrementing sequence and reads the returned receive data. With the SOMI pin tied to ground, the expectation is for the receive data to always be 0x000. Instead, in 10% of the transfers, the receive data is equal to the transmit data.
We are using SPI2 as a 10-bit interface in mode 1 at 5500000 bits/sec.
Any suggestions are greatly appreciated.
Bill