cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F2 DMA-SDIO and excessive stall on writes

jasonp4113
Associate II
Posted on June 05, 2014 at 04:21

Hi All,

Using any type of SD card (SD,SDHC,SDXC) DMA reading from the cards works consistently (With an XC card, can obtain 12-15 MB/s)

Writes are typically 2-6 MB's, but every so often, the DMA-write stalls for up to 2 secs. It does not fail so therefore I have to assume it is the cards internals performing the physical write.

If I print the results out per-DMA-write, the time taken for each randomly-sized transaction seems quite consistent @ 4-6ms per transaction (even for up to 128 sectors in one transaction), except for every so often it stalls for up to 2 secs - which seems a LOT.

Has anyone else encountered this?

Jason

2 REPLIES 2
stm322399
Senior
Posted on June 05, 2014 at 08:40

Could it be that there is an excessive value for implementing a command/transfer timeout in the software ?

jasonp4113
Associate II
Posted on June 05, 2014 at 09:14

Hi

No - I don't see any timeouts. Also, the write stall can take anywhere from ~50ms to just under 2.0 sec. Timeouts would come back with a consistent value.

I have a test function that writes a pattern of repeating increasing-decreasing #sectors, reads them back and compares to ensure data written and read is correct in both location and pattern. It is timed via HAL_GetTick().

The stall doesn't happen when writing the max number of sectors either (in this case: 128), but seems random and may happen when writing 1 sector, or 128.

My gut feeling is that the card is busy, but ~2 secs to write a bunch of sectors seems very excessive, considering XC cards are capable of 50MB+/s both ways (in theory)

Jas