Quality RTOS & Embedded Software

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


Loading

Calculate Task Execution Time

Posted by engmmostafa80 on March 12, 2014

I want to know a simple method to calculate running task execution time. Is there any FREE RTOS API can do this?


Calculate Task Execution Time

Posted by rtel on March 12, 2014

There are several ways of doing this, but in each case you need to supply a fast clock as a time base. The fast clock needs to provide time at a rate many times higher than the tick count increment, otherwise you will not get the resolution you need.

If you are using a Cortex-M then a convenient method is to use the cycle counter from the debug circuitry - if you are using Cortex-M (would have been easier if you had stated which chip you were using in your original question) then let me know and I can point you in the direction of the appropriate code. Otherwise here is a generic page on the subject:

http://www.freertos.org/rtos-run-time-stats.html

In addition you can define the traceTASKSWITCHEDIN or traceTASKSWITCHEDOUT macros to do whatever you want, including keeping your own run time date. Finally you could the FreeRTOS+Trace tool.

Regards.


Calculate Task Execution Time

Posted by engmmostafa80 on March 12, 2014

I am using Cortex-M3 (Atmel SAM3U4E). FreeRTOS Resolution of 1 ms is very small to what I want to measure. It will be good if I have a resolution of 50-100 Micro Sec if possible.


Calculate Task Execution Time

Posted by rtel on March 12, 2014

You can use the run-time stats implementation found in the SAM4E demo. Look at the file RunTimeStatsTimer.c in FreeRTOSDemoCORTEXM4ATSAM4EAtmelStudiosrc, and the run time stats related FreeRTOSConfig.h settings in FreeRTOSDemoCORTEXM4ATSAM4EAtmelStudiosrcconfigFreeRTOSConfig.h.

Regards.


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

Meet Richard Barry and learn about running FreeRTOS on RISC-V at FOSDEM 2019

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.


Careers

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

Renesas

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