Main Site Documentation

Reading SD card fast?[FEZ Panda 2]


#1

Hello I am working on a project that requires me to read the SD card at fast speeds.

I have taken a look at the SD->USB Mass storage device sample. And I know that the SD card is able to be read wastly faster than my current speeds.

To read 1024 bytes from a SD card, it takes around 800ms

Is there any way of optimizing code so it will read faster?

I currently using FileStream for reading the required file.

Platform: FEZ Panda 2


#2

I am not sure how you got your numbers but our tests show about 200KBytes/sec. So that is about 200 times the speed you are seeing!


#3

I have reached those speeds while using the USBC_MassStorage class and writing and reading data from a computer.

In my implementation I use FileStream to read bytes from a large file. That seems to be slower than direct access that the USBC_MassStorage device class is most likely using.(No source available so I cannot confirm).


#4

Yes accessing SD from USB will be slower.


#5

I think you missunderstood my message.

Using USB->SD is faster, test using: http://wiki.tinyclr.com/index.php?title=USB_Client#Mass_Storage

Reading a file from SD card is slower, test using: http://wiki.tinyclr.com/index.php?title=File_System#SD_Cards

The results I have are for Reading a file from the SD card.


#6

I’m pretty sure the GHI lib will be using low level calls to the SD while Filestream will have NETMF between the SD and you - which is a lot slower.

You can probably use RLP or maybe bribe someone to develop a SDFilestream class with DMA and direct access to the SD interface.

Also try and tweak the chunk sizes you request. I think it should be multiples of 512 bytes. See if a larger or smaller buffer speed things up. Avoid working on your NETMF buffer byte by byte… That is really slow.


#7

There is no need for RLP. I already answered and the speed is about 200K.