Hi Mathew,

> On Aug 29, 2016, at 5:02 PM, Mathew Calmer <[email protected]> wrote:
> 
> It’s implied but not made explicit that hal_watchdog_init sets up a 
> re-occuring watchdog, not a one time use one (who wants a one time use 
> watchdog….).  This should be made explicit though.
> 

right. I can change the wording in the comment. That was indeed what I had in 
mind.

> Also, it would be nice if the watchdog module could tell you if a recent 
> reset was caused by the watchdog.   I could imagine this functionality being 
> in the startup module instead however.

That is absolutely necessary. I initially thought we’d have another API call in 
hal/hal_system.h which would
return reboot reason. And that would include HAL watchdog as one possible cause.
If we end up having driver interface for watchdogs, then I’d include a call in 
there which would tell if
that watchdog was the cause of the restart.

What I’m hoping to do is to have a way of pre-empting the hardware watchdog by 
having a dedicated
timer interrupt (when available), that would fire just before watchdog resets 
the system. The benefit of
this would be that it would be possible to create a coredump of the system 
state for later analysis.
When system is wedged bad enough, this might not run to completion. But in most 
cases, it would
help in debugging spurious (and not so spurious) watchdog events.

> *m
> 
> Mathew Calmer, R&D Director of Software and Firmware
> Please note my new email address: [email protected]
> ExploraMed NC7
> 201 San Antonio Circle, Suite 172.  Mountain View, CA  94040
> 206 228 4665  | 
> mcalmer@exploramednc7<mailto:[email protected]>.com<mailto:[email protected]>
> 
> This e-mail may contain information that is privileged, confidential, 
> proprietary, or otherwise exempt from disclosure under applicable law. If you 
> have received this message in error, please advise the sender by return 
> e-mail, delete it from your mailbox and don’t disclose the information. Thank 
> you.
> 
> 
> 
> 
>> On Aug 29, 2016, at 4:40 PM, marko kiiskila 
>> <[email protected]><mailto:[email protected]%3E> wrote:
>> 
>> Hi,
>> 
>> I was going to add support for hardware watchdog(s).
>> The API I was thinking would be pretty simple.
>> 
>> The first user for this would be the sanity task.
>> 
>> —8<---
>> /*
>> * Set the watchdog time to fire no sooner than 'expire_secs' seconds from 
>> now.
>> */
>> int hal_watchdog_init(int expire_secs);
>> 
>> /*
>> * Tickles the watchdog. Needs to be done before 'expire_secs' fires.
>> */
>> int hal_watchdog_tickle(void);
>> 
>> /*
>> * Stops the watchdog.
>> */
>> int hal_watchdog_stop(void);
>> 
>> —8<———
>> 
>> Let me know if this doesn’t seem right.
> 
> ________________________________

Reply via email to