SdFat icon indicating copy to clipboard operation
SdFat copied to clipboard

volumeBegin failed. Is the card formatted?

Open simeon9696 opened this issue 3 years ago • 2 comments

I'm using the SdInfo.ino sketch and I've formatted the 1GB micro sd card with the official formatter. Here's the full output of the sketch:

SdFat version: 2.0.4

Assuming the SD is the only SPI device.
Edit DISABLE_CS_PIN to disable an SPI device.

Assuming the SD chip select pin is: 15
Edit SD_CS_PIN to change the SD chip select pin.

type any character to start
init time: 17 ms

Card type: SD2

Manufacturer ID: 0X0
OEM ID: 0␀
Product: APPSD
Version: 0.0
Serial number: 0X40030000
Manufacturing date: 12/2011

cardSize: 998.24 MB (MB = 1,000,000 bytes)
flashEraseSize: 128 blocks
eraseSingleBlock: true

OCR: 0X80FF8000

SD Partition Table
part,boot,bgnCHS[3],type,endCHS[3],start,length
1,0XAD,0X14,0XAF,0X5D,0XEA,0X97,0XA9,0X6F,681453721,1853796126
2,0X5A,0XED,0X62,0X84,0X5C,0X78,0XB9,0X49,612340677,1951551534
3,0X22,0XBE,0XD0,0X76,0XE5,0XEA,0XA9,0X18,1796606188,778673004
4,0XFD,0X72,0XA5,0XB1,0X48,0X51,0X87,0X80,1494544675,2599889341

MBR not valid, assuming Super Floppy format.

volumeBegin failed. Is the card formatted?

type any character to start

I am using an ESP8266 with the following wire config:

 * D5   <-> SCK/CLK
 * D6   <-> MISO
 * D7   <-> MOSI
 * D8   <-> CS
 * Vcc  <-> Vcc
 * Gnd  <-> Gnd

And I changed line 25 from const uint8_t SD_CS_PIN = SS; to const uint8_t SD_CS_PIN = D8;

How can I fix the volumeBegin failed error? If I use the SdFormatter.ino, the sketch works but then Windows says 'you need to format the disk to use it' when I reinsert it into the machine.

If I use QuickStart.ino I get:

Card successfully initialized.
Can't find a valid FAT16/FAT32 partition.
Try reformatting the card.  For best results use
the SdFormatter program in SdFat/examples or download
and use SDFormatter from www.sdcard.org/downloads.

simeon9696 avatar Feb 20 '21 21:02 simeon9696

I can't help. The partition table reads as junk.

I would need to look at your setup with a logic analyzer but I don't have your hardware and card.

This is what the partition table should look like, this is a 2G card. All but the first partition should be zero.

Do you have another SPI device?

Your card may not support SPI properly. Windows uses the 4-bit SDIO bus.

SdFat version: 2.0.4

Assuming the SD is the only SPI device.
Edit DISABLE_CS_PIN to disable an SPI device.

Assuming the SD chip select pin is: 10
Edit SD_CS_PIN to change the SD chip select pin.

type any character to start
init time: 48 ms

Card type: SD2

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

cardSize: 2032.66 MB (MB = 1,000,000 bytes)
flashEraseSize: 32 blocks
eraseSingleBlock: true

OCR: 0X80FF8000

SD Partition Table
part,boot,bgnCHS[3],type,endCHS[3],start,length
1,0X0,0X3,0X3D,0X0,0X6,0X28,0XE8,0XD8,249,3969799
2,0X0,0X0,0X0,0X0,0X0,0X0,0X0,0X0,0,0
3,0X0,0X0,0X0,0X0,0X0,0X0,0X0,0X0,0,0
4,0X0,0X0,0X0,0X0,0X0,0X0,0X0,0X0,0,0

Scanning FAT, please wait.

Volume is FAT16
sectorsPerCluster: 64
clusterCount:      62020
freeClusterCount:  62015
fatStartSector:    250
dataStartSector:   768

greiman avatar Feb 21 '21 14:02 greiman

Thanks @greiman I tried a 64GB card from SanDisk and I got a print out similar to yours above. So I guess the wiring etc is good, just the 1GB card is bad?

simeon9696 avatar Feb 21 '21 14:02 simeon9696