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

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
'tickHook'.

HTH,
John W.


[ 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