Problems with sdcard G120HDR

Hello everyone,
First of all, I am sorry for my approximate English because I’m French.

I have this problem that appears when I debug:
Using mainboard GHI Electronics G120HDR version 2.0
#### Exception System.ArgumentException - 0xfd000000 (1) ####
#### Message:
#### Microsoft.SPOT.Hardware.Port::.ctor [IP: 0000] ####
#### Microsoft.SPOT.Hardware.InputPort::.ctor [IP: 0009] ####
#### Microsoft.SPOT.Hardware.InterruptPort::.ctor [IP: 0009] ####
#### Gadgeteer.Interfaces.NativeInterruptInput::.ctor [IP: 001f] ####
#### Gadgeteer.Interfaces.InterruptInput::.ctor [IP: 0039] ####
#### Gadgeteer.Modules.GHIElectronics.SDCard::.ctor [IP: 0038] ####
#### GadgeteerApp1.Program::InitializeModules [IP: 000e] ####
‘System.ArgumentException’ occurred in Microsoft.SPOT.Hardware.dll

on this line of code: this.sdCard = new GTM.GHIElectronics.SDCard (4);

I use the mainboard of G120HDR found on a forum GHI electronics.

I can not solve the problem, I changed the type of socket Z on F G120HDR_42.cs file that I added to the project.

Anyone to help me?

Post a picture showing how you have wired the sd card please.

@ andre.m
Yes it’s quite that!
I associated each pin of the spindle:
socket = GT.Socket.SocketInterfaces.CreateNumberedSocket (4);
socket.SupportedTypes = new [] {‘F’};
socket.CpuPins [3] = Pin.P1_10;
socket.CpuPins [4] = Pin.P1_6;
socket.CpuPins [5] = Pin.P1_7;
socket.CpuPins [6] = Pin.P1_3;
socket.CpuPins [7] = Pin.P1_11;
socket.CpuPins [8] = Pin.P1_22;
socket.CpuPins [9] = Pin.P1_9;

It is a model I can not access the wiring but I wired as written on the program previously.

Ah it’s good, I saw my errors, I modified 8 and 9 but the error is still ther

Yes thank you, you are quite right, I went after account.

I’m sorry, I do not understand the question, btw how long is the cable betweens the board and the SD Card Module ?

The card is fed with the UsbClientDP

@ andre.m

sorry, but I still have the same problem

Please do not create multiple posts with same questions.

@ Gus Okay, but it’s normal that you can not help me?

@ ABarbosa - It looks like in the socket definition, pin 3 is P1_10 which does not support interrupts that the SDCard module requires. Only P0_X and P2_X support interrupts.

Thank you !!! @ John

try the following code to see if it detects my micro sd card but each time, it does not detect when it is plugged in :

 sdCard.SDCardMounted += new SDCard.SDCardMountedEventHandler(sdCard_SDCardMounted);
         sdCard.SDCardUnmounted += new SDCard.SDCardUnmountedEventHandler(sdCard_SDCardUnmounted);

        
             if (sdCard.IsCardInserted)
             {
                 //if the card is already mounted therefore no event will be raised.
                 if (sdCard.IsCardMounted) //if already mounted call the handler
                     sdCard_SDCardMounted(sdCard, sdCard.GetStorageDevice());
                 else //card is inserted but not mounted, try to manualy mount it.
                     sdCard.MountSDCard();//this should raise the SDCardMountedEventHandler 
             }
             else
                 sdCard_SDCardUnmounted(sdCard);// call the unmounted event manually

      }
    

      void sdCard_SDCardUnmounted(SDCard sender)
      {
         Debug.Print("SD UnMounted");
      }

      void sdCard_SDCardMounted(SDCard sender, GT.StorageDevice SDCard)
      {
          Debug.Print("SD Mounted");
      }