lee-soter wrote on Tuesday, June 07, 2016:

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

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.

rtel wrote on Tuesday, June 07, 2016:

portCONFIGURE_TIMER_FOR_RUN_TIME_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
configGENERATE_RUN_TIME_STATS set to 1, which means you then have to
provide portCONFIGURE_TIMER_FOR_RUN_TIME_STATS() which must configure
the clock used as the run time stats time base, and
portGET_RUN_TIME_COUNTER_VALUE() which much return the current value of
whichever clock you are using.

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


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


lee-soter wrote on Tuesday, June 07, 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.