SDCard DMA to RAM, No Performance Improvement
Hello All,
I recent implemented a DMA transfer for SD card data to RAM (technically an external SDRAM) on the STM32F765VI. Previously we had been using an IT transfer. In other words, we are now using SDCard_WriteBlocks_DMA rather than SDCard_WriteBlocks_IT. The original motivation for this change being the fact that 480,000 byte size IT transfers to an from the SD card cause roughly 20 thousand ISRs, whereas the DMA method only causes 4 ISRs total (2 SDMMC dataend ISRs and 2 transfer complete DMA ISRs). I expected a large performance increase, but ended up actually getting a slight decrease in performance. Both methods take roughly 0.5 seconds. This is with the clock running at 200MHz. All of this is single threaded without a kernel. I am using a 4 word burst on both the peripheral and memory side of the DMA.
I wanted to ask the community if these speeds are typical, and if not, does anyone have any recommendations on how to speed up the transfer?
I could add a double buffer, but it seems as thought the speed of the SD card is the limiting factor here. I say that because, for larger transfers, I have to poll the SD card with SD status commands to prevent data corruption. Am I right in assuming this?
If there is no method for speeding up the transfer (aka the SD card read and write speed is the limiting factor), I am considering real time RLE on transmit and receive in order to reduce the size of the transfer. These large transfers are bitmap images. Does anyone have experience with fast encoding and decoding methods (fast being a significant reduction in a 480,000 byte image size in small fractions of a second)?
Do I just need a better SD card?
I appreciate any and all suggestions.
Thanks!