Skip to main content
Visitor II
June 19, 2026
Question

CubeMX2 generated project does not cover all FreeRTOS INCLUDE* defines and cannot edit FreeRTOSConf.h

  • June 19, 2026
  • 1 reply
  • 44 views

We wanted to migrate our project to the new C5 MCU family, requiring the use of the new app STM32CubeMX2.

In our project, we rely on quite a lot of features from FreeRTOS, for example the function `xTaskGetIdleTaskHandle()`.
This function gets compiled only if the variable `INCLUDE_xTaskGetIdleTaskHandle` is defined and set to 1, but by default its value is 0.

In our project, when used with CubeMX1, we defined this variable in a /* USER CODE BEGIN 1 */. But with th new project structure enforced by CubeMX2, we no longer have user code blocks in that configuration file, and any regeneration in CubeMX2 will override any user change (well, we have a prompt saying the file was edited, but no smart-merge).

From CubeMX2, it is not possible to set this include variable (checked “Core → Advanced API Selector → More”).

 

Therefore, the only (hacky) solution I see is to set this include variable to 1 in CMakeLists.txt. IMO, this is not a solution but a workaround.

Either CubeMX2 should manage all configuration variables of FreeRTOS, or we should let the user modify this file.

Any help is welcomed.

1 reply

ST Technical Moderator
June 23, 2026

Hello ​@TheBigBadBoy 

Thank you for bringing this issue to our attention.

I reported this internally.

Internal ticket number: CDM0063777 (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