TOP
SSV Software Systems Register  Register
Log in to check your private messages  Log in to check your private messages
Startseite FAQ Search Mitglieder Profile  Log in 
SSV Support-Forum
Watchdog Timer nutzen …

 
Post new topic   Reply to topic    SSV-Forum Forum Index >>> IGW/922
<<< Previous topic - Next topic >>>  
Display posts from previous:   
Author Message
kdw



Joined: 05 May 2006
Posts: 1460

PostPosted: 05.05.2011, 15:35    Post subject: Watchdog Timer nutzen … Reply with quote

Hallo Forum.

Frage: Besitzt ein IGW/922 einen Watchdog Timer und wie kann man den benutzen?

Antwort: Ja, ein solcher Timer ist vorhanden und wird auch durch ein spezielles Kernel Modul unterstützt. Das Kernel Modul "at91_wdt" für den Watchdog Timer ist nach dem Booten geladen, wird jedoch nicht automatisch getriggert, d.h. der Watchdog Timer ist nicht aktiv. Triggern kann man den Watchdog Timer über das Device /dev/watchdog, indem man irgendetwas dort „rein“ schreibt. Nachdem einmal getriggert wurde, muss man innerhalb von 5 Sekunden immer wieder triggern. Ansonsten wird durch den Watchdog Timer ein Reset erzeugt. Hier ein C/C++ Beispiel:

Code:
#include <stdio.h>
#include <unistd.h>
#include <fcntl.h>

int main(int argc, const char *argv[])
{
   int fd=open("/dev/watchdog",O_WRONLY);
   if(fd==-1){
      perror("watchdog");
      exit(1);
   }
   while(1)
   {
      write(fd,"\0",1);
      fsync(fd);
      sleep(10);
   }
}



Gruß

KDW
Back to top
View user's profile Send private message
hne



Joined: 11 Jul 2008
Posts: 210
Location: Hannover

PostPosted: 14.08.2012, 15:13    Post subject: Reply with quote

Code:
at91_wdt - AT91 Watchdog Timer enabled (5 seconds, nowayout=1)

... ist beim Booten zu lesen.

Mit einem "sleep(10)" in dem Beispiel würde der Watchdog also immer auslösen.
Bitte stattdessen "sleep(3)" benutzen.
_________________
Henry Nestler
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    SSV-Forum Forum Index >>> IGW/922 All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

SSV Software Systems GmbH

Dünenweg 5
30419 Hannover

Fon: +49(0)511  ·  40 000-0
Fax: +49(0)511  ·  40 000-40

sales@ssv-embedded.de


Impressum    ·    Datenschutz    ·    AGB

© 2023 SSV SOFTWARE SYSTEMS GmbH. Alle Rechte vorbehalten.

ISO 9001:2015