Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Real time embedded FreeRTOS mailing list 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem TCP & FAT Training




Loading

vApplicationTickHook ..FromISR?

Posted by Mathias Zenger on September 16, 2009
I have a question regarding the vApplicationTickHook function:

Context: Atmel EVK1100 with AT32UC3A0512, FreeRTOS and lwIP.

I've had the idea to use this function for toggling my watchdog timer . Further I would like to notify a task from the vApplicationTickHook function in case of certain events. Therefor I want to write to a queue. Problem: is this function a ISR and I therefore need to use xQueueSentToBackFromISR or not?

Thanks. Regards Mathias

RE: vApplicationTickHook ..FromISR?

Posted by Richard on September 16, 2009
Yes - you need to use the "FromISR" version.

Also, consider carefully how you use the tick to clear the watchdog. It is possible for your application to crash but the tick to continue. A common method is have the tick run some form of sanity check on each critical task to ensure the task is not only still running, but is also doing the right thing.

Regards.

RE: vApplicationTickHook ..FromISR?

Posted by Mathias Zenger on September 17, 2009
Thanks for your answer Richard. I wasn't sure about this point.

In my application I am using a task supervision functionality additionally to the watchdog timer , too:

For task supervision I implemented an extra task. It periodically sends keep alive requests to the other tasks. Therefor every task has a queue and must send a reply to the supervision task's queue within a certain time (some of the tasks can block on their queue others need to poll it depending on their purpose). The tick hook function counts up a task local timer variable which gets reset by the supervision task upon the reception of every valid keep alive reply. If one reply is missing and the counter exceeds a limit the hook function sends a reset request to the supervision task's queue.

As far as I see this works quite fine although I have the problem that I can't supervise all tasks with this system. E.g. I have a network communication task which uses a blocking select on data reception. I am unable to let it listen to an additional keep alive queue...

Do you see an alternative/better solution where I could supervise all my tasks? What kind of sanity check are you thinking of?

Always appreciate your valuable inputs!

RE: vApplicationTickHook ..FromISR?

Posted by Richard Damon on September 17, 2009
One way to use this system to monitor a task that blocks too long waiting on another queue, is to define a message for the queue it is blocking on that it will detect as this keep-alive request.

A second way is to put an timeout limit on the queue request that it is blocking on (less than the maximum time it has to respond to the keep-alive), and check if the request timed out, and if so it only needs to check for the keep-alive request, and not processes the data packed that didn't arrive


[ Back to the top ]    [ About FreeRTOS ]    [ Sitemap ]    [ ]




Copyright (C) 2004-2010 Richard Barry. Copyright (C) 2010-2016 Real Time Engineers Ltd.
Any and all data, files, source code, html content and documentation included in the FreeRTOSTM distribution or available on this site are the exclusive property of Real Time Engineers Ltd.. See the files license.txt (included in the distribution) and this copyright notice for more information. FreeRTOSTM and FreeRTOS.orgTM are trade marks of Real Time Engineers Ltd.

Latest News:

FreeRTOS V9.0.0 is now available for download.


Free TCP/IP and file system demos for the RTOS


Sponsored Links

⇓ Now With No Code Size Limit! ⇓
⇑ Free Download Without Registering ⇑


FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Renesas Electronics Gold Alliance RTOS Partner.jpg

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

Atmel RTOS partner supporting ARM Cortex-M3 and AVR32 microcontrollers

STMicro RTOS partner supporting ARM7, ARM Cortex-M3, ARM Cortex-M4 and ARM Cortex-M0

Xilinx Microblaze and Zynq partner

Silicon Labs low power RTOS partner

Altera RTOS partner for Nios II and Cortex-A9 SoC

Freescale Alliance RTOS Member supporting ARM and ColdFire microcontrollers

Infineon ARM Cortex-M microcontrollers

Texas Instruments MCU Developer Network RTOS partner for ARM and MSP430 microcontrollers

Cypress RTOS partner supporting ARM Cortex-M3

Fujitsu RTOS partner supporting ARM Cortex-M3 and FM3

Microsemi (previously Actel) RTOS partner supporting ARM Cortex-M3

Atollic Partner

IAR Partner

Keil ARM Partner

Embedded Artists