I’m trying to build an emulator for FEZ Panda.
When running my FEZ Panda Application I get this exception :
[quote] #### Exception System.InvalidOperationException - 0x00000000 (2) ####
#### Message: FEZ Panda not detected!
#### GHIElectronics.NETMF.FEZ._Checker::.cctor [IP: 000c] ####
An unhandled exception of type ‘System.InvalidOperationException’ occurred in FEZPanda_GHIElectronics.NETMF.FEZ.dll[/quote]
The application still runs but I would like to eliminate this ugly exception. Is there a way to fake this in the emulator ?
After looking at the GHIElectronics.NETMF.FEZ._Checker::.cctor code seems like it expects SystemInfo.SystemID.Model to return 1 but it returns 2 witch corresponds to FEZ Domino :
The emulator that ships with the .NETMF SDK only covers the base .NETMF API. If you want it to emulate GHI classes then you have to extend the emulator yourself.
I ordered a FEZ Panda and a 128x64 LCD and it will take a while before I’ll get them because not only it isn’t available yet but also I live in France …
Meanwhile I intend to make an emulator for Panda and the LCD to play with it before I get the real thing.
Awesome work. Can someone hand Randoom some bonus points as soon as he publishes this ?!
Also Gus, can you organise to hold off sending him the Panda so there’s more time for this work to progress? ;D
Personally speaking Randoom, I’ve always thought it’d be great to be able to figure out how to do what you’re doing. Then building the emulation bits for things like 1-wire devices etc so that you get a dial to control the return value - I’m a hopeless programmer so can’t help, but if it helps I will share some test code with you. I’ve just bought Jens Kuhner’s book (don’t yet have it) that apparently has a lot of content on custom emulator configs, so perhaps there’ll be a time when I can assist more.
In the Visual Studio emulator project replace the reference “Microsoft.SPOT.CLR” with MicroFrameworkPK_v4_1\BuildOutput\public\Debug\Server\dll\Sample.Emulator.CLR.dll
I want to emulate AnalogIn so I downloaded the FEZopen Firmware but I can’t fin the source code for AnalogIn in it. Is it because FEZOpen is under development or the source code for this class will never be available ?
Last night I managed to emulate AnalogInput of Netduino :
I downloaded the firmware source witch contained the source of their API as a Visual Studio solution. When compiling a .net micro framework project there is an option in project properties to generate “stubs” witch generates some .h & .cpp files.
I copied those files to my CLR source code in MicroFrameworkPK_v4_1\Solutions\MyCLR\TinyCLR and added them to the TinyCLR.proj, then compiled it and referenced it in the emulator.
Then I modified projects MicroFrameworkPK_v4_1\CLR\Tools\EmulatorInterface & MicroFrameworkPK_v4_1\Framework\Tools\Emulator : added AnologIo.cs, IAnalogIo.cs and modified IHal.cs, Hal.cs & Emulator.cs (I did this by coping and adapting the Gpio classes/interfaces)
[line]
I just tried to do the same thing for GHIElectronics.NETMF.Hardware.dll but the source code isn’t available… So I decompiled it using Reflector and, after some modifications, I generated the stubs, copied them to my CLR project and compiled. It didn’t compile the first time so I deleted some files (TinyBooter & Touch). But when trying to use the generated dll in my emulator I get this message :