ts-7000
[Top] [All Lists]

RE: [ts-7000] Re: TS-7800 External Watchdog Timer

To:
Subject: RE: [ts-7000] Re: TS-7800 External Watchdog Timer
From: Alex Kulinchenko <>
Date: Mon, 04 May 2009 10:06:15 -0800


Charlie,
 
Thanks for help.  I modified the code to disable WDT at the beginning of the application. 
Everything seems to be working OK now.
 
- Alex
 
-----Original Message-----
From: [On Behalf Of charliem_1216
Sent: Friday, May 01, 2009 6:02 PM
To:
Subject: [ts-7000] Re: TS-7800 External Watchdog Timer

--- In .com, Alex Kulinchenko <> wrote:
>
> Charlie,
>
> OK, now I am even more confused.
>
> Here is the example from TS web-site:
>
> .....
> *wdt_feed = 0x05;
> *wdt_control = 0x07;
>
> while (1)
> {
> *wdt_feed = 0x05;
> sleep(5);
> }
> ...
>
> According to TS-7260 manual:
> "The WDT control register must be initialized with the timeout period
> desired".
> So, we are setting wdt_control to 0x07. which is 8 sec (not 2).
>
> Then the TS-7260 manual states:
> "In order to clear the WDT counter (feeding the watchdog), a value of Hex 05
> must be written to the WDT Feed register".
> It sounds like 0x05 is the only choice for WDT feed and this WDT feed value
> does not correspond to 2 sec.
>
> If I understood the example and manual correctly, the example application
> sets timeout to 8 sec and then feeds WDT timer every 5 sec, so it should
> never cause the reboot.
>
> Did I misunderstood the instructions in the manual?

No, sorry, looks like I mis-read the code.

Can you explain what exactly you want it to do, and what the problem is? As I understand it:
* you tried to use the wdt in your program,
* your program terminated without stopping the wdt,
* now your board reboots after 8 seconds (even without your program running). Is that right?

If you want to use the example code in your program, to trigger a reboot if your program fails, then do *not* use the kernel driver. Your program must run with root privs. The first thing your program should do is to disable the wdt: write 0x05 to the feed register and immediately write 0 to the control register. (The link I posted earlier has a patch from Eddie to turn off the wdt when the driver is first loaded ...)

If you use the kernel wdt driver, it does the same thing, but provides ioctls, device nodes, standard watchdog APIs, etc. In that case, your program would use the standard linux APIs to feed the wdt, and not write directly to the hardware.

Try checking the contents of wdt_control before and after you enable the wdt: should be 0 before an 0x07 after. Oh, and be sure to change "O_RDWR" to "O_RDWR|O_SYNC" on opening /dev/mem, otherwise you may be reading cached values.

regards, ...... Charlie

>
>
> -----Original Message-----
> From: .com [mailto:.com]On Behalf Of
> charliem_1216
> Sent: Friday, May 01, 2009 11:06 AM
> To: .com
> Subject: [ts-7000] Re: TS-7800 External Watchdog Timer
>
>
>
>
>
> --- In .com, Alex Kulinchenko <alex@> wrote:
> >
> > Charlie,
> >
> > Thanks for quick reply. The system is running 2.4 TS kernel. I am using
> > external TS WDT as recommended by TS-7260 manual.
> > I used the wdt2.c code as example (I basically did copy / paste for the
> > code).
>
> Well, there it is then. The code, as-is on the web site, is set to demo
> the WDT triggering: it sets the feed to 0x05 (ie 2 seconds), then does a
> sleep(5), which is longer than 2, so it is working as designed.
>
> regards, ........ Charlie
>
> >
> > The link that you provided is for 2.6 kernel. How can I check if I have
> > driver for ts7260-wdt enabled and ep93xx-wdt disabled in 2.4 kernel?
> >
> > - Alex
> >
> >
>



__._,_.___


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