ts-7000
[Top] [All Lists]

Re: [ts-7000] How to do soft shutdown with watchdog timer?

To:
Subject: Re: [ts-7000] How to do soft shutdown with watchdog timer?
From: Clark Dunson <>
Date: Tue, 8 Mar 2011 14:20:54 -0800


I seem to remember Don that the standard Unix watchdog service (allows many such policies to be enacted) can be configured to work with the hardware watchdog, such that you can do such things under its auspices.  The hardware watchdog is then relegated to the role of your last resort, ie. no other choice then but a hard reboot, by using a longer timeout.  It's been a couple of years, but I think we implemented it this way on one of our former programs.

good luck.

On Mar 8, 2011, at 1:31 PM, Rekcut_Nod wrote:

 

I'm using a TS-7260. I monitor a DIO line for the user to shutdown the system, at which point I want to close all open ports and devices, and issue a "shutdown -h now" command via popen (I'm writing c code).

My question is, if the watchdog is initialized and fed by:

int fd = open("/dev/mem", O_RDWR|O_SYNC);
volatile unsigned char *wdt_control;
volatile unsigned char *wdt_feedl;

wdt_control = (unsigned char*)mmap(0,getpagesize(),PROT_READ|PROT_WRITE,MAP_SHARED,fd,0x23800000);
wdt_feed = (unsigned char*)mmap(0,getpagesize(),PROT_READ|PROT_WRITE,MAP_SHARED,fd,0x23C00000);

*wdt_feed=0x05;
*wdt_control=0x07;//set duration to max = 8 seconds

how can I call fclose(fd)? I don't want the watchdog to reset the board before the "shutdown -h now" is finished, nor do I want the program to be terminated by the shutdown command before I've safely released /dev/mem. Any suggestions?




__._,_.___


Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: =Email Delivery: Digest | m("yahoogroups.com?subject","ts-7000-fullfeatured");=Change Delivery Format: Fully Featured">Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | =Unsubscribe

__,_._,___
<Prev in Thread] Current Thread [Next in Thread>
Admin

Disclaimer: Neither Andrew Taylor nor the University of NSW School of Computer and Engineering take any responsibility for the contents of this archive. It is purely a compilation of material sent by many people to the birding-aus mailing list. It has not been checked for accuracy nor its content verified in any way. If you wish to get material removed from the archive or have other queries about the archive e-mail Andrew Taylor at this address: andrewt@cse.unsw.EDU.AU