Quality RTOS & Embedded Software

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


Ticktimer overflow issue

Posted by olibats on September 28, 2007

I am running freeRTOS in preemptive mode. Assuming my system will run a very long time without a restart I have come to the conclusion that xTickCount could overflow. I tried to provoke this by using 16 bit tick counter and see what happens to my RTOS and tasks.

For what I have seen everything looks good. No fault times where no task is executed or else.

Nevertheless I am asking you, if somebody knows if there is any other issue concerning long time runs.

Also I am asking about the configTOTAL_HEAP_SIZE, which seems to have absolutely no influence on the system. (Which might be because I am using the heap_3.c??).


RE: Ticktimer overflow issue

Posted by Richard on September 28, 2007
First - you are right - configTOTAL_HEAP_SIZE has no influence when using heap_3.

Regarding the tick count overflow - everything internal to FreeRTOS.org is designed to cope with the tick count overflowing so you have no worries there. This was checked out very thoroughly during the SafeRTOS testing process, and actually resulted in a minor change to the FreeRTOS.org code to fix a glitch that could have occurred once in a billion billion years (i.e. extremely unlikely).

Naturally if your application code itself (as opposed to the kernel code) makes use of the tick count value then it has to be aware of overflows just as if it used any other timer. There is actually an undocumented feature that can assist with this - take a look at how the queue code uses the vTaskSetTimeOutState() and xTaskCheckForTimeOut() functions.


RE: Ticktimer overflow issue

Posted by olibats on October 1, 2007

Tanks for your comment. I put my mind at rest on this issue.

Thanks for the Hint with those methods. Since I have to work with the TickCount I am almost sure I will need them.

Thanks again,

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

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

Latest News

NXP tweet showing LPC5500 (ARMv8-M Cortex-M33) running FreeRTOS.

Version 10.1.1 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