Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem


ApplicationTickHook repeated calls - bug??

Posted by ClaytonG on April 21, 2006
I have used the Tick Hook as a means to drive a multiplexed LED display. However I soon found that it was not calling my Mux routine consistantly - it was often double or even triple calling it.

I have tracked this down to the MissedTicks processing in xTaskResumeAll (tasks.c) - this is also resulting in an vApplicationTickHook call (via vTaskIncrementTick ). So vApplicationTickHook gets called with each tick ISR (regardless of a proper tick handling or a tick miss), and then again when tick misses are handled.

The fix I have put into place is to remove the vApplicationTickHook from vTaskIncrementTick (task.c) and instead put it into the vPortYieldFromTick call (port.c) - this does however mean that all portable code needs this change - I have just changed my GCC-AVR port which this project uses.

I'm sure a better solution that does not involve portable code can be implemented in the next release - assuming of course that you agreee that the current behaviour is not correct :-)

On further thinking maybe the current behaviour is valid if the hook is doing something based on the tick count. Maybe two hooks are needed - a 'TickInterrupt' hook and a 'TickIncrement' hook??

RE: ApplicationTickHook repeated calls - bug??

Posted by Nobody/Anonymous on April 21, 2006
If its a periodic hook that is required then the best way would be to somehow prevent the hook being called when the function is called from xTaskResumeAll(). I cannot see a neat way of doing this without using a parameter which would not be desirable.

RE: ApplicationTickHook repeated calls - bug?

Posted by Nobody/Anonymous on April 21, 2006
You can call tickHook directly from the tickISR -
take a look at the post from:

By: Nobody/Anonymous - nobody
RE: Staggering Task Start Times
2005-12-16 04:26

You can find this by searching this forum for

John W.

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

Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.

Latest News

Version 10.1.0 of the FreeRTOS kernel is available for immediate download. MIT licensed.

View a recording of the "OTA Update Security and Reliability" webinar, presented by TI and AWS.


FreeRTOS and other embedded software careers at AWS.

FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Espressif ESP32

IAR Partner

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers


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

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

OpenRTOS and SafeRTOS

Xilinx Microblaze and Zynq partner