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


xTaskGetTickCount not counting

Posted by Christopher Coley on June 7, 2008
I noticed an issue where when vTaskSuspendAll has been called to suspend the scheduler the xTickCount is no longer incremented and instead a count of ticks missed is kept in uxMissedTicks.

In the code between the suspend and the resume I was using the TickCount returned by xTaskGetTickCount to time off some signals.

Is there any reason why xTaskGetTickCount should not be modified to return the sum of the xTickCount and uxMissedTicks such that it returns a real tick time while suspended?


RE: xTaskGetTickCount not counting

Posted by Richard on June 7, 2008
While the scheudler is suspended all the tick counts are held pending and unwound when the scheduler is unsuspended. This is part of the suspension, the scheduler is not supposed to be running.

You could implement a tick hook or one of the trace macros to provide an alternative time source that keeps running all the time.


RE: xTaskGetTickCount not counting

Posted by Christopher Coley on June 7, 2008
Yes I agree with the operation from the scheduler perspective, however the definition for xTaskGetTickCount says the number of ticks since vTaskStartScheduler was called not the number of ticks that have been operated upon.

It appears that the Kernel itself does not use xTaskGetTickCount so having it return the sum of the current ticks executed plus the number of ticks pending would then match the description of the function? Alternatively the description should probably change so somebody else doesn't make the same mistake.


[ 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