2008-05-27 06:46:08     Watchdog in 2008R1

Document created by Aaronwu Employee on Aug 6, 2013
Version 1Show Document
  • View in full screen mode

2008-05-27 06:46:08     Watchdog in 2008R1

Sergey Panov (RUSSIAN FEDERATION)

Message: 56299   

 

I have the last version of uClinux.

 

The option `Device Nodes' is Dynamic.

 

The option `Blackfin On-Chip Watchdog Timer' is checked.

 

I see the node /dev/watchdog.

 

But the function open("/dev/watchdog", O_WRONLY) returns the result -1.

 

Help, please!

QuoteReplyEditDelete

 

 

2008-05-28 03:07:22     Re: Watchdog in 2008R1

Mike Frysinger (UNITED STATES)

Message: 56316   

 

did you create the device node yourself ?

 

the return value of -1 really doesnt tell you much ... you have to look at errno to better figure out what the problem is

QuoteReplyEditDelete

 

 

2008-05-28 06:00:17     Re: Watchdog in 2008R1

Sergey Panov (RUSSIAN FEDERATION)

Message: 56341   

 

No, I didn't create it myself.

 

errno = 16 - `Device or resource busy'.

QuoteReplyEditDelete

 

 

2008-05-28 11:17:35     Re: Watchdog in 2008R1

Mike Frysinger (UNITED STATES)

Message: 56354   

 

then there you go ... you probably already have something already opening the watchdog, and since only one application can open the watchdog at a time ...

QuoteReplyEditDelete

 

 

2008-05-29 03:57:45     Re: Watchdog in 2008R1

Sergey Panov (RUSSIAN FEDERATION)

Message: 56391   

 

Mike, thank you. You are quite right, the process opening the watchdog is `/bin/watchdogd -f -s'. I don't understand the mechanism of launching this process. So, after the line

 

 

 

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

 

 

of the file .../user/blkfin-apps/watchdogd/watchdogd.c I inserted `return 0;'. After that I became to receive the message

 

 

 

init: /bin/watchdogd respawning too fast

 

 

 

Then I inserted

 

 

 

while (1)

 

  sleep(1);

 

 

 

Now `init' is happy and my watchdog works right. But I'm not very happy because I don't know how to do all of this properly.

 

 

QuoteReplyEditDelete

 

 

2008-05-29 11:35:49     Re: Watchdog in 2008R1

Mike Frysinger (UNITED STATES)

Message: 56411   

 

you enabled the default watchdog daemon in the dist ... that will maintain /dev/watchdog for you.  if you want to maintain it yourself, then you need to disable the watchdog daemon in the user configuration menu.

 

you're correct in that modifying random programs is probably never the right way to do things.

 

see Blackfin app programs -> watchdog

QuoteReplyEditDelete

 

 

2008-05-29 14:45:16     Re: Watchdog in 2008R1

Sergey Panov (RUSSIAN FEDERATION)

Message: 56426   

 

Thank you.

Attachments

    Outcomes