Re: FAT32/SDHC library for Wave and other shields

by fat16lib on Fri Jun 05, 2009 12:41 pm

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.
fat16lib
 
Posts: 593
Joined: Wed Dec 24, 2008 12:54 pm

Re: FAT32/SDHC library for Wave and other shields

by eti on Sat Jun 06, 2009 12:56 am

thank you, it's working well with another card (Dane-elec 1GB)
eti
 
Posts: 3
Joined: Fri Jun 05, 2009 5:51 am

Re: FAT32/SDHC library for Wave and other shields

by eti on Wed Jun 10, 2009 2:30 am

Is it possible to delete files on the SD card with your library?
I can't find any function to do that.
eti
 
Posts: 3
Joined: Fri Jun 05, 2009 5:51 am

Re: FAT32/SDHC library for Wave and other shields

by fat16lib on Wed Jun 10, 2009 7:38 am

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.
fat16lib
 
Posts: 593
Joined: Wed Dec 24, 2008 12:54 pm

Re: FAT32/SDHC library for Wave and other shields

by zachtos on Thu Jun 11, 2009 7:03 pm

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?
zachtos
 
Posts: 77
Joined: Sun May 03, 2009 7:18 pm

Re: FAT32/SDHC library for Wave and other shields

by fat16lib on Thu Jun 11, 2009 8:30 pm

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.
fat16lib
 
Posts: 593
Joined: Wed Dec 24, 2008 12:54 pm

Re: FAT32/SDHC library for Wave and other shields

by zachtos on Thu Jun 11, 2009 8:49 pm

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.
zachtos
 
Posts: 77
Joined: Sun May 03, 2009 7:18 pm

Re: FAT32/SDHC library for Wave and other shields

by fat16lib on Thu Jun 11, 2009 10:00 pm

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.
fat16lib
 
Posts: 593
Joined: Wed Dec 24, 2008 12:54 pm

Re: FAT32/SDHC library for Wave and other shields

by zachtos on Thu Jun 11, 2009 10:19 pm

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 | TOGGLE FULL SIZE
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 10:31 pm, edited 1 time in total.
zachtos
 
Posts: 77
Joined: Sun May 03, 2009 7:18 pm

Re: FAT32/SDHC library for Wave and other shields

by fat16lib on Thu Jun 11, 2009 10:28 pm

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.
fat16lib
 
Posts: 593
Joined: Wed Dec 24, 2008 12:54 pm

Re: FAT32/SDHC library for Wave and other shields

by zachtos on Thu Jun 11, 2009 10:32 pm

Code: Select all | TOGGLE FULL SIZE
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: 77
Joined: Sun May 03, 2009 7:18 pm

Re: FAT32/SDHC library for Wave and other shields

by zachtos on Thu Jun 11, 2009 10:35 pm

Here is my working card, 1gb GSM SD card
Code: Select all | TOGGLE FULL SIZE
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
zachtos
 
Posts: 77
Joined: Sun May 03, 2009 7:18 pm

Re: FAT32/SDHC library for Wave and other shields

by fat16lib on Thu Jun 11, 2009 10:42 pm

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.
fat16lib
 
Posts: 593
Joined: Wed Dec 24, 2008 12:54 pm

Re: FAT32/SDHC library for Wave and other shields

by zachtos on Thu Jun 11, 2009 10:51 pm

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.aspx?Item=N82E16820326001 hp 1gb
zachtos
 
Posts: 77
Joined: Sun May 03, 2009 7:18 pm

Re: FAT32/SDHC library for Wave and other shields

by adafruit on Fri Jun 12, 2009 12:05 am

i'd buy one. please let us know if it works!
User avatar
adafruit
 
Posts: 11642
Joined: Thu Apr 06, 2006 3:21 pm
Location: nyc