FreeRTOS Support Archive
The FreeRTOS support forum is used to obtain active support directly from Real
Time Engineers Ltd. In return for using our top quality software and services for
free, we request you play fair and do your bit to help others too! Sign up
to receive notifications of new support topics then help where you can.
This is a read only archive of threads posted to the FreeRTOS support forum.
The archive is updated every week, so will not always contain the very latest posts.
Use these archive pages to search previous posts. Use the Live FreeRTOS Forum
link to reply to a post, or start a new support thread.
[FreeRTOS Home] [Live FreeRTOS Forum] [FAQ] [Archive Top] [July 2007 Threads] [AVR]Best place to place Watchdog Timer ResetPosted by zohair on July 23, 2007 I'm working on an ATMega32 and am trying to add a watchdog timer to the project.
I wanna know, what would be the best place to place the timer reset command. Since FreeRTOS uses multi-threading, I guess threads would continue to operate even if one of them hung up. I'm guessing I'll need to create a task to occasionally reset the Watchdog, but what should I set the priority to?
Since we're on the topic, how many tasks can I create on my system?
RE: [AVR]Best place to place Watchdog Timer ResetPosted by Richard on July 23, 2007 The number of tasks you can create is dependent on the amount of RAM available and the size of the stack allocated to each task.
There is no simple answer to your watchdog question. It depends on how secure you want it to be. There are lots of papers available on watchdog design, it can get quite an academic subject. One approach is to have each task perform some form of self check and send a message to a watchdog task. The watchdog task then needs to run within a time window, and receive "I am ok" messages from all the other tasks before it kicks the dog.
Regards.
RE: [AVR]Best place to place Watchdog Timer RPosted by zohair on July 23, 2007 I'm guessing the number of tasks isn't simply (Available RAM / configMINIMAL_STACK_SIZE), right?
I was thinking of a simple watchdog and kick it at the lowest priority. That way if any higher priority task hangs, we get a reset. Any possible problems with this?
RE: [AVR]Best place to place Watchdog Timer RPosted by David Hawks on July 23, 2007 That depends on the type of "hang". A higher priority task can "hang" by blocking on a resource that will not become available for whatever reason. The higher priority task will be left blocked and the lower priority watchdog reset task will be allowed to run. The watchdog will continue to operate even though a higher priority task is stuck. It is due to this kind of interaction that watchdog design can become an "academic subject" as Richard said.
Your simple watchdog will detect some failures, and maybe that is good enough for you. It is not fool-proof, however.
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.
|