VS Code + Platformio + ESP32 How to change FreeRTOS settings to make vTaskList functional

Hi, I am looking for some step by step manual (I found few Topics, where are some informations, but they are not specific enough for me), how to make changes in FreeRTOSConfig.h file and make them active in ESP32 project build in platformio in VS Code. Thank you very very much in advance.

1 Like

Are we talking framework = espidf or framework = arduino? (The latter is extremely complicated.)

framework = arduino. I understood from diferent places of internet it is not easy, but I do not believem that I am only one, who want use vTaskList.

If you want this feature to be in mainline Arduino-ESP32, convince the people there to change their minds. The per-sé answer on this is “this will not be a supported feature”. (vTaskList() and vTaskGetRunTimeStats() not (fully) supported · Issue #4531 · espressif/arduino-esp32 · GitHub), for a good reason I think.

You should really try to get it working on bare ESP-IDF first, because then you’ll know what ESP-IDF configuration flags and changes you’ll need to recompile the ESP-IDF libraries that Arduino-ESP32 is based on.

As a starting point you should import espidf-blink and add the configuration flags (via menuconfig) as pointed out in vTaskList does not show Affinity after upgrade to freertos-10 (IDFGH-4239) · Issue #6097 · espressif/esp-idf · GitHub. These flags also agree with Support for vTaskList and vTaskGetRunTimeStats · Issue #1350 · espressif/arduino-esp32 · GitHub.

If that works, start digging into library recompiler linked above to replace libfreertos.a and the sdkconfig.h with the fixed version in PlatformIO’s framework-arduinoespressif32 folder.

" for a good reason I think." - I know about limits and consequences of using it, but I think that it still could be disableable function. And I am not sure about framework = espidf, I can definitely try it. Yesterday I spent about 5 hours to run example in VS Code - ESP-IDF extension. I run blink example, I edited to support vTaskList, but then when I want to use some arduino libraries I was not able to solve it. Even example in extension of VS Code ESP-IDF did not work, I had to edit some switch case, but I will try do same think, but via Platformio. Still I believe if there is someone, who can write down step by step instruction it would help not only me.

Indeed it would be great if Arduino-ESP32 had at least a selection of different versions for a precompiled library such as FreeRTOS – “standard” and “full (+all functions + tracing, slower)”, for example. Maybe they can implement that.

If you’ve already gotten it to work in ESP-IDF (does not matter whether that was with PlatformIO or another tool), you can straight skip to the point where you recompile the Arduino-ESP32 static libraries with the tool above since you should know about all the needed sdkconfig and header changes (<-- if any).

My experience with that was extremely bumpy as the tool did not quite work smoothly. One has to pay extreme attention to what ESP-IDF version one uses too, it has to be the same as the Arduino-ESP32 core uses. Note that currently PlatformIO lags behind, Arduino-ESP32 has had a 2.0.0 release but due to missing equalization with platform-espressif32, they are still working on it. Currently PlatformIO uses the 1.0.6 core release based on some ESP-iDF 3.3 version. It may be worth waiting until PlatformIO has also 2.0.0 core support.

OK, thank you very much for your help, I will try it during some long evening.