Skip to main content
Associate
June 25, 2026
Question

Return type of GetRunTimeCounterValue() generated for FreeRTOS Run Time Stats does not match configRUN_TIME_COUNTER_TYPE

  • June 25, 2026
  • 1 reply
  • 60 views

This is a bug with the code generation with STM32CubeMX2.

In STM32CubeMX2, enable the middleware FreeRTOS, and in its settings Core → Main features → Advanced parameters selector → Task statistics and run-time, enable “Generate run time stats”.

This generate a function in mx_freertos_app.c:

/**
* @brief Function to get the current value of the run-time timer counter.
* @param None
* @retval uint64_t The current counter value.
*/
uint64_t GetRunTimeCounterValue (void)
{
return 0;
}

The return type is uint64_t, but it does not match the following type from FreeRTOSConfig.h (which cannot be changed in STM32CubeMX2): 

#define configRUN_TIME_COUNTER_TYPE                   uint32_t

 

1 reply

ST Technical Moderator
July 6, 2026

Hello ​@TheBigBadBoy 

Thank you for bringing this issue to our attention.

I reported this internally.

Internal ticket number: CDM0064095 (This is an internal tracking number and is not accessible or usable by customers).

In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question. Saket_Om