How Long Should You Set Your Watchdog Timer

How Long Should You Set Your Watchdog Timer - Hallo gues welcome to my blog, you can read this article with title How Long Should You Set Your Watchdog Timer, Happy reading

IMPORTANT, MUST BE READ... : How Long Should You Set Your Watchdog Timer
Title : How Long Should You Set Your Watchdog Timer

Read More


How Long Should You Set Your Watchdog Timer

IMPORTANT, MUST BE READ...
Summary: You tin frequently purpose a watchdog effectively fifty-fifty if y'all don't know worst instance execution time. The to a greater extent than y'all know nigh arrangement timing, the tighter y'all tin gear upwardly the watchdog.



Sometimes at that spot is a province of affairs inward which a blueprint squad doesn't possess got resources to figure out a tight jump on worst instance execution fourth dimension for a system. Or peradventure they are worried nigh imitation alert watchdog trips due to infrequent situations inward which the software is running properly, but takes an unusually long fourth dimension to consummate a principal loop. Sometimes they gear upwardly the watchdog to the maximum possible fourth dimension (perhaps several seconds) to avoid imitation alert trips. And sometimes they simply gear upwardly it to the maximum possible value because they don't know what else to do.

In other words, or hence designers plow off the watchdog or gear upwardly it to the maximum possible setting because they don't possess got fourth dimension to exercise a detailed analysis.  But, almost always, y'all tin exercise a lot improve than that.

To instruct maximum watchdog effectiveness y'all desire to set a tight jump on worst instance execution fourth dimension amongst it. However, if your arrangement security strategy permits it, at that spot are simpler ways to compute watchdog menstruation past times analyzing the application instead of the software itself.  Below I'll locomote through or hence ways to gear upwardly the watchdog, going from the to a greater extent than complicated way to a simpler way.

Consider software that heats H2O inward an appliance. Just to brand the occupation concrete together with purpose slow numbers, lets nation that the command loop for heating executes every 100 msec, together with takes betwixt forty together with 75 msec to execute (worst instance deadening together with fast speeds).   Let's likewise nation that it uses a single-task principal loop scheduler without an RTOS hence nosotros don't possess got to worry nigh occupation start fourth dimension jitter.  How could nosotros gear upwardly the watchdog for this system? Ideally we'd similar the tightest possible timing, but at that spot may survive or hence slack because H2O takes a spell to estrus up, together with takes a spell to boil dry. How long should nosotros gear upwardly the watchdog timer for?

Classical Watchdog Setup

Classically, you'd desire to compute the worst instance execution fourth dimension make of the software (40-75 msec inward this case). Let's assume the watchdog boot happens equally the final pedagogy of each execution. Since the software only runs i time every 100 msec, together with hence the shortest fourth dimension betwixt kicks is when i wheel runs 75 msec, waits 25 msec, together with hence the  side past times side wheel runs faster, completing the computation together with kicking the watchdog inward only forty msec.    25+40=65 msec shortest fourth dimension betwixt kicks. In contrast, the longest fourth dimension betwixt kicks is when a brusk wheel of forty msec is followed past times threescore msec of waiting, together with hence a long wheel of 75 msec.  60+75=135 msec longest fourth dimension betwixt kicks. It helps a lot to sketch this out:


If you're setting a conventional watchdog timer, you'd desire to gear upwardly it at 135 msec (or the closest setting greater than that). If y'all possess got a windowed watchdog, you'd desire to gear upwardly the minimum setting at 65 msec, or the closest setting lower than that. 

Note that if your running an RTOS, the scheduling powerfulness guarantee that the occupation runs i time inward every 100 msec, but non when it starts inside that period. In that instance the worst instance shortest fourth dimension is the occupation running back-to-back at its shortest length = forty msec. The longest fourth dimension volition survive when a brusk occupation runs at the start of a period, together with the side past times side occupation completes correct at the halt of a period, giving threescore msec (idle fourth dimension at halt of period) + 100 msec (one to a greater extent than period) = 160 msec betwixt watchdog kicks. Thus, a windowed watchdog for this arrangement would possess got to permit a boot interval of forty to 160 msec.

Watchdog Approximate Setup

Sometimes designers desire a shortcut. It is commonly a error to gear upwardly the watchdog at precisely the menstruation because of timing jitter inward where the watchdog truly gets kicked. Instead, a handy dominion of pollex for non-critical applications (for which y'all don't desire to exercise the detailed analysis) is to gear upwardly the watchdog timer interval to twice the software execution period. For this example, you'd gear upwardly the watchdog timer to twice the menstruation of 100 msec = 200 msec.  There are a twain assumptions y'all demand to make: (1) the software e'er finishes earlier the halt of its period, together with (2) the effectiveness of the watchdog at this longer timeout volition survive skillful plenty to ensure adequate security for your system. (If y'all are edifice a security critical arrangement y'all demand to dig deeper on this point.) 

This simpler approach sacrifices or hence watchdog timer effectiveness for detecting faults that perturb arrangement timing compared to the theoretical jump of 135-160 msec. But it volition however grab a arrangement that is definitely hung without needing detailed timing analysis.

For a windowed watchdog the dominion of pollex is a niggling to a greater extent than difficult.  That is because, inward principle, your occupation powerfulness run the total length of i menstruation together with consummate straightaway on the side past times side period, giving effectively a zero-length minimum watchdog timer boot interval. If y'all tin constitute a lower jump on the minimum possible run fourth dimension of your task, y'all tin gear upwardly that equally an guess lower jump on watchdog timer kicks. If y'all don't know the minimum time, y'all likely can't purpose the lower jump of a windowed watchdog timer.

