Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.
Photo

NP2 reboots on deploy; never debugs/runs app


  • Please log in to reply
23 replies to this topic

#1 jmorrisosu

jmorrisosu

    New Member

  • Members
  • Pip
  • 1 posts

Posted 24 February 2013 - 04:27 PM

Hey everyone,

 

I found one similar topic here: http://forums.netdui...tate-rebooting/ but it was over a year old and with no resolution.

 

I bought a netduino plus 2 yesterday after tinkering with a netduino and wanting to try my hand at using the built on LAN port.  Unfortunately I've spent the last 24 hours without a successful deployment as when I deploy from VS2010, I get the "target is not in an initialized state; rebooting" message in VS, and then once my device reboots, VS seems to lose attachment from the process(debugging has stopped) and my device is also not running the program.

 

Has anyone found a resolution to this?  I can successfully deploy to the Netduino, and have tried flashing the firmware to 4.2.2.

 

Here is my program(and I've tried adding Thread.Sleep() many additional places and tried a few other variations using netduinioplus dlls and namespaces)[namespace and program name omitted for brevity]

 

using System;
using System.Threading;
using Microsoft.SPOT;
using Microsoft.SPOT.Hardware;
using SecretLabs.NETMF.Hardware;
using SecretLabs.NETMF.Hardware.Netduino;

  public static void Main()
  {
  // write your code here
  OutputPort led = new OutputPort(Pins.ONBOARD_LED, false);
  bool State = false;

  while (true)
  {
  led.Write(State);
  State = !State;
  Thread.Sleep(2000);
  }

  }

Here is the output from my NP2 in MFDeploy:

 

HalSystemInfo.halVersion: 4.2.0.0
HalSystemInfo.halVendorInfo:   Netduino Plus 2 (v4.2.2.2) by Secret Labs LLC
HalSystemInfo.oemCode:   34
HalSystemInfo.modelCode:   177
HalSystemInfo.skuCode:   4102
HalSystemInfo.moduleSerialNumber: 00000000000000000000000000000000
HalSystemInfo.systemSerialNumber: 0000000000000000
ClrInfo.clrVersion: 4.2.0.0
ClrInfo.clrVendorInfo:   Netduino Plus 2 (v4.2.2.2) by Secret Labs LLC
ClrInfo.targetFrameworkVersion: 4.2.0.0
SolutionReleaseInfo.solutionVersion:   4.2.2.2
SolutionReleaseInfo.solutionVendorInfo: Netduino Plus 2 (v4.2.2.2) by Secret Labs LLC
SoftwareVersion.BuildDate:   Jan 26 2013
SoftwareVersion.CompilerVersion:   410894
FloatingPoint:   True
SourceLevelDebugging: True
ThreadCreateEx: True
LCD.Width:   0
LCD.Height: 0
LCD.BitsPerPixel: 0
AppDomains: True
ExceptionFilters: True
IncrementalDeployment:   True
SoftReboot: False
Profiling:   False
ProfilingAllocations: False
ProfilingCalls: False
IsUnknown:   False

 

Any Ideas?

 

Thanks in advance

 

Jessie



#2 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 24 February 2013 - 11:22 PM

Hi Jessie, What operating system are you using? Also...Visual Studio 2010 or 2012? In a virtual machine? If you press the pushbutton on your Netduino while it's rebooting, can Visual Studio connect? Chris

#3 mHammer

mHammer

    Member

  • Members
  • PipPip
  • 23 posts

Posted 27 February 2013 - 06:48 AM

I actually have the exact same problem. I can deploy code and run it on the netduino. But when I try to run debugger, it hangs. Is there a setting that I need to set? I am running win 7 with vs 2010. I followed the install order on the downloads section. Any suggestions?

#4 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 27 February 2013 - 09:33 AM

Hi mhzpower, When you deploy code, how are you doing that? Pressing the "play" button in Visual Studio? When you do...does the app start running but Visual Studio gives up? Chris

#5 JerseyTechGuy

JerseyTechGuy

    Advanced Member

  • Members
  • PipPipPip
  • 870 posts

Posted 27 February 2013 - 12:37 PM

I am suddenly having a similar issue with a second Netduino Plus 2.  I updated the board to 4.2.2.2.  When I deploy it works fine.  When I press Play and it tries to deploy and Visual Studio Shuts down and the ND+2 either reboots or hangs. I am running VS2010 on Win7 with 4.2 NETMF.



#6 AxelG

AxelG

    Advanced Member

  • Members
  • PipPipPip
  • 52 posts

Posted 27 February 2013 - 01:21 PM

Same here.  I am running VMWare virtual machine Win7 with 4.2 NETMF and a ND2+ on 4.2.2.2. and VS 2010.   For some reason Windows wants to install and use MFUSB drivers not the WINUSB drivers.

 

When the ND locks up and I unplug it, my VM shuts down.  (nice feature!)

 

If I force WINUSB drivers, I can't see the ND on the USB bus and VS usually hangs up on deploy.

 

I have un-installed and re-installed both NETMF as well as Drivers without any effect.

 

My ND/MD+ will sometimes hang on deploy, but unplugging and plugging back in usually solves the problem.

 

Any additional ideas on troubleshooting would be great.



#7 mHammer

mHammer

    Member

  • Members
  • PipPip
  • 23 posts

Posted 28 February 2013 - 05:16 AM

Chris,

When I deploy an app I will right click on the solution in the explorer and select build...once it builds, I will right click and select deploy.

 

I can get the apps to deploy.

 

However if I press F5 "debug" it will build then the ND2+ will reset like other have seen.  It will be running the new app.  But VS2010 will not actually enter debug mode.



#8 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 28 February 2013 - 06:08 AM

Hi AxelG,

Same here.  I am running VMWare virtual machine Win7 with 4.2 NETMF and a ND2+ on 4.2.2.2. and VS 2010.   For some reason Windows wants to install and use MFUSB drivers not the WINUSB drivers. When the ND locks up and I unplug it, my VM shuts down. (nice feature!) If I force WINUSB drivers, I can't see the ND on the USB bus and VS usually hangs up on deploy. I have un-installed and re-installed both NETMF as well as Drivers without any effect.

The gen2 Netduinos use the MFUSB drivers, rather than the WinUSB drivers. There have been reports of issues with the WinUSB drivers and USB 3.0 ports...so while that bug is getting squashed we haven't switched the gen2 hardware to WinUSB. [For gen1 hardware, .NET MF 4.2 necessitated the move to WinUSB--because of the USB hardware architecture.]

My ND/MD+ will sometimes hang on deploy, but unplugging and plugging back in usually solves the problem. Any additional ideas on troubleshooting would be great.

If Visual Studio has trouble deploying, press the Netduino's onboard board to reset the board. If that doesn't work, disconnect and reconnect and Visual Studio should find it (as you experienced previously). [And if you can find a simple repro where the pushbutton doesn't reset the board...please let us know, as there are things we can do to make the software-based reset even more resilient.] Chris

#9 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 28 February 2013 - 06:10 AM

I am suddenly having a similar issue with a second Netduino Plus 2.  I updated the board to 4.2.2.2.  When I deploy it works fine.  When I press Play and it tries to deploy and Visual Studio Shuts down and the ND+2 either reboots or hangs. I am running VS2010 on Win7 with 4.2 NETMF.

If you restart Visual Studio, are you able to deploy and debug? If you can get Visual Studio to consistently crash (rather than every once in a while), we'd love to image the board and see if we can reproduce that here. Also...VS2012 and the .NET MF 4.3 SDK have a bunch of improvements in this area. More informative debug connection data and resiliency was one of the NETMF team's goals for the new release. Chris

#10 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 28 February 2013 - 06:11 AM

Hi mhzpower,

However if I press F5 "debug" it will build then the ND2+ will reset like other have seen.  It will be running the new app.  But VS2010 will not actually enter debug mode.

Can you try something really quickly? Erase your current app via MFDeploy. Then press F5 and see if Visual Studio can deploy and attach the debugger. If that fails, close Visual Studio and try to connect to the debugger (read-only) via MFDeploy "connect to device." Then ping the device a few times, and see if your Debug.Print statements appear in the MFDeploy window. Chris

#11 mHammer

mHammer

    Member

  • Members
  • PipPip
  • 23 posts

Posted 28 February 2013 - 06:44 AM

MFDeploy did erase the app.  Going back to VS the app would not deploy and the debug would not start.

 

I also saw that I loose the USB device and the blue onboard LED turns on solid.  At this point I can't do anything but unplug it and restart it.

 

I did update it to 4.2.2.2, which was by the instructions and did seem successful.

 

If it matters, the app I have is a simple multi thread blink light example with a couple digital outputs and the onboard LED.

 

Could this be a driver issue?



#12 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 28 February 2013 - 07:27 AM

Hi mhzpower, It really does sound like a driver issue. Can you connect to the board via MFDeploy? And see the output of Debug.Print statements? Chris

#13 mHammer

mHammer

    Member

  • Members
  • PipPip
  • 23 posts

Posted 28 February 2013 - 05:37 PM

Sorry not at my ND2+, but Yes I was able to reboot the ND and connect with MFDeploy.  Once I connected, the debug lines printed to the display.

 

Could it be that the example I was using caused the ND to lock up and not respond to the VS?

I was using the example: http://ghadzhigeorgi...amework-part-1/.

 

I will try tonight to flush the drivers out and reinstall everything.

 

Sorry for the newb questions, it's been 8 years since I've touched a compiler.  But it's coming back B)



#14 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 28 February 2013 - 11:26 PM

Hi mhzpower, Yes, please try deploying an app which just blinks the LED...to see if Visual Studio can reconnect properly from your setup. Chris

#15 mHammer

mHammer

    Member

  • Members
  • PipPip
  • 23 posts

Posted 01 March 2013 - 05:51 AM

I completely uninstalled everything and installed C# and .NET SDK and ND SDK in the right order.  

 

This is my app...blink only:

 

            OutputPort led = new OutputPort(Pins.ONBOARD_LED, false);
            while (true)
            {
                led.Write(true);
                Thread.Sleep(200);
                led.Write(false);
                Thread.Sleep(200);
            }
 
First time plugging the ND in, I can deploy the app.  But the ND does not start running the app.
 
I can deploy a second time successfully, but the app does not start running.  (blue light on steady)
 
To start the app I have to push the button (reset?) or unplug and plug the ND.
 
After that I can not deploy.
 
In the device manager, when I cannot deploy, the Netduino device says "This device cannot start. (Code 10)"  When I re-plug the ND in, I get a properly working device.
 
I am showing device driver date 10/04/2012, ver 4.2.0.0.
 
Is something wrong with my setup?


#16 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 01 March 2013 - 07:05 AM

Hi mhzpower, What version and edition of Windows are you running? This is on a PC correct, and not on a virtual machine? The Device Manager error is really curious. It seems like your USB controller is unhappy with the device after re-enumeration (without disconnect/reconnect). Have you tried this on any other computers? Chris

#17 mHammer

mHammer

    Member

  • Members
  • PipPip
  • 23 posts

Posted 01 March 2013 - 07:16 AM

While waiting for your post, I kept trying to get it to work and tried both MFUSB and WINUSB drivers you posted on another thread.  It didn't work.

 

I found by default the MFUSB drivers are installed.

 

So I decided to try it on another computer.  It automatically installed the MFUSB drivers.  On this computer I could deploy and debug with no problems and the Netduino device never stopped working.

 

Therefore I think you're right.  Something (usb controller??) is not happy with the drivers.  Also when I tried the WINUSB driver like AxelG above I get the same results.

 

 

Would you think that this has something to do with USB 3.0 usb controllers?

 

P.s Thanks for your help and patience Chris.  B)



#18 AxelG

AxelG

    Advanced Member

  • Members
  • PipPipPip
  • 52 posts

Posted 01 March 2013 - 03:02 PM

Hi AxelG,The gen2 Netduinos use the MFUSB drivers, rather than the WinUSB drivers. There have been reports of issues with the WinUSB drivers and USB 3.0 ports...so while that bug is getting squashed we haven't switched the gen2 hardware to WinUSB. [For gen1 hardware, .NET MF 4.2 necessitated the move to WinUSB--because of the USB hardware architecture.]If Visual Studio has trouble deploying, press the Netduino's onboard board to reset the board. If that doesn't work, disconnect and reconnect and Visual Studio should find it (as you experienced previously). [And if you can find a simple repro where the pushbutton doesn't reset the board...please let us know, as there are things we can do to make the software-based reset even more resilient.] Chris

