A device I had been testing for over two months suddenly started giving FR_DISK_ERR (I'm using Elm Chan's FAT-FS) [Link]. When I tried debugging, the command (CMD0) which must be clocked in to set the SD card into SPI mode (as described in the SD card spec sheet - SDcard.org [link]) return 0xFF and not 0x01, i.e. it failed. My question is:

*If CMD0 fails does that mean the SD card controller is not working?

*Will it still work in SDIO mode even if CMD0 fails? (I couldn't test it as my uC does not support SDIO)

*Can an OS (Linux, Windows, Mac) format this SD card to make it working again? If so how does it do it?

Chan's FAT-FS has no method to solve if we have an FR_DISK_ERR, so I need to find a way to solve this remotely.

  • \$\begingroup\$ Try two different cards and confirm with a logic analyzer what really happens on the bus. I have experienced several SD card failures. \$\endgroup\$
    – filo
    May 11, 2017 at 7:35
  • \$\begingroup\$ I tried with two different cards. They worked, except for this one. I tried this SD card in another device too, I get the same issue with the second device and failing SD card. How does a card become corrupted like this, how does the uC in the card stop responding? \$\endgroup\$ May 11, 2017 at 8:42
  • \$\begingroup\$ Even gparted (Linux) is not able to recognize the sd card. I get an error "input/output error during read on /dev/sdb". \$\endgroup\$ May 11, 2017 at 9:05
  • 1
    \$\begingroup\$ Just throw this card away. Card can also be counterfeit bunniestudios.com/blog/?page_id=1022 or this one just had less luck (I've killed once a Samsung card in a raspberry pi in a year without doing any writes). \$\endgroup\$
    – filo
    May 11, 2017 at 10:36
  • \$\begingroup\$ @filo, I have an SD card that does not respond to CMD9, which is to get the CSD register. But this command fails (timeout). Can this be because the card only supports SDIO (CMD9 not supported in SDIO). \$\endgroup\$ May 12, 2017 at 11:11

1 Answer 1


If CMD0 fails, it's either the SPI/ SDIO pins are not connected properly (check your connections) or the controller is not actually working. In my case, the controller wasn't working. I tried using it in my Linux PC, even gparted was unable to detect it. I'm still unsure why CMD9 failed, I have tried to contact the manufacturer, let's see what they respond to that. And that answers my own question.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.