FAT32/SDHC library for Wave and other shields

Adafruit Ethernet, Motor, Proto, Wave, Datalogger, GPS Shields - etc!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
User avatar
fat16lib
 
Posts: 595
Joined: Wed Dec 24, 2008 1:54 pm

Re: FAT32/SDHC library for Wave and other shields

Post by fat16lib »

eti,

The error you are getting, readCID failed with errorCode: 8, means your card will not work with the GPS or Wave Shield.

This card is not able to run at 8 MHz in SPI mode with these shields. I initialize it at low speed and then switch to 8 MHz. The first command at 8 MHz fails.

The reason for the failure is explained above.

eti
 
Posts: 3
Joined: Fri Jun 05, 2009 6:51 am

Re: FAT32/SDHC library for Wave and other shields

Post by eti »

thank you, it's working well with another card (Dane-elec 1GB)

eti
 
Posts: 3
Joined: Fri Jun 05, 2009 6:51 am

Re: FAT32/SDHC library for Wave and other shields

Post by eti »

Is it possible to delete files on the SD card with your library?
I can't find any function to do that.

User avatar
fat16lib
 
Posts: 595
Joined: Wed Dec 24, 2008 1:54 pm

Re: FAT32/SDHC library for Wave and other shields

Post by fat16lib »

There is no delete function.

This is a read only library. It is not practical to add write access to this library due to the limited RAM on 168 Arduinos.

I am working on a library for the Wave Shield that can record and play wave files. This library will have a delete function. A 328 Arduino will be required to use this library.

This new library will have a general purpose FAT16/FAT32 file system. For example it can be used to log data with the GPS Shield to SDHC cards with FAT32 formatting.

zachtos
 
Posts: 78
Joined: Sun May 03, 2009 8:18 pm

Re: FAT32/SDHC library for Wave and other shields

Post by zachtos »

I just bought 10 SD cards for my project. 128mb Sandisk SD (shoot and store). I have tried formatting them in fat16 like the other card i have from GFM. they will not work. They will not format 32kb file clusters, but work in others, but the arduino wont boot with it. Did I just waste all my money? what can I do and why dont they work?

User avatar
fat16lib
 
Posts: 595
Joined: Wed Dec 24, 2008 1:54 pm

Re: FAT32/SDHC library for Wave and other shields

Post by fat16lib »

Most 128 mb SD card can not be formatted FAT16 with 32 kb clusters.

Microsoft's specification for FAT16 volumes requires at least 4085 clusters.

Most 128 mb cards are just a bit too small for FAT tables, the root directory, and 4085 32 kb clusters.

You will need to use smaller clusters to format the cards FAT16. This does not comply with the SD standard but should work,

If possible use http://www.sdcard.org/consumers/formatter/ to format cards. This program complies with the official SD standard.

It may format your cards FAT12 which is not usable on an Arduino.

zachtos
 
Posts: 78
Joined: Sun May 03, 2009 8:18 pm

Re: FAT32/SDHC library for Wave and other shields

Post by zachtos »

So is there nothing I can do to make these cards work? I wanted to get 10 SD cards as cheap as possible and I picked these up at OEMPCworld.com for $3.50 each. I've spent over $3000 on my laser tag project and this just burns me up that the SD cards are not working on my audio boards... Is there any way to format it so it will run on this arduino? that program did not work, and it only quick formats. Must I buy a bigger card? if so what is the minimal size that will work, I really can't afford to keep getting burned. these cards will just go in the garbage now.

User avatar
fat16lib
 
Posts: 595
Joined: Wed Dec 24, 2008 1:54 pm

Re: FAT32/SDHC library for Wave and other shields

Post by fat16lib »

Please provide details of how the cards fail. Run SdReadTest.pde and post the output.

The reason SD Formatter only does a "quick format" is that it produces the optimal format to match the internal flash chips of your SD card. If you use an OS utility and pick a cluster size you will likely degrade the performance of your card.

Using OS utilities to format SD cards destroys the optimized file system that was written when the card was manufactured.

zachtos
 
Posts: 78
Joined: Sun May 03, 2009 8:18 pm

Re: FAT32/SDHC library for Wave and other shields

Post by zachtos »

I format the card any way I try, fat 16 or fat32, can't get any file cluster size to allow the arduino to boot. it will start the program, but will not play sounds and will not print the serial LCD on trx pin 1, not sure why that is. swap back the regular 1gb card and reset, works great.

code when formatted using that utilty, vista formats = int card failed error

Code: Select all

init time: 39


Card type: SD1

readCID failedSD error

errorCode: 8

errorData: 0

if I can find a way to save $70, and not waste this $35 order, that would be wonderful, as I have no need for giant 1gb cards for 10mb of sounds, that's why I ordered 10, cheap small ones. so you say I should not format my 1gb card using vista either? use that other program you sent over?
Last edited by zachtos on Thu Jun 11, 2009 11:31 pm, edited 1 time in total.

User avatar
fat16lib
 
Posts: 595
Joined: Wed Dec 24, 2008 1:54 pm

Re: FAT32/SDHC library for Wave and other shields

Post by fat16lib »

This has nothing to do with SD format or card size. This card fails on the first command, which is to put the card in SPI mode.

Looks like these cards are not hardware compatible with the SPI bus on the Wave Shield.

I can't help since it is not a software problem. The card does not return a response to the first command.

zachtos
 
Posts: 78
Joined: Sun May 03, 2009 8:18 pm

Re: FAT32/SDHC library for Wave and other shields

Post by zachtos »

Code: Select all

init time: 39


Card type: SD1

readCID failedSD error

errorCode: 8

errorData: 0
here is code after I changed that format utilty you sent to a option: full format

zachtos
 
Posts: 78
Joined: Sun May 03, 2009 8:18 pm

Re: FAT32/SDHC library for Wave and other shields

Post by zachtos »

Here is my working card, 1gb GSM SD card

Code: Select all

init time: 78


Card type: SD2


Manufacturer ID: 2

OEM ID: TM

Product: SD02G
Version: 3.7

Serial number: 935936937

Manufacturing date: 8/2008



card size: 3842048 (512 byte blocks)
partion,boot,type,start,length

1,0,6,137,3838327

2,0,0,0,0

3,0,0,0,0

4,0,0,0,0

User avatar
fat16lib
 
Posts: 595
Joined: Wed Dec 24, 2008 1:54 pm

Re: FAT32/SDHC library for Wave and other shields

Post by fat16lib »

This still has nothing to do with format or card size.

This card did go into SPI mode but failed on the first command at full SPI speed. This is the command to read an internal register that gives card characteristics.

This happens with cards that can't function at full SPI speed, which is required for playing wave files.

zachtos
 
Posts: 78
Joined: Sun May 03, 2009 8:18 pm

Re: FAT32/SDHC library for Wave and other shields

Post by zachtos »

well, $35 lost, let's try anothr $55. Do you think 10 of these will work? hope so since I'm ordering them. I guess that's what I get for going cheap... I guess.

http://www.newegg.com/Product/Product.a ... 6820326001 hp 1gb

adafruit
 
Posts: 12151
Joined: Thu Apr 06, 2006 4:21 pm

Re: FAT32/SDHC library for Wave and other shields

Post by adafruit »

i'd buy one. please let us know if it works!

Locked
Please be positive and constructive with your questions and comments.

Return to “Arduino Shields from Adafruit”