Pages: [1] 2   Go Down
Author Topic: SD Card Initialization Fail 70% Of the time.....  (Read 2068 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 35
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hiya,

I am using Arduino Uno with Arduino Xbee + SD Shield, The card i am using is SanDisk 2GB micro SD Card, The card appears to work fine when recently formatted in PC, but if you remove it once or twice from the shield put it in computer and then put back in arduino it gets unreadable by Arduino. Dosnt matter which code i run, the default SD Library sketch SDcardinfo also dont seem to initialize the card.... What could be the problem?


Logged

Offline Offline
Full Member
***
Karma: 1
Posts: 226
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

exactly which SD shield/module do you use?
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 35
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

http://arduino.cc/en/Main/ArduinoWirelessShield
Logged

Offline Offline
Full Member
***
Karma: 1
Posts: 226
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

maybe try another sd card.

i had some error stuff when i pulled out the sd card while ardu was writing on it, maybe thats a problem too

i pulled in and out my oldschool 128 mb sd card like 20 times in the last 20min... and no problems, but i checked always on serial monitor when ardu finished writing to sd
« Last Edit: July 14, 2012, 06:58:36 pm by lax123 » Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 35
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Ive tried another card, 8GB Nokia Micro SD Card... Same problem persist!
Logged

Offline Offline
Full Member
***
Karma: 1
Posts: 226
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

does the sd formatter programm work properly?

Quote

if you remove it once or twice from the shield put it in computer and then put back in arduino it gets unreadable by Arduino.
r u really just putting it in and out, without doing something else?


« Last Edit: July 15, 2012, 08:34:07 am by lax123 » Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 35
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Yes ive tried both ways, creating a txt file in the card from computer and doing nothing (i.e just insert in the computer and take it out)
Logged

Offline Offline
Full Member
***
Karma: 1
Posts: 226
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

i had a similar problem, but the reason was that i just have a really really cheap sd module which suxx, so i had to put some resistors into its circuit to make it work properly, but i doubt thats the case with your original shield.

does the sd formatter work, by fatlib?

once its unreadable for arduino, the computer still has no problems in reading the data?
« Last Edit: July 15, 2012, 08:36:57 am by lax123 » Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 35
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Which library are you using? and which filesystem u use to FORMAT the card?

i am not sure whether these things could effect the initialization of the card !!
Logged

Offline Offline
Full Member
***
Karma: 1
Posts: 226
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

i use
sdfatlib20111205
http://code.google.com/p/sdfatlib/downloads/list

i formatted with the sd formatter
sdfatlib20111205\SdFat\examples\SdFormatter


in my current project i just use SD.h instead of SdFat, but both worked
« Last Edit: July 15, 2012, 08:50:41 am by lax123 » Logged

0
Offline Offline
Edison Member
*
Karma: 44
Posts: 1471
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

SD.h is SdFat.  SD.h is just an API translation layer for an old version of SdFat.  The Adruino group wanted a "simpler API".

Does it fail you run the SdFat QuickStart or SdInfo examples?  If it fails what are the error codes?
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 35
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

SD.h is SdFat.  SD.h is just an API translation layer for an old version of SdFat.  The Adruino group wanted a "simpler API".

Does it fail you run the SdFat QuickStart or SdInfo examples?  If it fails what are the error codes?

How to see the error codes?

I simply see "Card Initialization Failed" in the Serial Communication Window 
Logged

0
Offline Offline
Edison Member
*
Karma: 44
Posts: 1471
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You need to run the QuickStart or SdInfo examples in the SdFat/examples folder.  The Arduino group didn't include these examples so you need to download SdFat here http://code.google.com/p/sdfatlib/downloads/list

QuickStart's output looks like this with the errorCode at the end:
Quote
SD initialization failed.
Do not reformat the card!
Is the card correctly inserted?
Is chipSelect set to the correct value?
Is there a wiring/soldering problem?
errorCode: 0x2, errorData: 0xff

SdInfo's output looks like this:
Quote
card.init failed
SD errorCode: 0X2
SD errorData: 0X20

Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 35
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

errorCode: 0x1, errorData: 0x0
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 35
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

& When i use the SDFormatter example it gives


error: cardSize
SD error: 10,ff

& When i format from computer and again format using the SDFormatter it gives


Card Size: 1886 MB, (MB = 1,048,576 bytes)

Erasing
...............
All data set to 0x00
Erase done

Formatting
Blocks/Cluster: 64
FAT16
error: write MBR
SD error: 6,4
« Last Edit: July 16, 2012, 08:05:05 am by simplytuff » Logged

Pages: [1] 2   Go Up
Jump to: