So I have FreeRTOS runnong on a rasberry PI PICO board and I can debug and run my application code using vscode To this point I am very happy.
I want to look at the utilisation figures to see how much I have left in the CPU so I have changed FreeRTOSConfig.h to have the folllowing settings…
/* Run time and task stats gathering related definitions. */
#define configGENERATE_RUN_TIME_STATS 1
#define configUSE_TRACE_FACILITY 1
#define configUSE_STATS_FORMATTING_FUNCTIONS 1
#define portCONFIGURE_TIMER_FOR_RUN_TIME_STATS configure_timer_for_run_time_stats
#define portGET_RUN_TIME_COUNTER_VALUE get_run_time_counter_value
#define configRECORD_STACK_HIGH_ADDRESS 1
In main.c I have the following implementations for the run time stats…
void configure_timer_for_run_time_stats(void){
// this can remain empty since the SDK already sets up a free timer for us !!
}
/** \brief This macro should just return the current 'time'
\details Current time as defined by timer that has been configured above.
*/
static configRUN_TIME_COUNTER_TYPE thistime = 0UL;
configRUN_TIME_COUNTER_TYPE get_run_time_counter_value(void){
thistime = timer_hw->timelr;
return thistime;
}
I have checked and thistime is incrementing but when I look in the XRTOS window in vscode I have all the figures except the Runtime which is the one I am looking for.
I know my get_run_time_counter_value is being called. I am not sure what to do next.
Any advice would be greatly appreciated.