SDCARD Issues

Is there any secrett o get the sdcard working? I can write to the sdcard using the fez cobra 2 but sometime i have to take out the sdcard and format it on a comuter befre it will work.

Shouldn’t i be able to format from the board?

Using 32gb scdh cards…a cheapo and a samsung version.

I get the execpetion many times when i run



Any libraries or suggestions on how i can get a reliable sdcard logger working?

I use micro SD cards with all my boards and never had a single issue with them to date even with power on and off many times and I write to a log file every 60 seconds.

Is this with the Cobra board or a custom board?

Using the Fez Cobra 2…

The xecption i get is {System.InvalidOperationException}

mmm…should oSDCARD = new SDCard(); execute ven with out sdcard not installed?

Maybe is not a hardware thing?

There is an option to pass in the type, MCI or SPI. Try with this and see if it works.

SDCARD sdCard = new SDCard(GHI.IO.Storage.SDCard.SDInterface.MCI);

If there is no card you have to expect :


    #### Exception System.Exception - 0xffffffff (1) ####
    #### Message: 
    #### GHI.IO.Storage.SDCard::NativeConstructor [IP: 0000] ####
    #### GHI.IO.Storage.SDCard::.ctor [IP: 0029] ####
    #### GHI.IO.Storage.SDCard::.ctor [IP: 0005] ####
    #### MFC.Program::Main [IP: 018a] ####

You should use a try and catch to detect a missing sd card.

Interesting, works fins in another project, so must have something to do with references or a conflict somewhere.