Go Down

Topic: SdFat and big SD cards (Read 2342 times) previous topic - next topic

skyjumper

Hi All...

I have been usign the latest SDFat beta quite successfully with a 256MB San Disk SD card. I just tried a 2GB card, also a blue San Disk.

When I run the bench application, i getL

Type any character to start
Free RAM: 14998
Type is FAT16
File size 5MB
Starting write test.  Please wait up to a minute



I wait and wait, over 5 minutes, and finally remove the card, and i get:

error: write failed
SD errorCode: 0X15


During all this, my L LED is lit steady. The card has a file called bench.dat that is 0 bytes long.

Any ideas?

Thanks...

fat16lib

The file system on the card may be corrupt.  Check it on a PC with the properties->tools tab of file explorer.

Try reformatting with either the SdFormatter sketch in examples or this utility https://www.sdcard.org/consumers/formatter_3/

You should use the latest non-beta here http://code.google.com/p/sdfatlib/downloads/list.

If you still have problems, run the SdInfo.pde example and post the output.

skyjumper

Okay thanks very much. It came out of my Daughter's digital camera and I can read the file system on Windows 7.  I can't reformat it, it has data that the kid wants to keep.

I didn't realize you had released it, I'll upgrade. Thank you very much!

Jim

skyjumper

Oh the latest is 20110702, that is the one I am using.

fat16lib

You should backup the files on the card and check it for errors.

If the card has lots of file and is nearly full, bench.pde can take a very long time trying to find free space.

I suspect there may be lost clusters on the card so it probably needs repair.

skyjumper

Okay, I'll do that thanks. Can your library support cards as big as FAT16 supports?

fat16lib

SdFat supports standard SD cards from16 MB to 2 GB as FAT16.

SdFat supports SDHC cards from 4 GB to 32 GB as FAT32.

skyjumper

Great, thanks! I just got a new 4GB card, which came formatted as FAT32. In case anyone is interested, I ran bench and geot a write speed 128 Mb/s. Formatted with your formatter, re-ran bench, same result. My 256MB FAT16 card writes in excess of 260 Mb/s. Both SanDisk cards.

I sure wish I could find a source of 256MB cards, but I can't. Maybe they don't even make them anymore. Who knows.

fat16lib

It is not the card size.  Many new cards don't perform well with the single block write commands that must be used on the Arduino for file writes.

The old style cards are no longer available.

Fast cards expect multiple block writes.

I get about 600 KB/sec on multiple block raw writes with new cards.  I use these commnds in the binaryLogger program.

skyjumper

Sorry, I was not clear at all. The primary reason I wanted the 256MB cards is to bundle them with a board, but the faster speed is nice as well. I'll see if I can make my code work like your binary logger example, but I am pretty sure you and I discussed this and you told me that, because the user is prone to removing the card or shutting down the board at any time, I can't do it that way.

Thanks again for the help and the library!

fat16lib

Your right, it's not practical with the Arduino to use the binaryLogger method for most apps. 

Consumer devices like cameras have lots of memory, and save to the SD before really powering down. 

They know when you open the SD door and quickly save.

New 4 GB cards are cheaper than old 256 MB cards, under $10.

skyjumper

Wow, I just found a source for Class 2 San Disk SD cards for $1.80 each! 

fat16lib

Most cheap places add a lot of shipping.  Delivered class 2 cards should be less than $5.

Class 10 4GB cards delivered from Amazon are $7.99 total.

Boffin1

FWIW     I have been able to pick up 256Mb cards cheap from camera repair shops, they always seem to have some in the drawer.
They are the only things that work in my message anouncer.

Go Up