--- In 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: Behalf Of
> charliem_1216
> Sent: Friday, May 01, 2009 11:06 AM
> To:
> Subject: [ts-7000] Re: TS-7800 External Watchdog Timer
>
>
>
>
>
> --- In 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
> >
> >
>
------------------------------------
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/
|