I'm looking for a way to permanently read data from an SD card while keeping the workload of the CPU as low as possible.
I imagine that I just give a pointer to a buffer to a DMA based SD.read routine which fills the buffer via DMA without loading the CPU and just issues an interrupt when the buffer is full (like the DAC of the DUE when operated via DMA)
I thought this could be done with the SdFat Library as it is apparently able to use DMA. However it seems to use it only for speeding up the read process, but not for filling a buffer in the background.
Does anyone know how to do something like this?
Thank you in advance for your help.
There is an AHB DMA for the SPI peripheral (Sam3x datasheet, page 339). You first need to initialize the SPI reading of the SD card with the correct pace, and then initialize a single AHB DMA transfer, or multiple AHB DMA transfers with a linked list item (LLI) from the SPI peripheral to the memory and this will be done with the correct pace.