watchdog timer #5331
Replies: 1 comment
-
Posted at 2014-03-10 by ltj Absolutely. According to the datasheet the STM32F103x family of mcu's have 2 watchdog timers. You control them via registers, and you can write register data using the poke8/16/32 functions. Do be careful however. The watchdog counter needs to be reset at your discretion. ie. if you have a program that just sits and wait for an external interrupt (say, a PIR motion sensor), and nothing happens for a while. Then you need to make sure that you counter reset takes place in a setInterval(). You can see all the register documentaion and much more in the ST reference manual found here. Posted at 2014-03-10 by ltj Just thinking aloud here....it's most likely much better to implement this in a library and have the event loop reset the counter? Posted at 2014-03-10 by @gfwilliams It's a good idea - It could definitely be handled by peek/poke/setInterval Ideally it'd just be done in the interpreter though - I've added an issue for it in GitHub: espruino/Espruino#252 I doubt it would be enabled by default, but it'd be a good thing to allow people to turn it on when they wanted to make sure Espruino kept going... Posted at 2014-03-10 by hansamann sounds very cool. let me know when this is ready for testing and I'll try it out as soon as I can. Posted at 2014-03-11 by @gfwilliams It'll be in 1v56 - Posted at 2016-05-17 by ceremcem Can we manually handle resetting watchdog instead of Espruino's main loop? I want to reset the watchdog manually in order to trigger some action that can only be performed upon boot process. My application may response and give control to Espruino's main loop, but that is not sufficient for my purpose. Instead, it should be reset via a data from a socket connection. Posted at 2016-05-17 by @gfwilliams You can't do that at the moment. It'd be a good addition though - I've just added in issue for it: espruino/Espruino#859 However, I guess you're expecting to use this on the ESP8266? I'm afraid the watchdog isn't implemented for that. Posted at 2016-05-19 by ceremcem Yes, I would use it on ESP8266. You don't mean it's not implemented by hardware, do you? Posted at 2016-05-20 by @gfwilliams I mean it's not implemented in the ESP8266's code at the moment. I know there's a 1 sec watchdog that is added by the OS - but if that's the only one available then you may not be able to use it from Espruino even if it were implemented Posted at 2016-05-20 by ceremcem Then we have only a separate hardware watchdog IC option for our own purposes (separate from Espruino's main loop)? Posted at 2016-05-20 by DrAzzy Assuming that the OS watchdog is not suitable, that may be the case? You might to better interrogating the people who are focused on ESP8266, though. Try asking on gitter maybe? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Posted at 2014-03-09 by hansamann
Does espruino have a watchdog timer similar to the arduino? If the device is stalled, it would reset the espruino.
Beta Was this translation helpful? Give feedback.
All reactions