Pages: 1 2 [3] 4   Go Down
Author Topic: SD card became unrecognized by card readers  (Read 10962 times)
0 Members and 1 Guest are viewing this topic.
Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 604
Posts: 33448
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

You seem to be missing the fact that this was not a hot insertion or removal. It was the removal of power during an operation on the flash. That is not covered in any of the specifications.
Logged

0
Offline Offline
Edison Member
*
Karma: 63
Posts: 1605
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Mike give up.  The spec says the card will not be damaged.  That means during write.  They have power controllers and caps to insure this.

Some SD controllers even have enough caps to insure the data block is saved.

New Panasonic cards say this:
Quote
Even if you mistakenly remove the SD card or turn off the power while data is being written to it, all of the saved data will be retrieved to ensure that you don't lose it.

Edit: The file or file system may be bad but the card is not damaged if power is removed during write.  You can reformat it and it will be OK.

Also cards have a large number of spare blocks and during the life of an SD many blocks become bad and are retired to a bad block list.  So even if a block were damaged by power failure, the card survives.

Data blocks have ECC so when a read has a correctable ECC error, the block is rewritten by modern cards.
« Last Edit: January 18, 2012, 12:44:21 pm by fat16lib » Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 604
Posts: 33448
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

fat16lib - you are talking like so many software engineers I have known. You can't change the laws of physics by writing a spec that says it should not be so.

Clearly something happened for the card to fail, it could be:-
1) A random fail unconnected with anything he was doing.
2) Something he did that caused the fail or made it more likely.

You seem to be saying it is 1) because it couldn't be 2) {as an aside have you ever read Catch 22?, the bit where the plane crashed and he was on the passenger list}

So if you are so sure of yourself, take four SD cards from different manufacturers. Run that same code, and plug and unplug the arduino say twenty to thirty times with about 20 seconds between plugs. Then if you get a fail you will know you are wrong. If you don't get a fail you will either be right or the OP was particularly unlucky.
Logged

0
Offline Offline
Edison Member
*
Karma: 63
Posts: 1605
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Mike, you are a grumpy old guy.  Kind of funny/amusing too.

I am a PhD physicist.  I taught solid state physics to EEs.

I spent most of my career at large world class research labs working with advanced electronics.  LBNL, CERN, Fermilab, and others.

Now that I am retired, I amuse myself with programming since I didn't have time for that while I was working.  I had a large staff of electrical engineers and programmers.

It is about probability and it is extremely unlikely that pulling the card during a write damaged it since it was designed to be pulled during write with power on it.

I have tried to damage SD cards by pulling them during write.  I wrote a program to do the fastest possible raw write to an SD card to see what would happen.  I never damaged any.
« Last Edit: January 18, 2012, 01:25:14 pm by fat16lib » Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 604
Posts: 33448
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Well your career almost matches mine, PhD, Physics lecturer at a University for 21 years taught graduate and undergraduate EE and Physics students and then in industry for 15 years.

However what I can't understand is you keep saying:-
Quote
It is about probability and it is extremely unlikely that pulling the card during a write damaged it

I know he didn't damage it by pulling it out of the socket,
He removed the power from the arduino he did not pull out the SD card from its socket!
That is what you have to test!

I can only assume that your time in academia robbed you of some vital fault finding ability. Something happened, I have never known any academic so starved of data that he will not formulate a hypothesis, so what is yours?
All you keep saying is it could not be this. No alternative explanation?
Logged

0
Offline Offline
Edison Member
*
Karma: 63
Posts: 1605
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
I know he didn't damage it by pulling it out of the socket.

How do you know this?  Static on a signal pin could do it.

Wow, you put me in my place.
Quote
I can only assume that your time in academia robbed you of some vital fault finding ability. Something happened, I have never known any academic so starved of data that he will not formulate a hypothesis, so what is yours?
All you keep saying is it could not be this. No alternative explanation?




Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 604
Posts: 33448
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Static on a signal pin could do it.
You can't get static on a pin on a removal, think about it.
It is also hard to get static on any conducting surface, but you know that.  smiley-wink
Logged

