API issue : ulTaskGetRunTimeCounter scope

Alekos2313
Posts: 14
Joined: Sat Mar 03, 2018 12:33 pm

API issue : ulTaskGetRunTimeCounter scope

Postby Alekos2313 » Wed Apr 30, 2025 10:16 am

Hello,
I am currently on idf v5.4.1. As I was browsing the official FreeRTOS reference, I found 2 very similar functions that I need for my project:
1. ulTaskGetRunTimeCounter(xTasjk)
2. ulTaskGetIdleRunTimeCounter()

It appear they are doing the same thing: getting the cpu ticks utilized by a task : in case /1/ xTask is passed, ther task handle of the task we need to measure, and /2/ the 2 IDLE tasks are qquried , summed and returned.

For a reason that I can't understand, it appeard that /1/ is only available with SMP enabled (feat FREERTOS_SMP), but /2/ is available in all cases.

Am I missing something? Is there a reason for this?

Regards,
Alex

MicroController
Posts: 2705
Joined: Mon Oct 17, 2022 7:38 pm
Location: Europe, Germany

Re: API issue : ulTaskGetRunTimeCounter scope

Postby MicroController » Wed Apr 30, 2025 9:46 pm

For a reason that I can't understand, it appeard that /1/ is only available with SMP enabled (feat FREERTOS_SMP), but /2/ is available in all cases.

Am I missing something? Is there a reason for this?
"SMP" FreeRTOS is actually a different variant of FreeRTOS than the IDF FreeRTOS (which is also SMP-capable). IDF FreeRTOS and Amazon "SMP" FreeRTOS may differ in API and functionality.

Alekos2313
Posts: 14
Joined: Sat Mar 03, 2018 12:33 pm

Re: API issue : ulTaskGetRunTimeCounter scope

Postby Alekos2313 » Thu May 01, 2025 7:07 am

Hi, thanks!
I know all that, but my question still stands : Is there a reason for these functions to be only available in builds where "SMP / Amazon" feature is enabled ?

Regards
Alex

MicroController
Posts: 2705
Joined: Mon Oct 17, 2022 7:38 pm
Location: Europe, Germany

Re: API issue : ulTaskGetRunTimeCounter scope

Postby MicroController » Thu May 01, 2025 5:05 pm

The reason is that the Amazon FreeRTOS is a different OS and has different functionality/features than the IDF FreeRTOS, and
The Amazon SMP FreeRTOS implementation (and its port in ESP-IDF) are currently in experimental/beta state.
So the API is likely not yet stable, which implies it's likely that there are functions which are only present, i.e. new, in Amazon FreeRTOS, which may change before becoming part of the final Amazon FreeRTOS API, and may or may not be 'back-ported' to mainline/IDF FreeRTOS.

Who is online

Users browsing this forum: Semrush [Bot] and 1 guest