When I try to get the SD card to work on the Galileo I can not get the SD.begin() statement to work. Using IDE 1.5.3 I have upgraded the card's firmware and also confirmed that the SD card works by using the serial port via Linux to verify that I can mount the drive and see a listing of the files on the card. However, when I try the following code I can not get the SD card to initialize. Result is always false regardless if I use chip select 4 or 0 or make the call with empty "()" brackets. The SD card is 8 MB formatted for FAT32 and is inserted in the SD holder on the Galileo. Release notes for version 1.5.3 says that the "begin" statement is supported. Am I missing something or does the SD card have to be mounted first using Linux? Any help on this is highly appreciated.
// Open serial communications
Serial.begin(9600);
Serial.print("Initializing SD card...");
if (!SD.begin(4)) {
Serial.println("initialization failed!");
return;
}
Serial.println("initialization done.");