Quality RTOS & Embedded Software

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


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 ]    [ 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