Quality RTOS & Embedded Software

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



Posted by lee-soter on June 7, 2016

According to the documentation that I have read regarding getting task stats I should be able to turn on configGENERATERUNTIMESTATS. A prerequisite for the function is portCONFIGURETIMERFORRUNTIMESTATS the only problem I cannot find the definition for this variable anywhere. I have set configUSETRACEFACILITY

I want to use this tool to help troubleshoot a problem I am having in my system_tasks.c file. I have 5 or 6 task that I am trying to start - I appear to only be able to start two and the third one fails and calls the function vApplicationMallocFailedHook. I have tried shotgunning the problem by doubling the heap but now I need to see what is going on. The Microchip debugger only gets me so far; I would really like to get this software tool working

I saw a similar message from 2011 but the solution looked unclean and was hoping that there was a better solution.

Any help would be greatly appreciated.

I am using MPLAB X v3.3 Harmony 1.07.01. XC32 v1.4 Hardware is my own design and I have built some basic code to veryify the hardware is working correctly.


Posted by rtel on June 7, 2016

portCONFIGURETIMERFORRUNTIME_STATS is not a variable, but a macro that you have to provide yourself.

As per the documentation page for run time stats (http://www.freertos.org/rtos-run-time-stats.html), to use the facility you need to provide three macros. You already have configGENERATERUNTIMESTATS set to 1, which means you then have to provide portCONFIGURETIMERFORRUNTIMESTATS() which must configure the clock used as the run time stats time base, and portGETRUNTIMECOUNTERVALUE() which much return the current value of whichever clock you are using.

You will find lots of examples by grep-ing portCONFIGURETIMERFORRUNTIME_STATS in the FreeRTOSConfig.h files found in the many sub-directories of FreeRTOS/Demo in the main FreeRTOS.org download. Here is one example:


Where you will find that portCONFIGURETIMERFORRUNTIMESTATS() calls vInitialiseTimerForRunTimeStats() (which is a function implemented in the projects main.c source file), and portGETRUNTIMECOUNTER_VALUE() is implemented to directly access a timer counter register (with some bit manipulation as it is a down counter).



Posted by lee-soter on June 7, 2016

Thanks for the input - it was very helpful. I figured there were examples to look at, I just didn't know where to look.


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

Copyright (C) 2004-2010 Richard Barry. Copyright (C) 2010-2016 Real Time Engineers Ltd.
Any and all data, files, source code, html content and documentation included in the FreeRTOSTM distribution or available on this site are the exclusive property of Real Time Engineers Ltd.. See the files license.txt (included in the distribution) and this copyright notice for more information. FreeRTOSTM and FreeRTOS.orgTM are trade marks of Real Time Engineers Ltd.

Latest News:

FreeRTOS V9.0.0 is now available for download.

Free TCP/IP and file system demos for the RTOS

Sponsored Links

⇓ Now With No Code Size Limit! ⇓
⇑ Free Download Without Registering ⇑

FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Renesas Electronics Gold Alliance RTOS Partner.jpg

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

Atmel RTOS partner supporting ARM Cortex-M3 and AVR32 microcontrollers

STMicro RTOS partner supporting ARM7, ARM Cortex-M3, ARM Cortex-M4 and ARM Cortex-M0

Xilinx Microblaze and Zynq partner

Silicon Labs low power RTOS partner

Altera RTOS partner for Nios II and Cortex-A9 SoC

Freescale Alliance RTOS Member supporting ARM and ColdFire microcontrollers

Infineon ARM Cortex-M microcontrollers

Texas Instruments MCU Developer Network RTOS partner for ARM and MSP430 microcontrollers

Cypress RTOS partner supporting ARM Cortex-M3

Fujitsu RTOS partner supporting ARM Cortex-M3 and FM3

Microsemi (previously Actel) RTOS partner supporting ARM Cortex-M3

Atollic Partner

IAR Partner

Keil ARM Partner

Embedded Artists