problem with WatchDog or RebootDevice(int exeConstraintTimeout) #1078
-
Was looking how to implement hardware level watchdog to the system. Most suitable function what I found is Where Does anybody use any hardware watchdog? |
Beta Was this translation helpful? Give feedback.
Replies: 9 comments 6 replies
-
If I'm no t mistaken, hardware watchdog it's enable as default for all platforms... As for the call to RebootDevice the parameter is not supposed to be a delay, rather a timeout for any pending event handler to complete before the timeout expires. |
Beta Was this translation helpful? Give feedback.
-
Hardware watchdog it's already being managed, started and feed. That ensures that the watchdog will do it's thing, if needed. |
Beta Was this translation helpful? Give feedback.
-
I have application that doing some action on timer or other events. I can make another timer and event that will check if main timer is alive. But what if both of them will disappear. Then I start to investigate if there is any memory leakage or something... but didn't find anything with GC.Run(false) - it always shows >68KB free So first idea that came it would be good to have hardware watchdog under control. PS: |
Beta Was this translation helpful? Give feedback.
-
@lsd-techno calling GC.Run puts pressure on the GC and eats a lot pf CPU cycles. Calling it very often can be counter productive... |
Beta Was this translation helpful? Give feedback.
-
@josesimoes I suspect guru meditation was coming from HttpListener thread (it is running on its own now and my "scheduler" timer not checking if it is alive). I've add software flush emulation for serial ports too - simple read out data from serial port in parts to save RAM until there is data if I see there is more data than it is suppose to be. And try to check every place where I could find anything uncertain. So flush buffers for serial ports might be good idea to implement too. For today test I din't have any guru meditation yet... even though deploy insrease few 1~2 KB and free RAM in GC shows less 1 KB. |
Beta Was this translation helpful? Give feedback.
-
Fell free to call it at the rate you feel like, the API it's there to be used. |
Beta Was this translation helpful? Give feedback.
-
Regarding the serial port flush: are you referring to the C# SerialPort class or to the native UART(s)? |
Beta Was this translation helpful? Give feedback.
-
Yes, GC is not for regular use - with that I was trying to get any idea from where to start to look for the problem. Regarding serial port: I'm using System.IO.Ports.SerialPort class to control ESP32 UARTs in my test project. It is working in interrupt mode. Some moment I found that sometimes because of different hardware issues I may receive "noise" from UARTs when ESP32 device reboots or when UART targets reboots. So I want to flush received data that I don't want to process.
last |
Beta Was this translation helpful? Give feedback.
-
With last application changes and latest firmware 1.8.0.313 and latest nuget updates firmware become much more stable. |
Beta Was this translation helpful? Give feedback.
Hardware watchdog it's already being managed, started and feed. That ensures that the watchdog will do it's thing, if needed.
It's not exposed to managed code on purpose. Like other things typical from embedded systems world.
C# developers don't need to worry with the watchdog, just like one doesn't have to when coding a C# app for desktop.