Spider - SD Card ERROR

Hi Jeff,

sorry for the late response - I’ve not been working on this for a few days.

As to your questions -

No, it is not working. I do have the extender attached but only have a post on the
extender for gnd and P5 but nothing connected to the post.

I will take out the extender and retry later …

thanks,

David

Hi Jeff,

ok, so I took the extender out and now only have the dual power usb module
and the sd module -but - still doesn’t work.

I was also wondering if someone knows for sure what sd card will work with
the sd module. I had tried 2 different cards but neither work, perhaps if I have
the make, size, specs, etc of a card which is known to work, I could try to get it
and see if it works or not…

David

Wrapping up this SDCard Module journey -

  1. It was the spider mainboard that had a problem.
    I now have 2 spider mainboards, one works with the SDModule, the other does not.

  2. It looks to me like the documented code for events does not work:

sdCard.SDCardMounted += new GTM.GHIElectronics.SDCard.SDCardMountedEventHandler(sdCard_SDCardMounted); sdCard.SDCardMounted += new SDCard.SDCardMountedEventHandler(sdCard_SDCardMounted);

When I put the above code in my program, the sdCard_SDCardMounted and the
sdCard_SDCardMounted parameters , I cannot compile as these cause an error that says they do not exist in the current context.
I also referred to the code sample Basic Storage Tests and that code doesn’t work for me.
Maybe someone out there has an explanation for that but maybe it would be a good idea to remove or fix the documentation.

  1. At least this code below does seem to work:
    sdCard.MountSDCard();
    System.Threading.Thread.Sleep(500);
    String rootDirectory = sdCard.GetStorageDevice().RootDirectory;

Does anyone know how to make the event handler work?

Hi,
did you let Visual Studio make the event handler?

In the method Program.Started type:

sdCard.SDCardMounted, then type!!! (not copy and paste) +=

now VS Shows the Name of the Event handler, hit two times Tab on your Keyboard and VS completes the program line and makes the method with the Event handler.
In Visual Studio 2012 the Name of the Event handler is:

sdCard_SDCardMounted;

the code line is:
sdCard.SDCardMounted +=sdCard_SDCardMounted;

Excuse me, if that’s familiar to you.
Cheers Roland

1 Like

Hi RoSchmi,

You are right, I copied and pasted the code but don’t understand why that wouldn’t have been ok.

I completely do not understand why your instructions worked but they did!

The first time I typed
sdCard.SDCardMounted +=
then hit tab and it put in sdCard_SDCardMounted however I neglected to tab
again and so still had the error.

I tried it again and tabbed twice as you say and it worked.

What kind of weird and convoluted stuff is going on? Why wouldn’t copy and paste work?

It should just be code to put in the editor,
I don’t get it but I do appreciate your help and it does not give an error anymore.

thanks again!

@ dave001 -
I don’t know either what happens behind the scenes of NETMF. Something must be written in the code for the Dispatcher thread. VS makes this automatically, I think, if you enter the command line as I told you. Copy and paste and compiling does not initiate this process I suppose. Perhaps some other folks of the Community know details.