Pages: 1 [2] 3 4   Go Down
Author Topic: SD card became unrecognized by card readers  (Read 11619 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 17
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I didn't understand why you linked a different sd card reader from ebay , my sd card reader is:

 http://www.ebay.com/itm/SD-Card-Shield-Module-Memory-Read-Write-reader-Arduino-/150718852629?pt=UK_BOI_Electrical_Test_Measurement_Equipment_ET&hash=item23178b2e15#ht_2930wt_1270

I connected the card reader to my arduino nano like this:

5V pin to 5V pin
GND to GND
MOSI to pin 11
SS to pin 4
SCK to pin 13
MISO to pin 12

the output of the programs you ask for: (I remind you that the SD card is probably dead)

CardInfo example from SD.h using Arduino 1.0 output:
"
Initializing SD card...initialization failed. Things to check:
* is a card is inserted?
* Is your wiring correct?
* did you change the chipSelect pin to match your shield or module?
"

QuickStart example output:
"
SD chip select is the key hardware option.
Common values are:
Arduino Ethernet shield, pin 4
Sparkfun SD shield, pin 8
Adafruit SD shields and modules, pin 10
The default chip select pin number is pin 10

Enter the chip select pin number: 4

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: 0xa, errorData: 0x1

Restarting

Enter the chip select pin number:
"

SdInfo example output
"
SD chip select is the key hardware option.
Common values are:
Arduino Ethernet shield, pin 4
Sparkfun SD shield, pin 8
Adafruit SD shields and modules, pin 10
The default chip select pin number is pin 10

Enter the chip select pin number: 4

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: 0xa, errorData: 0x1

Restarting

Enter the chip select pin number:
"

all the checks made with the same config and with arduino 1.0
I used the ruined card
Logged

0
Offline Offline
Edison Member
*
Karma: 67
Posts: 1654
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I posted a link to that module because it was the same seller that sold your module and had a circuit diagram.  The seller claimed that the module was for an Arduino but in fact that module should not be used with a 5V arduino. There was no circuit diagram for your module so I had no reason to believe your module is correct.

Your card fails in a strange way for an SD card.  The only time I have seen error code 0x0a is for a MMC card.  SD.h and SdFat do not support MMC cards.

Your card is not dead but it does not respond as expected for an SD card.

Logged

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

do you think I need to connect it to a 3.3 voltage although it is written 5V?

do you think the current config is ok to use with another sd card ?(i don't have an unlimited amount of it)

do you know if and how I can save this card?
Logged

0
Offline Offline
Edison Member
*
Karma: 67
Posts: 1654
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Since we don't have a circuit diagram for you module, I can't be sure if it is OK.  If possible measure the supply voltage as described below.

If your card is a real SD card then error code 0Xa with error data 0x1 may mean that the supply voltage to the card is out of range.  

During initialization, cards operate in a safe mode and won't go ready without the correct voltage.  Most SD cards work with Vcc in the range 2.7 to 3.6 volts.

Look at the diagrams in this article http://elm-chan.org/docs/mmc/mmc_e.html to see which SD pin has Vcc and measure the value of Vcc.

For an SD card there should be 9 pins and Vcc is the middle pin.  Pins are numbered in a strange way for historical reasons.

Edit: On your module it appears that the Vcc pin connects to the yellow cap near the regulator.

« Last Edit: January 16, 2012, 04:41:50 pm by fat16lib » Logged

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

i fixed my program (made a safe remove function that closes the file)

I changed to a new card and the card reader didn't work with a 3.3V but it worked just fine with a 5V
thank you all

I will be happy if someone know's if and how I can save the corrupted card   
Logged

Manchester (England England)
Online Online
Brattain Member
*****
Karma: 634
Posts: 34529
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

So fat16lib, any theories on why that should be?
Logged

0
Offline Offline
Edison Member
*
Karma: 67
Posts: 1654
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

al_ra,

Your SD module must have 5V connected to the external pin since it has a series regulator.

I was worried that something was wrong with the module's power regulator since the SD card failed the step that verifies the correct operating conditions.  A key condition is that Vcc is in range (usually 2.7 - 3.6 volts).

Your failing card responds to the command to use SPI mode but does not accept the initialize command. It does not go ready so it will not accept any further commands.

Since another card works, Vcc must be OK and it must be an internal problem with the card.  I don't know of any way to fix it since It won't accept most commands.

Did you try other devices like a PC/Mac or camera again?  These devices have the 4-bit SD bus and one of these might be able to send commands to the card.  They use a slightly different protocol than the Arduino with its SPI bus.
« Last Edit: January 17, 2012, 07:22:20 pm by fat16lib » Logged

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

as I said before I tried it with any device I have including my laptop and camera.

thanks anyway:)
Logged

0
Offline Offline
Edison Member
*
Karma: 67
Posts: 1654
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Guess your card failed.

 It is rare for a card to fail, and your card is the first I have seen that responds to CMD1, set SPI mode, and doesn't respond to ACMD41.

ACMD41 is the command that switched the card from card identification mode to data transfer mode.  Your card just stays busy and times out.
Logged

Manchester (England England)
Online Online
Brattain Member
*****
Karma: 634
Posts: 34529
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Your card just stays busy and times out.
And you don't think that has anything to do with removing the power in the middle of writing to it?
Logged

0
Offline Offline
Edison Member
*
Karma: 67
Posts: 1654
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

No mike, SD cards don't fail due to removal while powered on.  Billions have been made and people pull them from powered on devices all the time.

Look at the pins.  Power and ground are a bit longer than the signal pins so first the signal pins disconnect then power.

Here is the quote from the spec:
Quote
Hot Insertion
Support for hot insertion will be required on the host but will be supported through the
connector. Connector manufacturers will provide connectors that have power-pins long
enough to be powered before contact is made with the other pins. This approach is similar
to that used in PCMCIA and MMCA devices to allow for hot insertion.

The SD buffers the entire block internally before writing to flash.  It does the flash programming in a fail safe way.  It either completes correctly or the block is not marked as written if power fails.

Pulling a card can cause the file system to become corrupt but does not damage the card.
« Last Edit: January 18, 2012, 11:06:43 am by fat16lib » Logged

Manchester (England England)
Online Online
Brattain Member
*****
Karma: 634
Posts: 34529
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Yes but hot insertion is not the same as hot removal.
Anyway I am not sure if the card removed with the power on or the power was removed with it still being written to.

That is a scenario that is not duplicated by billions of people. It is very difficult to time that right in a piece of consumer equipment if you wanted to duplicate it. By constantly opening, writing and closing a file the chances of hitting a critical spot in the internal process increases dramatically. This is something that you would not expect to see in the field because that sort of cycling is not done in with consumer equipment.

I know you can kill flash memory by trying to write to it with lower than the required voltage. I used to design power detection circuits in set top boxes to file away channel information in the case of a power outage and I know if you didn't get it right you could damage the flash memory.
Logged

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

you are right,

I didn't remove the SD card while running
I shut the power off during run - apparently it was worse
Logged

0
Offline Offline
Edison Member
*
Karma: 67
Posts: 1654
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

No!  Here is more detail.  Please read the Spec and manufacture's data sheets.  SD cards were designed to be foolproof.

Quote
Physical Layer Specification Version 3.00

6.1 Hot Insertion and Removal

To guarantee the proper sequence of card pin connection during hot insertion, the use of either a special hot-insertion capable card connector or an auto-detect loop on the host side (or some similar mechanism) is mandatory (Refer to the Mechanical Addenda).

No card shall be damaged by inserting or removing a card into the SD Memory Card bus even when the power (VDD) is up. Data transfer operations are protected by CRC codes, therefore any bit changes induced by card insertion and removal can be detected by the host.

The inserted card shall be properly reset also when CLK carries a clock frequency Each card shall have power protection to prevent card (and host) damage. Data transfer failures induced by removal/insertion are detected by the host. They should be corrected by the application, which may repeat the issued command.

Card connectors and cards conform to this spec.
Logged

0
Offline Offline
Edison Member
*
Karma: 67
Posts: 1654
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Here is info from a typical datasheet for a SanDisk card:
Quote
Hot Insertion/Removal

Hot insertion and removal are allowed. The SanDisk SD Card will not be damaged by inserting or removing it into the SD bus even when the power is up:

• The inserted card will be properly reset also when CLK carries a clock frequency fPP.

• Data transfer failures induced by removal/insertion should be detected by the bus master using the CRC codes that suffix every bus transaction.

3.2.1. Power Protection

Cards can be inserted into or removed from the bus without damage. If one of the supply pins (VDD or VSS) is not connected properly, then the current is drawn through a data line to supply the card.

Data transfer operations are protected by CRC codes; therefore, any bit changes induced by card insertion and removal can be detected by the SD bus master. The inserted card must be properly reset also when CLK carries a clock frequency fpp. If the hot insertion feature is implemented in the host, than the host has to withstand a shortcut between VDD and VSS without damage.
Logged

Pages: 1 [2] 3 4   Go Up
Jump to: