Quality RTOS & Embedded Software

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


SAMv71 Evaluation Kit freeRTOS initialization + getRunTimeStats

Posted by mokrooussov on March 30, 2016

Hello, we have a pretty detailed question regarding to the RTOS implementation and usage generation values. At this point, I have been pursuing a FreeRTOS example project provided by Atmel in Atmel Studio 7. We have found multiple examples where initializing a GETRUNTIMESTATS configuration and using a vTaskGetRunTimeStats() provides a table in the form of: TASK ABS TIME % Time ------------------------------------------ In order for us to achieve this tabular interface, we took the following steps as detailed by RTOS website in this website: http://www.freertos.org/rtos-run-time-stats.html We added the following code to FreeRTOSconfig.h


We then added vTaskGetRunTimeStats() function in the task monitor function in the c main file and passed through an array construction, based on the following documentation: http://www.freertos.org/a00021.html#vTaskGetRunTimeStats The value passed through is a pcWriteBuffer, a buffer into which execution times will be written in ASCII form, approximately 40 bits per task used.

However, we found that when defining the ports in FreeRTOSconfig.h was complicated, we needed an incremented timer tick clock. The 2 examples in the first website referenced above, provides an example of a demo application that already includes a 20KHz timer test and one that does not. For the one that does not, we belive this resembles our situation. However, the definition they provide of a configuration of a timer for runtime stats in the main.c file does not fit our processor. We are currently attempting to discover a method for defining a peripheral clock. If you have any more questions or if you could assist us, we would be grateful.

SAMv71 Evaluation Kit freeRTOS initialization + getRunTimeStats

Posted by rtel on March 30, 2016

How you configure a chip specific timer is, I'm afraid, outside the scope of FreeRTOS support because its an Atmel hardware question not a FreeRTOS question. You have some options:

  • Look at the examples provided by Atmel, they will probably have one.
  • Read the data sheet and write the code yourself - generally timers are simple to program.
  • Ask on an Atmel specific forum.

Alternatively, you could use the cycle counter that is present on all Cortex-M devices. It is not very efficient to do that, but it will provide you with some numbers. The following file should work for you, and even comes from a SAM4E demo application, which I think is [at least pin] compatible with your part. https://sourceforge.net/p/freertos/code/HEAD/tree/trunk/FreeRTOS/Demo/CORTEXM4FATSAM4EAtmelStudio/src/RunTimeStatsTimer.c

[also look at the following function http://www.freertos.org/uxTaskGetSystemState.html]

[ 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