SD Card not working

Have you tried USB memory sick?

USB Stick works.
I tried this card : http://www.kingston.com/flash/securedigital.asp

Does not work . :frowning:

Can someone give me a link to buy a SD card already tested on the spider ?

I have ordered this card and it works perfectly fine! Why is it not working for you?

The card above is one of them. Most cards should work just fine.

mmmh so it seems to be my problem. Can you give me the code you used ?
what is the version of your spider ? (in mfdeploy)

I tried to reinstall the firmware but nothing changed.

I’ll try to buy another SD reader

How are you powering the board?

You may have low voltage that is okay for EMX to run but the SD is not happy.

No change by powering the board

Visually inspect the SD module and the SD socket.
What socket are you plugging the SD module in?
What is the code you are trying? With what setup in the gadgeteer designer?

Socket 5 :

See image.

Code :

void ProgramStarted()
{
	sdCard.DebugPrintEnabled = true;
	sdCard.SDCardMounted += sdCard_SDCardMounted;
	sdCard.MountSDCard();
	Debug.Print("Mounted : " + sdCard.IsCardMounted + ", Inserted : " + sdCard.IsCardInserted);
}
 
void sdCard_SDCardMounted(SDCard sender, Gadgeteer.StorageDevice SDCard)
{
	Debug.Print("Mounted !");
}

Output :

(See this.Topic.Subject)

I don’t think you can really do something, I suspect my module is not working or something is with with my socket 5.
Can you give me your code please ?

[quote]Output :

(See this.Topic.Subject)[/quote]

What do you mean? Do you get an exception or what happens when you run the code?

I get that in the output windows

[quote]Using mainboard GHIElectronics-FEZSpider version 1.0

Exception System.Exception - 0xffffffff (1)

Message:

GHIElectronics.NETMF.IO.PersistentStorage::.ctor [IP: 0000]

Gadgeteer.Modules.GHIElectronics.SDCard::MountSDCard [IP: 000d]

Gadgeteer.Modules.GHIElectronics.SDCard::.ctor [IP: 007f]

DhomeBox.Micro.Program::InitializeModules [IP: 0006]

DhomeBox.Micro.Program::Main [IP: 0010]

A first chance exception of type ‘System.Exception’ occurred in GHIElectronics.NETMF.IO.dll

Exception System.Exception - 0xffffffff (1)

Message:

GHIElectronics.NETMF.IO.PersistentStorage::.ctor [IP: 0000]

Gadgeteer.Modules.GHIElectronics.SDCard::MountSDCard [IP: 000d]

DhomeBox.Micro.Program::ProgramStarted [IP: 0021]

DhomeBox.Micro.Program::Main [IP: 0015]

A first chance exception of type ‘System.Exception’ occurred in GHIElectronics.NETMF.IO.dll
SDCard : Error unmounting SD card - no card detected.[/quote]

No exception are thrown in my code, the exception which appear in the log is swallowed by a generic catch statement in SDCard.MountSDCard and logged on Debug.

Alright, lets see if we can get this solved for you. I’ve been trying to get your error since the day it was posted, and I always get the correct output.

I’ve been using your code for testing, so we have the same thing there.

I’ve tried every type of card you have as well. I also formatted exactly as you did.

The only way I can recreate the problem is if I use the microSD adapter without a microSD card in the adapter.

Now, this error message includes the call stack around where your error occurs.

Notice that in your original error that you posted, this error is displayed twice. The reason for this is that when a card is inserted, the SD card driver automatically tries to mount the card. (You can check the codeplex for more information).

The line


sdCard.MountSDCard();

is also unsafe, because you do not know if a card is inserted, but you are still trying to mount one. If for some reason the driver doesn’t mount it for you, consider using an if statement or try/catch to make sure it is safe.


            if (IsCardInserted)
            {
                MountSDCard();
            }


            try
            {
                MountSDCard();
            }
            catch
            {
                ErrorPrint("Error mounting SD card - no card detected.");
            }

Have you ever removed the card improperly? By pulling it out and not pushing it in then pulling it out?
Do you have another cable you can connect the module to the spider with? I’m trying everything I can think of, because this should be working. :confused:

Thanks, I tried another cable, no change.
Everything is working fine, except this sd card reader, Spider is awesome.

I will command other modules with another sd card reader and tell you if it is better.

By the way, can I use every pin on socket 5 as GPIO (Except GND V3.3 V5) ?
If I can, I’ll test all the pin maybe one is defective.

Did you try to push the SD card till it “clicks in”?

Yes all these pins can be used as GPIO. This explains how to use the pins directly GHI Electronics – Where Hardware Meets Software

Yes the SD Card clicks in.

It seems that the pin 9 have an intensity problem. Compared to other pins, the led does not shine very bright, it’s almost off.

I suspect my spider is not in good shape on socket 5 pin 9.

Having weak intensity on CLK pin is OK my friend told me…
Maybe the module is down, I’ll order a new one.

I think I have found the problem take a look at that :

http://gadgeteer.codeplex.com/SourceControl/changeset/view/13828#150071

The “Hardware” folder is for SD Card 1.3… my module is 1.2 !
Do you think it matters ?

No that is not it

@ Slashene
Hi, I have had exactly the same problems with the SD-card until I tried this cards, both work fine:
[ulist]Transcend SDHC 8GB
SANDISK Ultra 8GB
[/ulist]
It seems, that’s the cards are the problem, not the gadgeteer hardware.

I ordered the exact same card he has and tried it and it worked just fine here!