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

Software Reboot

reboot

  • Please log in to reply
4 replies to this topic

#1 jaz

jaz

    New Member

  • Members
  • Pip
  • 3 posts

Posted 26 March 2013 - 05:53 PM

Hello,

 

I have a netduino plus, and am using PowerState.RebootDevice(false) to reboot the netduino in the event of otherwise-uncaught exceptions. The netduino was not resuming code execution after the reboot, so I wrote the simplest code I can think of:

 

while (true) {

 

Debug.Print("First");

PowerState.RebootDevice(false);

Debug.Print("Last")

 

}

 

...And only the first debug statement executes, ie. the debugger prints "First", the netduino reboots, and the execution of the code does not continue. Any ideas?



#2 JerseyTechGuy

JerseyTechGuy

    Advanced Member

  • Members
  • PipPipPip
  • 870 posts

Posted 26 March 2013 - 08:12 PM

Do you mean it doesn't continue and run the "Last" Debug.Print? or the code does not run again from the beginning.



#3 jaz

jaz

    New Member

  • Members
  • Pip
  • 3 posts

Posted 27 March 2013 - 08:16 PM

It does not continue and run the "Last" Debug.Print. I realized after I posted this that my question would be the same without the while loop; ie. for the code below, "Last" is never printed:

 

Debug.Print("First");

PowerState.RebootDevice(false);

Debug.Print("Last")



#4 JerseyTechGuy

JerseyTechGuy

    Advanced Member

  • Members
  • PipPipPip
  • 870 posts

Posted 27 March 2013 - 09:03 PM

Ok, just wanted to understand. Thank you for the clarification.

 

The code after the reboot command should never get hit because you have issued a hard reboot command.  Once that is issued the hardware immediately begins the reboot and the code will run from the beginning.

 

The only way I believe the line after the reboot would run is when doing a soft reboot (True instead of False) but I don't believe soft reboot is supported for the Netduino.

 

If anyone understands this differently please correct me, but this is the way I understand and observe the RebootDevice to work.



#5 jaz

jaz

    New Member

  • Members
  • Pip
  • 3 posts

Posted 27 March 2013 - 10:14 PM

Thank you!

 

After some further testing, it seems that the debugger itself hangs up the reboot of the device, so that the code above (when run in Debug mode) prints "First" only once instead of restarting at the top of main() after every reboot cycle. Deploying the code to the netduino fixes this problem, and then the netduino behaves as you suggested.







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.