I’m running FreeRTOS v 7.3.0 and am having trouble getting vTaskGetRunTimeStats() to compile in my code.
In FreeRTOSConfig.h I added the following line at the top of the file;
extern volatile unsigned long ulHighFrequencyTimerTicks;
This is how my code looks like for enabling run time stats in the file, in code it is just # and not (#), for some reason when I just do # as the first character on the line it turns the text into huge header text.
/* Run time stats gathering definitions. */
(#)if defined (GNUC) || defined (ICCARM)
void configure_timer_for_run_time_stats( void );
uint32_t get_run_time_counter_value( void );
(#)define configGENERATE_RUN_TIME_STATS 1
(#)define portCONFIGURE_TIMER_FOR_RUN_TIME_STATS() ( ulHighFrequencyTimerTicks = 0UL )
(#)define portGET_RUN_TIME_COUNTER_VALUE() ulHighFrequencyTimerTicks
These are the errors I get, they are all located in tasks.c:
undefined reference to `ulHighFrequencyTimerTicks’ tasks.c 1098
Code at 1098:
pxCurrentTCB = NULL;
undefined reference to `ulHighFrequencyTimerTicks’ tasks.c 1594
Code at 1594:
prvGenerateRunTimeStatsForTasksInList( pcWriteBuffer, ( xList * ) pxDelayedTaskList, ulTotalRunTime );
undefined reference to `ulHighFrequencyTimerTicks’ tasks.c 1851
Code at 1851:
undefined reference to `ulHighFrequencyTimerTicks’ tasks.c 2414
Code at 2414:
vPortFree( pxNewTCB );
I’ve made certain tasks.c includes FreeRTOS.h which includes FreeRTOSConfig.h where the variable is decalred. Is there something else I need to do to the variable in order for it to be used in tasks.c?