SD Card Mount Exception Error with SC20260E (G120E replacement)

After replacement of G120E with SC20260E on a custom board I get Error: An unhandled exception of type ‘System.InvalidOperationException’ occurred in GHIElectronics.TinyCLR.IO.dll

This is on the following line of sample code:
var drive = FileSystem.Mount(sd.Hdc);

I am using the latest 2.1.0-rc2 libraries

I am using the PC13 Pin to power the SD Card (3.29V on the SD Power Pin) :

        var SDPower = GpioController.GetDefault().OpenPin(SC20260.GpioPin.PC13);
        SDPower.SetDriveMode(GpioPinDriveMode.Output);
        SDPower.Write(GpioPinValue.High);
        Thread.Sleep(500);

        var sd = StorageController.FromName(SC20260.StorageController.SdCard);
        var drive = FileSystem.Mount(sd.Hdc);

I am using the Same 2GB SanDisk Fat MBR formatted SD Card that worked with the G120E

Any suggestions

I see you have power pin. Have you checked power or have you tried to power up the SD card without the switch?

Have you tried you SD card on the Dev board?

Will a GPIO pin provide enough current to power a SD card? I thought 200-300ma was typical SD card consumption? GPIO is around 20ma?

Hi Gus, Mike

I believe the SC20260E is then not ‘PIN’ compatible with the G120E regarding the SD_PWR Pin feature.
With an external 3.3V on the SD Power PIN, all is working fine. The previous G120E did provide enough current to power the SD Card using the SD_PWR Pin.

Please confirm this high powered Pin ‘feature’ is not available on this SC20260E drop-in-replacement.

Correct. there is no SD power pin on SITCore.

Is that information documented anywhere?

Not but common sense shows no SD Power pin on SCM20026E and we will be adding a note here to eliminate any confusion Upgrading

A note on the level of documentation: If GHI intents to reach mass customer base, then perhaps it would be wise to align the documentation with the level of expertise of the customer base GHI aims for. Relying on customers ability to deduce themselves is perhaps not always the most customer friendly solution.

I am very happy with GHI’s documentation. Right on target for me.

What level of customer expertise are you assuming?

2 Likes

Both professionals and newbies. I assume GHI wants to reach large number of customers right? They cant all be experienced electronics/software professionals.

What is missing from docs?

Earlier here in this thread the power pin issue for example. But also earlier it was mentioned: compact documentation is preferred, experienced users know how to do it.

I dont have anything specific myself, but hey, i’m just waiting on the fleas from mouser —> min order qty 250?

we are always here ready to help