Main Site Documentation



I am getting this error,

Exception System.Exception - CLR_E_DRIVER_NOT_REGISTERED (2)

#### Message: 
#### Microsoft.SPOT.Hardware.NativeEventDispatcher::.ctor [IP: 0000] ####
#### GHIElectronics.NETMF.System.InternalEvent::.cctor [IP: 0014] ####

An unhandled exception of type ‘System.Exception’ occurred in Microsoft.SPOT.Hardware.dll

When using this code for an SPI instance.

//GT = Gadgeteer
            GT.Socket socket = GT.Socket.GetSocket(3, false, null, null);
            SPI.Configuration SpiConfiguration = new SPI.Configuration(false, 2, 2, false, true, 1000);
            SPI.Sharing shared = new SPI.Sharing();
            SPI SpiCom = new SPI(socket, SpiConfiguration, shared, socket, GT.Socket.Pin.Five, null);

            SpiCom.WriteRead(WriteBuffer, ReadBuffer);

Is my code correct or am I bouncing off the walls?


What references do you have added to your project? It looks like you may be using a non-OSH assembly, which is usually the cause of this error.


I just have to ask this. Is firmware on the board and installed SDK in sync?


Guys, Solved it!
I was using the gadgeteer template, and placed the SPI instance within ProgramStarted(). I am now using a standard class template and not getting any errors. Its nice to see that SPI has a shared method, so why cant we have the same for I2C, which is also a buss?

@ Steven, I can only find 2 OSH refs should there be more?

@ Architect, Good call, but I updated my Hydra a few days ago!


Sorry its not solved! It appears to be ok when using the emulator, but when I change to USB I get the above error.

@ Steven I am using:

using System;
using System.Collections;
using System.Threading;
using Microsoft.SPOT;

using GHIElectronics.OSH.NETMF.Hardware;
using GHIElectronics.OSH.NETMF.Native;
using GHIElectronics.NETMF.System;

using Gadgeteer;
using Gadgeteer.Interfaces;
using GT = Gadgeteer;
using GTM = Gadgeteer.Modules;
using Gadgeteer.Modules.GHIElectronics;

in my program, and





Is not supposed to be there.


@ Architect, Excellent thats fixed it, but now, how do I use trig functions?



**** Oooops. I thought there were trig functions there.


This project has some functions,but I don’t see the code there

Something is broken on codeshare for this one after the recent update.


I have a math lib here.

Also, I think I read that 4.2 was adding a lot of the trig functions. I haven’t explored that yet, though.


I have a copy of Grommet somewhere I will dig that out. I’m sure that has Trig functions, it just makes it a bit messy. Thanks for the help!


Math.cs from Grommet works fine! Thanks again!


You are welcome!

What are you working on, just curious?


@ Architect,

I’m not focused on anything at the moment. I get so much pleasure form just connecting sensors etc, to a uC and getting something working, normaly without an end product in mind. Yeah I know I need to get a life, but it keeps me happy. I am sure I will fly a Panda II, with the help of an STM32F103, buts that will be at least 3 - 4 months when I have enough spare cash, and if I dont lose intrest.


I see. As long as you having fun like the rest of us. Good luck with your projects! :slight_smile: