ts-7000
[Top] [All Lists]

[ts-7000] watchdog configiration issues in ts7500

To:
Subject: [ts-7000] watchdog configiration issues in ts7500
From: "ramandeep" <>
Date: Mon, 27 Jun 2011 11:03:30 -0000
Hi,

I am trying to configure the watchdog in TS7500 to achieve the following:

1) Automatically reboot the board if the app hangs.

2) Reboot the board if the application gets killed and stops at command 
line/shell prompt.

The first requirement is satisfied but somehow the watchdog doesnt time out if 
I kill the application from the console.Even when I exit from the application 
after some iterations of watchdog feed the results are the same.The board just 
stops at command line.Any ideas what could be wrong here?
The code is as below:
//////////////////////////////////

#include <time.h>
#include <stdio.h>
#include <errno.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <unistd.h>
#include <ctype.h>
#include <linux/rtc.h>
#include <sys/time.h>
#include <sys/types.h>
#include <string.h>
#include <ctype.h>
#include <pthread.h>


#include "sbus.h"
#include "termios.h"                                                            
                         
#include "fcntl.h"
#include "stdlib.h"
#include "malloc.h"


int main(int argc, char **argv)
{

        unsigned char iii=0;
        ///initialize watchdog
        system("ts7500ctl -W");
        printf("\n watchdog init \n");

        ///set autofeed interval for watchdog

        /*
        0x74: Watchdog feed register (write only)
     write value 0x0: feed watchdog for another .338s (approx)
     write value 0x1: feed watchdog for another 2.706s (approx)
     write value 0x2: feed watchdog for another 10.824 (approx)
     write value 0x3: disable watchdog
        */
                sbuslock();
                sbus_poke16(0x74,1);
                sbusunlock();

        for(iii=0;iii<50;iii++)
        {
                sleep(1);
                sbuslock();
                sbus_poke16(0x74,1);
                sbusunlock();
                printf("\n feeding watchdog = %d\n",iii);
                printf("\n in while \n");
        }

        exit(0);
 ///exiting from app here back to shell prompt...hoping for watchdog to timeout 
and reboot the board
}


////////////////////////////////////////////


Thanks,
Ramandeep



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

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