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: Jim Jackson <>
Date: Wed, 9 Mar 2011 14:41:44 +0000 (GMT)


On Wed, 9 Mar 2011, Russell N. Nelson - rnnelson wrote:

> You can set the order in which programs are terminated by init. Look in 
> /etc/rc0.d and /etc/rc6.d.  Just make sure that your watchdog monitor is 
> one of the last programs killed by adjusting the number following the K 
> in the script that kills it.

In the TSlinux image provided by TS the directories are /etc/rc.d/rcN.d
And they contain NO kill entries :-) This is a minimal image!
However adding suitable entries should not be difficult.

> ________________________________________
> From:   on behalf of Jim 
> Jackson 
> Sent: Wednesday, March 09, 2011 8:09 AM
> To: 
> Subject: Re: [ts-7000] How to do soft shutdown with watchdog timer?
> 
> On Tue, 8 Mar 2011, 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)?
> 
> You just need to need to disable the watchdog - *wdt_feed=0;
> then it will not interfer with your shutdown regime.
> 
> > 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?
> >
> >
> 
> 
> ------------------------------------
> 
> Yahoo! Groups Links
> 
> 
> 
> 


------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/ts-7000/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/ts-7000/join
    (Yahoo! ID required)

<*> To change settings via email:
     
    

<*> To unsubscribe from this group, send an email to:
    

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/

<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