0
Offline Offline
Edison Member
*
Karma: 63
Posts: 1605
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Why do manufactures say this?
Code:
Do not touch the terminals with your hands or metal objects. The card may get corrupted or erased by electrical noise, static electricity.

Is Sony wrong?

Quote
    To avoid losing stored data, keep SD memory cards away from static electricity or electrical noise that may interfere with the card.

    When carrying SD memory cards, be sure to put them in their case to avoid static electricity damage.

« Last Edit: January 18, 2012, 02:15:53 pm by fat16lib » Logged

0
Offline Offline
Edison Member
*
Karma: 63
Posts: 1605
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

al_ra,

Mike has me a bit curious about your failed card.  I have never seen a true SD card lockup on ACMD41.  I have seen it with MMC cards and is to be expected since they they don't support ACMD41.

Could you provide a little more info?

How did you acquire it?  There are many counterfeit cards on ebay that have modified firmware and often lockup. These cards are small but are reprogrammed to appear much larger and lockup after some use.

What is the brand?

What is the size in MB or GB?

What is the model for example SanDisk has Ultra, Extreme, etc.   Other manufactures have other model names.

What is the class number? 2, 4, 6, 10 are common.

Add anything else you think might be helpful.
Logged

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

it is a genuine sandisk SD card, 1GB, I don't know the model (I added 2 photos)


* DSC01692.JPG (831.4 KB, 2048x1536 - viewed 27 times.)

* DSC01693.JPG (866.03 KB, 2048x1536 - viewed 25 times.)
Logged

0
Offline Offline
Edison Member
*
Karma: 63
Posts: 1605
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Where and when did you buy that card.

The SanDisk 1GB card is one of the most counterfeited cards.

Your card has the correct notch at the bottom but the write protect tab doesn't look like quite right, and the label look suspicious.

Could you download my Fat16 library http://code.google.com/p/fat16lib/downloads/list and run the fat16info example.

Post the output.  It's a long shot but it might give more info.
« Last Edit: January 18, 2012, 06:19:43 pm by fat16lib » Logged

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

I think it was 5 years ago , i got it with my canon camera - I bought it from a distinguished photography shop

the test result are:


Fat16 version: 20111205
FreeRam: 1264

type any character to start
card.init failed
SD error
errorCode: 2
errorData: 1

type any character to start
Logged

0
Offline Offline
Edison Member
*
Karma: 63
Posts: 1605
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I have an old SanDisk card that came with a Canon camera and it also looks a little different than the current retail cards so your card is no doubt genuine.

As a last long long shot go into the Fat16 library and edit SdCard.h at about line 96 change the 2000 to 20000 in this line
Code:
uint16_t const SD_INIT_TIMEOUT    = 2000;

That will increase the initialization timeout to 20 seconds.  You will need to wait a long time for the error message.

The card is failing with ACMD41.  The status is busy so lets give it a long time.
Logged

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

I did it,

had exactly the same results... only 20 sec later:(
Logged

0
Offline Offline
Edison Member
*
Karma: 63
Posts: 1605
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

That card accepts an alternative initialization command and I have a SanDisk retail version of the card manufactured in 2006.

It should be easy for me to do a small patch that tries CMD1 for initialization.

How much has the card been used? 

SanDisk says this card has a life expectancy of 5-10 years for normal consumer use in a camera.  Normal consumer use in a camera is not much use.

At the risk of another ad hominem attack by Mike, I will offer "my theory".

I don't think you would do the common things that kill cards, bending, crushing, immersion in water, static or high voltage noise.

After that comes normal wear after five years if you used it very much or a defective part if it had very little use.

I still say power off during programming is not a likely cause.  SanDisk says the card should not be harmed by removal of power during programming.

In addition it is unlikely it was programming flash when you removed power.  I looked at your sketch and it probably caused two blocks to be written per second.  This card buffers write data in RAM and and rapidly programs the data when the block is complete.  It is capable of programming 4000-8000 blocks/second so the chance it is programming when the application is running is on the order of 1/2000.

In addition you must assume the Arduino keeps running at very low voltage and the card's power controller fails to stop programming on power failure.  To make Mike happy I will say there is a chance this happened but let Mike speculate on the probability that it was programming and the SanDisk design to protect the card is bad.
Logged

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