Deploy error when display is connected (Null reference exception in Microsoft.SPOT.TinyCore.dll)


I’m getting a null reference exception when deploying to the device. It seems to be only when the display is connected.

First run on the deploy:

Updating display configuration. THE MAINBOARD WILL NOW REBOOT.
If you are deploying/debugging using Visual Studio, you will need to stop (Shift-F5) and start debugging again (F5).

Restarting the debugging session, and then I get Null reference exception in Microsoft.SPOT.TinyCore.dll:

The thread ‘’ (0x2) has exited with code 0 (0x0).
Using mainboard GHIElectronics-FEZSpider version 1.0
Program Started
#### Exception System.NullReferenceException - CLR_E_NULL_REFERENCE (3) ####
#### Message:
#### Microsoft.SPOT.Application::OnEvent [IP: 0098] ####
#### Microsoft.SPOT.EventSink::ProcessEvent [IP: 0023] ####
#### Microsoft.SPOT.EventSink::EventDispatchCallback [IP: 0014] ####
A first chance exception of type ‘System.NullReferenceException’ occurred in Microsoft.SPOT.TinyCore.dll
An unhandled exception of type ‘System.NullReferenceException’ occurred in Microsoft.SPOT.TinyCore.dll

The only way I have found to get back from the exception is to erase using the MFDeploy.exe tool. But still it will go the same way from the beginning with updating display firmware…

If no display is connected, it works fine.

I posted on this a few weeks ago on the display error thread and got a few tips. But now I have tested with the new framework so I started a new thread, hope that’s ok.


Can you step us through it so we can see if we can reproduce on our end?

The steps to reproduce for me is just to create a new project with button, camera and display. Running the debugger one time (get the update message for display) and then reset the debugger. Second time it will throw an exception.

Not sure what steps to include for you to reproduce. I’t seems to me that it is such a simple setup. I can give you a demo on teamviewer if that would help, in that case contact me on skype: johnkarbin

What if you have a project with display only?

We will try here but not sure if we will be able to repro!

You have Spider Kit right?

Yes, spider kit

Same thing with only the display connected.

Noticed that after the deploy and exception ping response is this:

Pinging… TinyCLR
#### Exception System.NullReferenceException - CLR_E_NULL_REFERENCE (3) ####

In the designer, do you have all 4 cables connected, including (T) for touch? And on your actual display, do you just have the 3 (R,G,B)?

All four connected. I tested with only 3, and that works! Nothing is visible on the display, but it does not throw exception when deploying.

Gus: All documentation i have found says that cable 4 needs to be connected. Is there any test program that I can run for the display?

You might try this.

No deployment problem with your project. Thanks!

Still there is something strange with the display. I can at some times get a few seconds of displaying the buttons (or the loading text), but then the screen goes black. If i hit the reset button, it will come visible for a second or so (with a white line across the middle display). I have tested quite a few different power supply’s and verified that i have the correct polarity. Any suggestions on where to go from here would be very much appreciated.


What are you using for power?

Last attempt was a 18.5V 3.5A (shredded a hp laptop adapter). Previous to that I have tested 12V 500mA, and a couple of others. 18.5 is the highest I have tested.

I am not sure.

Can you be more specific about what?
I have also tested with a separate usb-hub with and without external power. This error has me thinking that the hardware (display or something else in the fez kit) is broken.

I am not sure why or how this can be happening. It could be hardware but I still do not see what would cause sch symptoms.

Do you want to send me the kit so I can run few tests?

Well if that is the only option. I guess I will have no device for quite some time. Is it possible to send me a replacement kit so I can continue developing?

Please email/phone GHI directly.

Well, after a month of testing with no luck at all… I got the spider replaced, and now it all works right out of the box. At least I got to know my way around some of the debugging options :slight_smile:

So if you experience the problems above: RMA


I’m having the same problem following the almost same steps that John mentioned.

How can I get around this.

Follows the settings of my environment:


Fez Spider Mainboard 1.0
Button 1.4
Camera 1.1
Display T35 1.3
SDCard 1.4
USBClient DP 1.3 (Only Power Supply)
SanDisk MicroSDHC 4Gb class 2
SanDisk MicorSDHC Adapter

Fez Config:

Loader (TinyBooter) version information: on this computer. on this device

Firmware (TinyCLR) version information: on this computer. on this device.


MicroFrameworkSDK NETMF SDK 4.3 (RTM) for VS2012
MicroFrameworkSDK NETMF SDK 4.2 (RTM QFE2) for VS2010
GHI NETMF v4.2 and Gadgeteer Package 2013 R3

My screen is showing the following:

Version :
Debug : USB1
LCD : 320X240

But soon after starting Degug an error is shown :

# # # Exception System.NullReferenceException - CLR_E_NULL_REFERENCE (4) # # #

# # # Message :

# # # Microsoft.SPOT.Application :: OnEvent [ IP : 0090 ] # # #

# # # Microsoft.SPOT.EventSink :: ProcessEvent [ IP : 0023 ] # # #

# # # Microsoft.SPOT.EventSink :: EventDispatchCallback [ IP : 0014 ] # # #

A first chance exception of type ’ System.NullReferenceException’ occurred in Microsoft.SPOT.TinyCore.dll
An unhandled exception of type ’ System.NullReferenceException’ occurred in Microsoft.SPOT.TinyCore.dll

This is the beginning of the debug output :

[em]Found debugger !

Create TS .

A0e00000 loading at start , end a0e1383c

Assembly: mscorlib ( ) Assembly: Microsoft.SPOT.Native ( ) Assembly: Microsoft.SPOT.Security.PKCS11 ( 4.2
.0.0 ) Assembly: System.Security ( ) Loading Deployment Assemblies .

Attaching file deployed .
Assembly: Microsoft.SPOT.IO ( ) Attaching deployed file .
Assembly: GHI.Premium.IO ( ) Attaching deployed file .
Assembly: Microsoft.SPOT.Graphics ( ) Attaching deployed file .
Assembly: GHI.Premium.SQLite ( ) Attaching deployed file .
Assembly: GTM.GHIElectronics.Camera ( ) Attaching deployed file .
Assembly: GHI.Premium.USBHost ( ) Attaching deployed file .
Assembly: GTM.GHIElectronics.SDCard ( ) Attaching deployed file .
Assembly: Microsoft.SPOT.Hardware ( ) Attaching deployed file .
Assembly: GHI.Premium.System ( ) Attaching deployed file .
Assembly: GTM.GHIElectronics.Display_T35 ( ) Attaching deployed file .
Assembly: Microsoft.SPOT.Touch ( ) Attaching deployed file .
Assembly: GTM.GHIElectronics.UsbClientDP ( ) Attaching deployed file .
Assembly: Gadgeteer ( ) Attaching deployed file .
Assembly: GTM.GHIElectronics.Button ( ) Attaching deployed file .
Assembly: GadgeteerApp2 ( ) Attaching deployed file .
Assembly: System.IO ( ) Attaching deployed file .
Assembly: Microsoft.SPOT.TinyCore ( ) Attaching deployed file .
Assembly: Microsoft.SPOT.Net ( ) Attaching deployed file .
Assembly: GHI.Premium.Hardware ( ) Attaching deployed file .
Assembly: Microsoft.SPOT.Hardware.PWM ( ) Attaching deployed file .
Assembly: GHIElectronics.Gadgeteer.FEZSpider ( ) Resolving .

GC : 1msec 33684 bytes used , 7305984 bytes available[/em]

Attached is a picture of my setup.

Thank you,
Andrew Paes