Panda II SD Read/Write Speed

Lets talk about “4-bit high speed SDHC support” feature :wink:

USBClientController in MassStorage mode I get about
220 KBytes/sec read
187 KBytes/sec write

Which is a 4 months (sic!) to fill a 32Gb card.

:snooty:

you have to remember that the “option” that the Arduino camp has (and that you should base your comparison to) is an SPI connected SD card…

Try writing bytes to a file on SD card and see how fast that is. That’s the true performance of the SD card capability.

What you’re trying to do is much different and has many more influencing factors. What code is performing this, have you optimised that?

Do you actually WANT to copy 32gb of data from a PC file to an SD card? If so, then perhaps you might find it quicker to unplug the SD card from your Fez and put it in a card reader on the PC. Ok, that might be a bit cheeky, but if you don’t explain to us what your use-case is, nobody can make an informed judgement about how to approach this and whether you really need more performance than that.

By the way, normal speed on micros is about 10KB/sec so 220KB/sec is a great jump in speed

Brett, code is just to test the Mass Storage. Looks pretty optimized to me :smiley:

USBC_MassStorage ms = USBClientController.StandardDevices.StartMassStorage();
PersistentStorage sd = new PersistentStorage("SD");
ms.AttachLun(0, sd, " ", " ");
ms.EnableLun(0);

Use case is that end-user insert device to USB and copy collected logs for analyzing.
If logs grows to several gigabytes per month and end-user have to analyze logs from several devices, then he will need additional equipment (card reader) and have to disassemble enclosure to get access to microSD card.

Gus, what could you recommend? USBizi will not work for this case?

The first thing I would do is look at methods to reduce the amount of data that need to be stored and thus copied from place to place. I don’t know your application so I can only speak generally, but having too much data can often be as bad as too little (can’t see the forest because of all the trees.) I’ve seen an awful lot of cases here at the university where folks spend a whole lot of time and effort and storage space collecting data that is not really useful.

  1. If your sampling things with slow rates of change like temperature then sample at a much slower rate or decimate the samples so you have less to log. Even 1 Hz is a fast sampling rate for temperature in many cases.
  2. Do you really need to save every data point collected? You can do things like only save data points and their timestamps that are outside of a normal range? In other words on an industrial machine I don’t needs three weeks worth of data that shows me everything was normal, I only need to know when things were not operating normally (and perhaps a short time before to catch a trend.)

In that scenario you have a valid concern about how fast the device can copy the data off. But realistically I don’t think SD is the right medium for you here as you will always be limited by doing 4-bit data transfers off the card that then has to be reassembled and then pushed up a pipe to the PC via USB where you have much more bandwidth. As Gus said, could you imagine if that was a bit at a time via SPI and not 4-bits?

As an alternative, have you considered putting a USB thumb drive on Fez? I don’t know it’s behaviour will be any different but it could be worth a try.