G400-D SD Card

Only a general question… I realize that it is stated that SD requires a bit more work.

That said…

It is not critical but I would like to be able to detect when a SD card removed.

I tried using:



//RemovableMedia events
RemovableMedia.Insert += RemovableMedia_Insert;
RemovableMedia.Eject += RemovableMedia_Eject;

static void RemovableMedia_Insert(object sender, MediaEventArgs e)
{
   // Usage code here
}

static void RemovableMedia_Eject(object sender, MediaEventArgs e)
{
    Debug.Print("Event: Storage " + e.Volume.RootDirectory + "\" is ejected.");
}


I (occasionally - not always) receive the RemovableMedia_Insert event when the application first starts. Never anytime after the app begins. I never receive the RemovableMedia_Eject event.

Is there a way to override a pin (PB8) that is reserved so I can use something like:



private static Microsoft.SPOT.Hardware.InterruptPort sdDetectPin;

//SD detect pin G400HDR J235-PB8 - 3.3v when card is removed, ground card inserted
//G400 Pin 91 (PB8) 1*32+8=40
//System.Exception CLR_E_PIN_UNAVAILABLE (1) using PB8


sdDetectPin = new Microsoft.SPOT.Hardware.InterruptPort  (Microsoft.SPOT.Hardware.Cpu.Pin)G400.Pin.PB8, true,
 Microsoft.SPOT.Hardware.Port.ResistorMode.Disabled,
 Microsoft.SPOT.Hardware.Port.InterruptMode.InterruptEdgeHigh);

//Interrupt handler
sdDetectPin.OnInterrupt += new Microsoft.SPOT.Hardware.NativeEventHandler(sdDetectPin_OnInterrupt);


Yes I know it is early for my dumb question, but I had to ask…

On G400HDR, for me sdCard.GetStorageDevice() return always null after MountSDCard().


                try
                {
                    sdCard.MountSDCard();
                    Thread.Sleep(1000);
                    StorageDevice stsd = sdCard.GetStorageDevice();
                    // my func called with null stsd.
                    SdCardUtility.SdUtilityInit(stsd, SdRootDir);
                }
                catch (Exception)
                { 
                }


I’m bit tired about that and I get rid of all SD card use with netmf until it will get a bit stable.

I don’t why, but SD card is a big issue with Premium cards. To me, it creates the biggest problem in NetMF and/or gadgeteer.
G120 and G400 very often the sd destroy the firmware if I reset board with card inserted.

1 Like

@ dobova - Interesting issue… Until know i did not had much issues with uSD card in relation to G120. What i find interesting is that your firmware gets corrupted.
If your system “dies” can you try just to re flash config.hex and see if that brings your board back to live.

@ willgeorge -

It will be in the next, current firmware doesn’t work with SD detection

1 Like

@ RobvanSchelven - mhh i didn’t that test, I will try. With g120 it doesn’t happen very often now. Interesting enough, with display attached it gets stuck more often. On g400 it happens very often if I forget to eject the card.

@ dobova - I spent today investigating corrupted flash and system stability of G120 in conjunction with RS9110 and SD card… when the power supply voltage is at 3.24 volt the systems starts to become unstable… I need to do more testing but i can imagine that with a display connected power consumption is even more and might become a factor.

@ Dat -

Thanks for the reply…

Like I said, not critical but I wanted to know status…

@ RobvanSchelven - Power dropdown can be a issue really. It is a problem, because SD circuitry is really sensible to power drop. Display rises significantly pwr consumption. But in this case that’s a mess to solve. Cobra II G120 is better because it uses traces on board for supply rails to modules, but on g400 all the tiny wires can be an issue. I’m using external power supply (12V/3A), so the problem it’s not there.

@ dobova -

I’m using external power supply (12V/3A)

I use a 12Volt 2Amp power supply on the USB Client DP and I also have a PowerExt v1.0 connected for the T35 LCD in use.