As I prefer VB, I've installed:
Microsoft .Net Micro Framework SDK 4.2 (RTM)
Netduino SDK v4.2.0 (June 2011 Beta)
The OS is Windows 7 x64, Dev Env: Visual Studio 2010 Ultimate
I've created a new Micro Framework netduino application which contains the following 2 files:
Main.vb
Imports Microsoft.SPOT Imports Microsoft.SPOT.Hardware Imports SecretLabs.NETMF.Hardware Imports SecretLabs.NETMF.Hardware.Netduino Module Main Sub Main() Thread.Sleep(1000) Led0.Write(True) ''<<< Breakpoint Here Dim Value = 0.0 End Sub End Module
HardwareMappings.vb
Imports Microsoft.SPOT Imports Microsoft.SPOT.Hardware Imports SecretLabs.NETMF.Hardware Imports SecretLabs.NETMF.Hardware.Netduino Module HardwareMapping Public Led0 As OutputPort = New OutputPort(Pins.GPIO_PIN_D11, False) Public Led1 As OutputPort = New OutputPort(Pins.GPIO_PIN_D4, False) Public Led2 As OutputPort = New OutputPort(Pins.GPIO_PIN_D13, False) Public Led3 As OutputPort = New OutputPort(Pins.GPIO_PIN_D3, False) Public LedR As OutputPort = New OutputPort(Pins.GPIO_PIN_D5, False) Public LedG As OutputPort = New OutputPort(Pins.GPIO_PIN_D6, False) Public LedB As OutputPort = New OutputPort(Pins.GPIO_PIN_D10, False) End Module
I can run the app and it will turn on/off the LEDs as desired (I'm using this shield: http://ruggedcircuit...AS010/as010.pdf which provides a number of LEDs and Pots as well as some other things to test).
If I add a breakpoint or pause execution at any point, Visual Studio throws a fatal exception:
The problem signature in the "VS has crashed" Dialog is as follows:
Problem signature: Problem Event Name: APPCRASH Application Name: devenv.exe Application Version: 10.0.40219.1 Application Timestamp: 4d5f2a73 Fault Module Name: vbdebug.dll Fault Module Version: 10.0.40219.1 Fault Module Timestamp: 4d5f2fc9 Exception Code: c0000005 Exception Offset: 000a0ceb OS Version: 6.1.7601.2.1.0.256.1 Locale ID: 2057 Additional information about the problem: LCID: 1033 Read our privacy statement online: http://go.microsoft.com/fwlink/?linkid=104288&clcid=0x0409 If the online privacy statement is not available, please read our privacy statement offline: C:\Windows\system32\en-US\erofflps.txt
If I debug VS itself, I get (in the "choose debugger dialog"):
An unhandled win32 exception occured in devenv.exe [121988].
After opening a new instance of VS as a debugger, I'm told:
Unhandled exception at 0x77d515ee in devenv.exe: 0xC0000005: Access violation reading location 0x00000000
Disassembly is as follows:
ntdll.dll!77d515ee() 77D515AD mov ecx,0Ah 77D515B2 lea edx,[esp+4] 77D515B6 call dword ptr fs:[0C0h] 77D515BD add esp,4 77D515C0 ret 0Ch 77D515C3 nop 77D515C4 mov eax,12Eh 77D515C9 xor ecx,ecx 77D515CB lea edx,[esp+4] 77D515CF call dword ptr fs:[0C0h] 77D515D6 add esp,4 77D515D9 ret 18h 77D515DC mov eax,12Fh 77D515E1 xor ecx,ecx 77D515E3 lea edx,[esp+4] 77D515E7 call dword ptr fs:[0C0h] 77D515EE add esp,4 <<<<<<<< EXCEPTION HERE <<<<<<<< 77D515F1 ret 0Ch 77D515F4 mov eax,130h 77D515F9 xor ecx,ecx 77D515FB lea edx,[esp+4] 77D515FF call dword ptr fs:[0C0h] 77D51606 add esp,4 77D51609 ret 18h 77D5160C mov eax,131h 77D51611 xor ecx,ecx 77D51613 lea edx,[esp+4] 77D51617 call dword ptr fs:[0C0h] 77D5161E add esp,4 77D51621 ret 8 77D51624 mov eax,132h 77D51629 xor ecx,ecx 77D5162B lea edx,[esp+4] 77D5162F call dword ptr fs:[0C0h]
As it's been a while since I used the netduino and haven't ever used it on this PC, I'm not sure how to go about tracking down the problem especially using Beta drivers. Can someone please suggest a workaround / further places for investigation?
Many thanks
Edit: I've attached the project in question. I've also tried running the simple "Blinky" example which DOES allow debugging so it must be an issue with my very short code
Another Edit: It seems that the problem is caused if the variable for the LED is defined in a different file. To test, take the Blinky example, move the led definition to a different module with a Public scope and run it again. The app will still run but debugging fails.