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

Here is the patch that uses CMD1 for initialization.  If this doesn't initialize the card there is no hope.

CMD1 was used to initialize MMC cards and also works for standard SD cards like the 1GB SanDisk card.

In Fat16 edit SdCard.cpp at about line 180 and replace this:
Code:
 // start initialization and wait for completed initialization
  while ((r = cardAcmd(ACMD41, 0)) != R1_READY_STATE) {
    if (((uint16_t)millis() - t0) > SD_INIT_TIMEOUT) {
      error(SD_ERROR_ACMD41, r);
      return false;
    }
  }
with this:
Code:
#ifdef USE_ACMD41
  // start initialization and wait for completed initialization
  while ((r = cardAcmd(ACMD41, 0)) != R1_READY_STATE) {
    if (((uint16_t)millis() - t0) > SD_INIT_TIMEOUT) {
      error(SD_ERROR_ACMD41, r);
      return false;
    }
  }
#else  // USE ACMD41
  // use CMD0 to initialize the card - works with SD or MMC cards
  uint8_t const CMD1 = 0X01;
  uint8_t const SD_ERROR_CMD1 = 16;
  while ((r = cardCommand(CMD1, 0)) != R1_READY_STATE) {
    if (((uint16_t)millis() - t0) > SD_INIT_TIMEOUT) {
      error(SD_ERROR_CMD1, r);
      return false;
    }
  }
#endif  // USE_ACMD41
I did a benchmark on the 1GB card with a PC test program and it can program 20,000 blocks per second.  So there is a 1/10000 chance that it is programming flash in your app at any instant.
« Last Edit: January 19, 2012, 09:57:59 am by fat16lib » Logged

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

thank you,

for what you've asked - I haven't used it much - about 18 month after buying it I bought a 8GB card and used it with my camera since then
so for the last 3 year it just been in a box unused - till a few weeks ago

about the program you wrote - thanks for your efforts - but I'll be near my arduino only in 2 or 3 days

I'll let you know as soon as I'll try it
hoping for a resurrection of my card:)
Logged

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

I did it and that is the output know:



Fat16 version: 20111205
FreeRam: 1264

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

type any character to start

notice that the error code is different...
Logged

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

There are no other commands to try for that SD.  It functions in SD identification mode but will not go into data mode.  It just returns busy for any command to switch it to data mode.
Logged

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

anyway thank you so much for your efforts,

the price of SD cards has dropped at the last few years so it's not that bad,

but what is your theory of what cause it? I want to avoid  it in the future.. 
Logged

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

I wouldn't worry much, SD cards rarely fail unless they are severely abused .  Companies like SanDisk have labs that analyze cards that fail under warranty and keep making SD cards more idiot proof.

There was probably a marginal part in your card.  Only SanDisk could diagnose the fault since the card doesn't return a detailed status, just busy.
 
Since your SanDisk card was made, SD cards have been improved so their expected life is now well over 10 years.

Normally the worst that happens when a card is not shutdown gracefully is a file is corrupted.

About 30,000 people have downloaded the various SD libraries I have written and the Arduino SD.h library is based on my code.  I get a lot of email about problems and this is the first card I have seen that would respond to mode and identification commands but not go ready.

Many high end cards like the SanDisk Extreme now have a lifetime warranty.
« Last Edit: January 21, 2012, 11:37:38 am by fat16lib » Logged

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

Sorry to ressurect a partially dead thread - and slightly off topic, but it is the first one I have found near my issue...

Latest Arduino Uno
SD reader/writer similar to the one fat16lib linked (http://www.ebay.com/itm/SD-Card-Reader-Module-Arduino-ARM-Read-and-Write-/200659790559?pt=LH_DefaultDomain_0&hash=item2eb8416adf)

It doesn't work with 3 sd cards I have, first I was operating off the 3.3v pin, then I found the threads that said the current is too low, so I moved to the 5v pins, still no joy.

I am using SDFormatter to try a full format, all sd cards fail to format with various error codes.

I was going to try providing an independent 5v supply to the card reader/writer, but after I saw the comment from fat16lib on this thread I realised that my issue may be the card reader/writer using divider/pull-up resistors.

  • Can you point me at a link for a circuit to make this card reader/writer work?
  • Would this card reader/writer work better with mini/micro sd (in a size changing thingy) using the arduino 3.3v supply?

Thanks in anticipation.
« Last Edit: March 12, 2012, 03:10:56 pm by john_uk » Logged

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

Hi, i have a similar problem, "SD card became unrecognized by card readers", but in different way i think.

I have a 512MB SanDisk microSD, and after some test of write and read it became unrecognizable.
I'm using it with Arduino Etehernet shield.

I'm trying to restore card with Panasonic SDFormatter tool but it does not recognize sd too...

Anyway, i tested this sdfat lib examples.
I try SdFormatter and result is:
Code:
Enter option: F
Card Size: 484 MB, (MB = 1,048,576 bytes)

Erasing
....
error: readBlock
SD error: f,1

And with QuickStart:
Code:
Card successfully initialized.

Card size: 507 MB (MB = 1,000,000 bytes)

Can't read the card.
Try another SD card or reduce the SPI bus speed.
The current SPI speed is: 4.00 MHz
Edit spiSpeed in this sketch to change it.

With SdInfo:
Code:
SdFat version: 20111205

type any character to start

init time: 4 ms

Card type: SD2

Manufacturer ID: 0X3
OEM ID: SD
Product: SU512
Version: 8.0
Serial number: 1254761136
Manufacturing date: 11/2006

cardSize: 990976 (512 byte blocks)
flashEraseSize: 32 blocks
eraseSingleBlock: true
read MBR failed
SD errorCode: 0XF
SD errorData: 0X1

Can i do something?
Thanks.
« Last Edit: March 18, 2012, 09:04:40 am by blow » Logged

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

Sorry to ressurect a partially dead thread - and slightly off topic, but it is the first one I have found near my issue...

Latest Arduino Uno
SD reader/writer similar to the one fat16lib linked (http://www.ebay.com/itm/SD-Card-Reader-Module-Arduino-ARM-Read-and-Write-/200659790559?pt=LH_DefaultDomain_0&hash=item2eb8416adf)


just bumping this...I'm also very curious to know if there's a reliable way to make these very cheap modules work with arduino. I was about to buy a couple because they're so cheap, but then realized that they don't even use resistor dividers (which would be borderline acceptable) - it's only pullup resistors. I don't get how would this ever work ... I mean when at some point the arduino pins will output 5V that will go straight to the sd card which is not good.

I only thought about buying the module to just get the form factor and the card socket and make a separate proper circuit with a 4050 level shifter.
Logged

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