Application-Based Watchdog Setup

The previous approaches required knowing the run fourth dimension of the software. But, what exercise y'all exercise if y'all know nix nigh the run time, or possess got depression confidence inward your powerfulness to predict the worst instance bounds fifty-fifty afterwards extensive analysis together with testing?

An alternate way to approach this occupation is to skip the analysis of software timing together with instead recall nigh the application. Ask yourself, what is the longest menstruation for which the application tin withstand a hung CPU?  For example, for a counter-top appliance heating water, how long tin the heater survive left full-on due to hung software without causing a occupation such equally a fire, smoke, or equipment damage?  Probably it's quite a combat longer than 100 msec.  But it powerfulness non survive v or 10 seconds. And likely y'all don't desire to hazard melting a thermal fuse or a menage fume alert by  turning off the watchdog entirely.

As a practical matter, if the system's controls become unstable afterwards a sure amount of time, you'd improve brand your watchdog timer menstruation shorter than that length of time!

For the to a higher house example, the command menstruation is 100 msec. But, let's nation the arrangement tin withstand 500 msec of no command inputs without becoming uncrecoverable, hence long equally the command arrangement starts working i time to a greater extent than inside that fourth dimension together with it doesn't occur often. In this case, the watchdog timer must survive shorter than 500 msec at least. But at that spot is i other thing to consider. The arrangement likely takes a spell to reboot together with start running the command loop afterwards the watchdog timer trips. So nosotros demand to occupation organisation human relationship for that restart time. For this example, let's nation the fourth dimension betwixt a watchdog reset together with the fourth dimension the software starts controlling the arrangement by together with large ranges from seventy to 120 msec based on examine measurements.

Based on knowing the arrangement reset fourth dimension together with stability grace period, nosotros tin instruct an guess watchdog setting equally follows.  We possess got 500 msec of no-control grace period, minus 120 msec of worst instance restart time.  500-120 = 380 msec. Thus, for this arrangement the maximum permissible watchdog timer value is 380 msec to avoid losing command arrangement stability. Using this approach, the watchdog maximum menstruation should survive gear upwardly at the longest fourth dimension that is shorter than 380 msec. Without knowing to a greater extent than nigh software computation time, at that spot is non much nosotros tin nation nigh the minimum menstruation for a windowed watchdog.

Note that for this approach nosotros however demand to know something nigh the worst instance execution of the software inward instance y'all striking a long execution path afterwards the watchdog reset. However, it is frequently the instance that y'all know the longest fourth dimension that is probable to survive seen (e.g., via measuring a set out of runs) fifty-fifty if y'all don't know the details of the existent fourth dimension scheduling approach used.  And frequently y'all powerfulness survive willing to possess got the gamble that y'all won't striking an unlikely, fifty-fifty worse running fourth dimension correct afterwards a arrangement reset. For a non-safety critical application this powerfulness survive appropriate, together with is for certain improve than simply turning the watchdog off entirely.

Finally, it is frequently useful to combine the menstruation dominion of pollex amongst the command stability dominion of pollex (if y'all know the occupation execution period). You desire the watchdog gear upwardly shorter than the fourth dimension required to ensure command stability, but longer than the fourth dimension it truly takes to execute the software hence that it volition truly survive kicked frequently enough. For the to a higher house instance this agency setting the watchdog somewhere betwixt 2 periods together with the command stability fourth dimension limit, giving a make for the maximum watchdog bound of 200-380 msec. This tin survive gear upwardly without detailed software execution fourth dimension analysis beyond knowing the occupation menstruation together with the make of probable arrangement restart times.

Summary
If y'all know the maximum worst instance execution fourth dimension together with the minimum execution time, y'all should gear upwardly your watchdog equally tightly equally y'all can. If y'all don't know those values, but at to the lowest degree are confident you'll consummate execution inside your occupation period, together with hence y'all should gear upwardly the watchdog to twice the period. You should likewise jump the maximum watchdog timeout setting past times taking into occupation organisation human relationship how long the arrangement tin operate without a reset earlier it loses command stability.



IMPORTANT, MUST BE READ...

Thank for your attention How Long Should You Set Your Watchdog Timer

my blog How Long Should You Set Your Watchdog Timer, Have a nice day.

Now you read article How Long Should You Set Your Watchdog Timer this permalink article is http://fairemirima.blogspot.com/2017/11/how-long-should-you-set-your-watchdog.html Thank you and Best regards. You Can read nice Tips below. It was always better to choose topics that interest you or in wich you at least have some knowledge about . When creating targeted internet copywriting , you have to stick with your strong points , or everyone will know it . Make a list of all of the things and or topics that you are interested in . . . How much do you know ? Can you tell it as a story ? That is The essence of writing for the web . You Have to know your subject well , or nobody will believe you it is always better to impress someone then upset them . When Writing Targeted Internet Copywriting , you have to choose your appropriate target group of customers . without a target group of customers , you could ramble on incessantly about random subjects for days on end with no essence of a final goal . You always have to keep in mind who your customers are and what they are looking for . . . . . . . . . IMPORTANT, MUST BE READ...

0 Response to "How Long Should You Set Your Watchdog Timer"

Post a Comment