I want to monitor task status on FreeRTOS, so I enabled config_GENERATE_RUN_TIME_STATS in FreeRTOSConfig.h. However, I encountered the following error:
If configGENERATE_RUN_TIME_STATS is defined then portCONFIGURE_TIMER_FOR_RUN_TIME_STATS must also be defined. portCONFIGURE_TIMER_FOR_RUN_TIME_STATS should call a port layer function to setup a peripheral timer/counter that can then be used as the run time counter time base.
If configGENERATE_RUN_TIME_STATS is defined then either portGET_RUN_TIME_COUNTER_VALUE or portALT_GET_RUN_TIME_COUNTER_VALUE must also be defined. See the examples provided and the FreeRTOS web site for more information.
I'm unsure how to implement portCONFIGURE_TIMER_FOR_RUN_TIME_STATS and portALT_GET_RUN_TIME_COUNTER_VALUE on the LPC55xx.
Could you provide assistance with this?
Hello @inse1979
To enable run-time statistics in FreeRTOS on the LPC55xx, you need to configure a hardware timer that FreeRTOS can use to track task execution time. The error you're seeing is because the required macros are not yet defined in your FreeRTOSConfig.h
.
Make sure these are defined:
You’ll need to implement two functions in your application code:
configureTimerForRunTimeStats()
This function sets up a hardware timer (e.g., CTIMER0) to count at a known frequency.
getRunTimeCounterValue()
This function returns the current timer count.