AnsweredAssumed Answered

STM32F4 memory areas for DMA.  Different?

Question asked by chuck guzis on Sep 28, 2017
Latest reply on Sep 30, 2017 by chuck guzis

I'm probably missing something obvious, but I'd appreciate any clarification.

 

Basically, I'm using a peripheral device that transmits data in 16K word blocks using DMA.   That works fine.  I'm taking the data and writing it to an SD card, using the SPL and Chan's FATFS code.

 

Up until yesterday, things worked fine also, but I ran into errors because of FATFS occasionally using buffers that aren't aligned to a 32-bit boundary.  So I added code to check for a misaligned buffer and move data to an aligned one before writing to SD.   My code passes his compatibility checker (app4.c) test.

 

Confident in the outcome, I started running my regular code with the compatibility modification.   All of the sudden, some SD writes now hang up and timeout with a DMA failure.  If I perform single-sector writes using the buffer that I use for resolving misalignment issues, things are fine, albeit slower.  But if I attempt to write (aligned data) right from the device buffer, it will go for a bit and then hang.

 

My thought is that perhaps some areas of memory are less suited to DMA than others, but if that's true, I don't know how to resolve the issue.

Outcomes