Go Down

Topic: SD Card Begin Failing Every Second Go? (Read 458 times) previous topic - next topic

Tbdanny

Jul 07, 2019, 01:05 pm Last Edit: Jul 07, 2019, 01:33 pm by Tbdanny
Hi all,

I'm attempting to use the SdFat library to read a 16GB SD card that has been formatted with the SD Card Formatter program.  It seemed to work fine in the SdInfo example from the SdFat library, but when I went to run the ReadCsv example, it told me that "Begin Failed".  So I went back to the SdInfo example, and I noticed something odd.  Every second time I ran it, it gave me the same error:

Code: [Select]


SdFat version: 10100

Assuming the SD is the only SPI device.
Edit DISABLE_CHIP_SELECT to disable another device.

Assuming the SD chip select pin is: 53
Edit SD_CHIP_SELECT to change the SD chip select pin.

type any character to start

init time: 17 ms

Card type: SDHC

Manufacturer ID: 0X3
OEM ID: SD
Product: SL16G
Version: 8.0
Serial number: 0XBE0EE735
Manufacturing date: 6/2015

cardSize: 15931.54 MB (MB = 1,000,000 bytes)
flashEraseSize: 128 blocks
eraseSingleBlock: true
OCR: 0XC0FF8000

SD Partition Table
part,boot,type,start,length
1,0X0,0XC,8192,31108096
2,0X0,0X0,0,0
3,0X0,0X0,0,0
4,0X0,0X0,0,0

Volume is FAT32
blocksPerCluster: 64
clusterCount: 485936
freeClusters: 485933
freeSpace: 15923.05 MB (MB = 1,000,000 bytes)
fatStartBlock: 8790
fatCount: 2
blocksPerFat: 3797
rootDirStart: 2
dataStartBlock: 16384

type any character to start
error: cardBegin failed
SD errorCode: 0X25,0XFF

type any character to start

init time: 17 ms

Card type: SDHC

Manufacturer ID: 0X3
OEM ID: SD
Product: SL16G
Version: 8.0
Serial number: 0XBE0EE735
Manufacturing date: 6/2015

cardSize: 15931.54 MB (MB = 1,000,000 bytes)
flashEraseSize: 128 blocks
eraseSingleBlock: true
OCR: 0XC0FF8000

SD Partition Table
part,boot,type,start,length
1,0X0,0XC,8192,31108096
2,0X0,0X0,0,0
3,0X0,0X0,0,0
4,0X0,0X0,0,0

Volume is FAT32
blocksPerCluster: 64
clusterCount: 485936
freeClusters: 485933
freeSpace: 15923.05 MB (MB = 1,000,000 bytes)
fatStartBlock: 8790
fatCount: 2
blocksPerFat: 3797
rootDirStart: 2
dataStartBlock: 16384

type any character to start
error: cardBegin failed
SD errorCode: 0X25,0XFF

type any character to start

init time: 17 ms

Card type: SDHC

Manufacturer ID: 0X3
OEM ID: SD
Product: SL16G
Version: 8.0
Serial number: 0XBE0EE735
Manufacturing date: 6/2015

cardSize: 15931.54 MB (MB = 1,000,000 bytes)
flashEraseSize: 128 blocks
eraseSingleBlock: true
OCR: 0XC0FF8000

SD Partition Table
part,boot,type,start,length
1,0X0,0XC,8192,31108096
2,0X0,0X0,0,0
3,0X0,0X0,0,0
4,0X0,0X0,0,0

Volume is FAT32
blocksPerCluster: 64
clusterCount: 485936
freeClusters: 485933
freeSpace: 15923.05 MB (MB = 1,000,000 bytes)
fatStartBlock: 8790
fatCount: 2
blocksPerFat: 3797
rootDirStart: 2
dataStartBlock: 16384

type any character to start
error: cardBegin failed
SD errorCode: 0X25,0XFF

type any character to start


There was also a pause of a few seconds when it was working and bringing up the freeClusters.  I tried it with two other SD cards, and they both failed instantly - wouldn't begin at all.

The SD card reader module is wired the following way:
CS: Pin 53
MOSI: Pin 51
SCK/CLK: Pin 52
MISO: Pin 50

It's on an Arduino Mega 2560.  How can I get this working reliably?

Go Up