Quality RTOS & Embedded Software

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




Loading

FreeRTOS kernel overhead

Posted by bertino on March 17, 2014

Hello,

It's no so long since I started with FreeRTOS, running on cortex M3 (more specifically I'm on a STM32L151xB).

Following common sense, the conditions under which I expect advantage in using the FreeRTOS real time scheduler is that the average scheduler run time should be much less than the period between two consecutive sysTicks interrupts (leaving enough of the time slice to tasks). In my own mindset the only way I can currently think of to perform such an assessment is to measure duration of the xPortSysTickHandler(), for example starting a timer at the beginning of it and stopping it at the end in order to read out the duration. Does this make any sense? Or, is there anything else you would recommend as quick check or as rule of thumb?

Thanks, Adalberto


FreeRTOS kernel overhead

Posted by rtel on March 17, 2014

Systick only increments the tick interrupt and most non-RTOS systems have some kind of tick interrupt so that is not much of an increment in the overhead. Systick does not not perform the context switch. The context switch time is stated on cycles on the following page of the FAQ: http://www.freertos.org/FAQMem.html

However, the main time advantage of using an RTOS is in the ability to make a system completely event driven, and therefore not polling anything and not using any processing time unless there is something to process. Normally the time spent context switching or incrementing the tick is a tiny fraction of the time spent within a time slice, and you can make the time slice really long or turn it off altogether.

If you want to do something repetitive at a fast rate then it is possible you are better off doing it from a timer interrupt, rather than a task, or using the peripheral interrupt to buffer data (preferably using a DMA) for minimum overhead.

Regards.


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




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

Latest News

FreeRTOS kernel V10 is available for immediate download. Now MIT licensed.


FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

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