cancel
Showing results for 
Search instead for 
Did you mean: 

stm32f4 board, slow writing issue on SDIO interface

ahmed_0407
Associate
Posted on September 16, 2013 at 08:40

Dear All,

               I am working on SDIO interface of STM32F4_discovery board using mass storage class example (dated: 05-March-2012). By going through different posts (special thanks to clive1) i have now been able to achieve undermentioned performance with perfect/reliable read and write.

Read: 3.66MBps

Write: 1.2MBps

on 8GB class 4(Sandisk), 8GB class 10(Tanscend) card,  SDIO_CLK = 24MHz and card is FAT32 formatted

After that I have tried every possible effort to increase the speed atleast up to 5MBps (as claimed in different posts) but all in vain.Using different speed grade cards is also not helping. I am using MultiBlock write command with Pre-Erased (ACMD23) functionality. Any suggestion to improve the speed would be highly appreciated.

 

Ahmed

 

#stm32f4 #sd-card #sdio
2 REPLIES 2
Posted on September 16, 2013 at 12:05

Are you looking at native speed, or over USB? The USB FS implementation on the STM32F4-Discovery is going to significantly slow performance, you'd want to look at USB HS via an external PHY.

Have you reformatted the SD Cards? If so there is the potential to have misaligned all the internal structures. There is a special SD Card Formatter that does the job correctly.

When measuring transfer speeds what is your transfer block size, a block size of 32KB is a good mix of cluster/sector size?

How fast are the cards really? A lot of cards frankly are not as good as suggested on the packet. Class 4 card are generally quite lame, for speed you'll want to look for cards that actually make specific claims about speed (usually only read) like the SanDisk Ultra (30MBps) and Extreme (45MBps). While I don't think you'll see such speeds on the F4, or even a PC, they are a better indicator than Class. You might want to benchmark them on a PC to get a feel for the disparity in Read/Write speeds, and where the upper limit is.

Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..
ahmed_0407
Associate
Posted on September 18, 2013 at 11:28

This performance benchmark is over USB HS with an external PHY(I incorporated it) . I have also tested that USB interface (PC to stm controller ) is remarkably fast i.e approx 25MBps, problem arises when i try to write that incoming data to SD card. I am using Fixed block size of 512 bytes and 8 blocks at a time (as windows does). Throughput of 3.7MB/1.2MB is calculated using Crystal DiskMark by sending 50MB of data

Actual speed of the card as calculated by a standard card reader  is

9.8MBps (read ) and 5.5MBps (write) for class4

18MBps (read) and 10.8MBps (write) for class10

Yes I do have formatted the card with windows(FAT32) but there is no performance mismatch whether i format it using windows or the SD Formatter provided by SDA

Could this be a DMA issue?