Thanks for the response Chris, and after re-installing I did notice the gen2 uses the older drivers.  I did notice less frequent hangs when I don't have gen1 and gen2 NDs plugged in at the same time.  However, when it does hang: hitting the reset button does the same as unplugging, my entire VM shuts down or get BSOD.



#19 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 05 March 2013 - 08:03 AM

However, when it does hang: hitting the reset button does the same as unplugging, my entire VM shuts down or get BSOD.

Yeah, that's the reason that Microsoft moved NETMF to the WinUSB drivers. In certain configurations, and certain circumstances when things went wrong, detaching or rebooting the USB connection would cause a BSOD. With gen1 boards, we're a little bit stuck since we can't re-enumerate USB on the fly (from a hardware perspective). But as we move the gen2 boards to WinUSB...we'll be able to look at various VMs to see if there are things we can do with NETMF to enhance the experience. Chris

#20 AxelG

AxelG

    Advanced Member

  • Members
  • PipPipPip
  • 52 posts

Posted 05 March 2013 - 02:34 PM

Thanks, I saw your reply in the other thread.  I decided to spin up a separate VM for gen2 development work.  I'll suck it up until WinUSB drivers are available for gen 2  :)   (No pressure....)

 

Honestly, thanks for all you do in support of this platform.  It's really appreciated.






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.