I'm looking for some advice on an embedded Linux project.
We're transmitting 1352 bytes of data from a master device every 1.5ms. The SPI clock is around 33MHz so the data is coming in quite fast.
I've written a simple kernel module that polls the SPI registers and reads the data 1 byte at a time. This works fairly well, but I'm missing bytes once in a while due to other interrupts that are occurring. If I disable one of the high res timer interrupts and the Ethernet interrupt, I get all of the data. I verify a valid packet by toggling an I/O line.
The problem is that the loop is hogging all of the CPU time and not giving time to the other processes that need to send out the data over our UDP socket. If I use the DMA controller to receive SPI data, will it help us in any way? It takes about 700uS to receive the 1352 bytes of data so we have around 850uS to get the data out or have the capability to receive SPI data while sending out the UDP data.
Any thoughts or suggestions?