Software reset
#1
Posted 09 October 2010 - 03:31 AM
#2
Posted 09 October 2010 - 03:36 AM
#3
Posted 09 October 2010 - 03:47 AM
Hi Dustin,
Thanks for the post, and welcome to the community!
We could create a software reset feature. Would other users like that feature as well?
Also, you can wire a switch to the /RESET pin header if you'd like an easy way to reset the Netduino. It will still act as a reset--even if the onboard pushbutton is repurposed as a GPIO.
Chris
It's a neat idea... I guess there is no reason why not to have it. Yeah I would like that feature as well
#4
Posted 09 October 2010 - 10:28 AM
Is there a way to programmatically reset the Netduino? I am repurposing the onboard switch, but I want to trigger a reset if the switch has been held down for an extended period of time.
Thanks,
Dustin
You could just wire the reset header to a digital pin and hold it high and bring it low to reset it. Or the other way round, my aging memory...
Software reset would be nice.
Take a seat, I'll be right with you.
#5
Posted 09 October 2010 - 02:24 PM
You could just wire the reset header to a digital pin and hold it high and bring it low to reset it. Or the other way round, my aging memory...
Now that Crispin mentions that...
Dustin, for this particular application you want to reset the device after holding the pushbutton for a certain period of time correct? Well, if you simply dispose of your switch's InputPort after that amount of time, the pushbutton will become a reset button again The blue user LED would turn on to let the user know that the board is being reset and when they let go the board will restart...
Chris
#6
Posted 09 October 2010 - 03:13 PM
Now that Crispin mentions that...
Dustin, for this particular application you want to reset the device after holding the pushbutton for a certain period of time correct? Well, if you simply dispose of your switch's InputPort after that amount of time, the pushbutton will become a reset button again The blue user LED would turn on to let the user know that the board is being reset and when they let go the board will restart...
Chris
Thanks Chris. That is a great idea and sounds like it will work exactly as I want it to.
Thanks to everyone for the other great suggestions as well.
Dustin
#7
Posted 19 January 2011 - 12:07 AM
Dustin, for this particular application you want to reset the device after holding the pushbutton for a certain period of time correct? Well, if you simply dispose of your switch's InputPort after that amount of time, the pushbutton will become a reset button again The blue user LED would turn on to let the user know that the board is being reset and when they let go the board will restart...
I just got my ND+ today and decided to play a bit with it. Tested this among other things and this does not seem to work. I initialize the switch as an InterruptPort though, if that makes a difference? When I dispose it, I stop getting events, but the switch won't funciton as a reset switch. Any ideas?
Miha
#8
Posted 19 January 2011 - 01:29 AM
I just got my ND+ today and decided to play a bit with it. Tested this among other things and this does not seem to work. I initialize the switch as an InterruptPort though, if that makes a difference? When I dispose it, I stop getting events, but the switch won't funciton as a reset switch. Any ideas?
Hi Miha,
If you erase your current Netduino app (using MFDeploy), does pressing the pushbutton reset your device?
Chris
#9
Posted 19 January 2011 - 02:56 AM
#10
Posted 19 January 2011 - 12:42 PM
#11
Posted 19 January 2011 - 08:52 PM
If you erase your current Netduino app (using MFDeploy), does pressing the pushbutton reset your device?
I don't know how to erase an app? Couldn't find anything in MFDeploy that would led me to undeploying the app. I did however change the program to not use the switch 1 and it of course works when it is not used by the program itself. As I mentioned, I'm using the onboard switch via InterruptPort class.
Use the watchdog service in Microsoft.SPOT.Hardware.
http://msdn.microsof...y/ee436617.aspx
This sounds interesting, but unfortunately, it does not work.
When looking at it via debugger, the property Enabled is false after I set it to true. I tried HardReboot, SoftRebutt, DebugBreak_Native behaviours. I set the Timeout to 100 * TimeSpan.TicksPerMillisecond. Then I set it to
TimeSpan.FromTicks(1 * TimeSpan.TicksPerSecond);What is strange is that if I check the Timeout property in the debugger, it says 00:00:00.
On a related note, the ND would freeze every once in a while (~ every 5 deploys) and I have to unplug it and plug it back.
Miha
#12
Posted 20 January 2011 - 07:10 AM
TimeSpan ts = new TimeSpan(0, 0, 0, 0, 1);
Will create a 1ms timespan faster (object creation time wise) than your call above.
Fred,
What you actually want is to use the watchdog how it's intended - rather than just arbitrarily rebooting your device - wait until it locks up and then reboot it. Simply create a timer that executes once ever 5 seconds or so which resets the watchdog timer, and set the watchdog to 5.5-6s. If it doesn't get reset - the watchdog "expires" and restarts the device.
#13
Posted 20 January 2011 - 08:17 AM
I've only used the watchdog on FEZ/GHI products. I assumed it was implemented on the NetDuino.
Could someone confirm this or maybe I am using it in the wrong way?
Miha
#14
Posted 20 January 2011 - 08:26 AM
#15
Posted 20 January 2011 - 01:55 PM
Watchdog is not implemented in the Atmel drivers for the .NET MF microcontroller, but we could certainly add it. It would need to be in v4.1.2+ though, as v4.1.1 is moving into feature complete status.
Would this be very useful for your projects? We've been thinking of adding it to another .NET MF chip support package for another project here at Secret Labs.
This would certainly be very useful. What is the current workaround? Can I connect digital pin (ie 13) to reset perhaps and just set the pin output to true? Do I need a resistor in between?
How does the reset pin function, exactly? Does it need 3.3V or does it need connection to ground for it to reset the ND?
Miha
#16
Posted 20 January 2011 - 03:01 PM
Please excuse my ignorance, but regarding the software reset wouldn't it be easier just to implement PowerState.RebootDevice(...) methods (if it is not working already)? Watchdog may be useful too, but I have seen in the source code that it is being used by the CRL runtime itself, so it may not be guaranteed to work as expected (e.g. one enables/disables watchdog in user code and the runtime disables/enables it back during its internal (scheduling) operations).Watchdog is not implemented in the Atmel drivers for the .NET MF microcontroller, but we could certainly add it.
#17
Posted 20 January 2011 - 03:03 PM
Hi Miha,
Watchdog is not implemented in the Atmel drivers for the .NET MF microcontroller, but we could certainly add it. It would need to be in v4.1.2+ though, as v4.1.1 is moving into feature complete status.
Would this be very useful for your projects? We've been thinking of adding it to another .NET MF chip support package for another project here at Secret Labs.
Chris
Chris, Plus 1 for this feature.A watchdog timer is critical for lots of applications.
#18
Posted 21 January 2011 - 08:45 AM
#19
Posted 21 January 2011 - 06:53 PM
Please excuse my ignorance, but regarding the software reset wouldn't it be easier just to implement PowerState.RebootDevice(...) methods (if it is not working already)? Watchdog may be useful too, but I have seen in the source code that it is being used by the CRL runtime itself, so it may not be guaranteed to work as expected (e.g. one enables/disables watchdog in user code and the runtime disables/enables it back during its internal (scheduling) operations).
In order to call "PowerState.RebootDevice(True, 500);" your code must be in an operation state. The purpose of having a watchdog on a embedded device is that way if you have an unrecoverable error, some code hangs the device, or you just plain run out of memory, it will reset it's self. At this stage many of you (myself included) are just using these devices at home in "controled" conditions where we can rest them at will. However, if you wanted to build a device like Fred or Dayland (for home automation) then this type of feature would be critical.
Chris,
In my opinion - if / when you guys implement this you should only be able to set the watchdog timeout length, not enable or disable it from managed code. Default it to say 10,000ms (10 second of system hang or unresponsiveness). Then if someone does not want to use it they can set the timeout to DateTime.MaxValue or uint.MaxValue. in addition you need a way of telling the manage environment that this has happened. Like something as part of SecretLabs.NETMF.Hardware, a class called Watchdog and then Timeout (int or DateTime.Timespan) and ResetCount (read only int)
Thoughts?
- Jarrod
http://jarrodsinclair.wordpress.com//
#20
Posted 21 January 2011 - 07:05 PM
I was proposing a solution to the original request, which is "but I want to trigger a reset if the switch has been held down for an extended period of time." - to handle a switch interrupt, the code is supposed to be in operational state.In order to call "PowerState.RebootDevice(True, 500);" your code must be in an operation state.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users