greiman / SdFat

Arduino FAT16/FAT32 exFAT Library
MIT License
1.09k stars 512 forks source link

ERROR SD CARD #299

Open AESIRAEROSPAZIALE opened 3 years ago

AESIRAEROSPAZIALE commented 3 years ago

I'm trying to log some data on the included flash chip on the ItsyBitsy M4 and then afer a while I want to copy some data from the flash chip to a micro sd card... But the problem is the following:

Can't access SD card. Do not reformat. SD errorCode: 0X30,0X2

error: cardSize failed SD errorCode: 0X50,0X20

I am using the Sdfat library....I have to use only that because the Sdfat library and the SD library are in conflict.

I have done: Formatting the microsdcard with every single type of formatting method The wiring is good (the sd info sketch works fine, the one using the Sd.h classic library) Used every single CS GPIO available.... On the internet they say that it is a library error and they say to modifay a line of code on line 41 of Sdspi.cpp but it doesn't work

Please help me I am desperate

greiman commented 3 years ago

I have seen lots of problems with Adafruit SPI drivers for SAMD. Sometimes reducing the SPI rate helps.

Try the QuickStart example. it uses a slow SPI rate like SD.h which is a wrapper for a 2009 version of SdFat.

The default rate for an SD card is 50MHz. All drivers in the standard Arduino IDE reduce this to the the maximum speed supported by the board that is less or equal to 50 MHz.

An SPI library should reduce the rate to the highest supported board speed but Adafruit drivers fail to do this.