2014-06-04 07:21 PM
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?Jason2014-06-04 11:40 PM
Could it be that there is an excessive value for implementing a command/transfer timeout in the software ?
2014-06-05 12:14 AM
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