2025-08-21 6:03 AM
Hello,
I am working with STM32CubeIDE (STM32H7 project, IDE version: 1.15.1, build: 21094_20240412_1041 (UTC)) and I noticed an issue with automatically re-added include paths in my project.
In my .cproject file, the following include entries keep showing up after every build or after CubeMX code generation, even though I do not use these middlewares and don’t even have them installed in my workspace:
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.1384018038" name="MCU GCC Compiler" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler">
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.debuglevel.509112497" name="Debug level" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.debuglevel" useByScannerDiscovery="false" value="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.debuglevel.value.g3" valueType="enumerated"/>
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.optimization.level.811300277" name="Optimization level" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.optimization.level" useByScannerDiscovery="false" value="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.optimization.level.value.os" valueType="enumerated"/>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.definedsymbols.1264016287" name="Define symbols (-D)" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.definedsymbols" useByScannerDiscovery="false" valueType="definedSymbols">
<listOptionValue builtIn="false" value="DEBUG"/>
<listOptionValue builtIn="false" value="DATA_IN_D2_SRAM"/>
<listOptionValue builtIn="false" value="USE_HAL_DRIVER"/>
<listOptionValue builtIn="false" value="STM32H753xx"/>
</option>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.includepaths.153033728" name="Include paths (-I)" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.includepaths" useByScannerDiscovery="false" valueType="includePath">
<listOptionValue builtIn="false" value="../Core/Inc"/>
<listOptionValue builtIn="false" value="../Drivers/Devices"/>
<listOptionValue builtIn="false" value="../Libraries"/>
<listOptionValue builtIn="false" value="../Drivers/STM32H7xx_HAL_Driver/Inc"/>
<listOptionValue builtIn="false" value="../Drivers/STM32H7xx_HAL_Driver/Inc/Legacy"/>
<listOptionValue builtIn="false" value="../Drivers/CMSIS/Device/ST/STM32H7xx/Include"/>
<listOptionValue builtIn="false" value="../Drivers/CMSIS/Include"/>
<listOptionValue builtIn="false" value="../Generic/Inc"/>
<listOptionValue builtIn="false" value="../Drivers/BSP/Components/lan8742/"/>
<listOptionValue builtIn="false" value="../Middlewares/ST/netxduo/common/drivers/ethernet/"/>
<listOptionValue builtIn="false" value="../Middlewares/ST/netxduo/addons/dhcp/"/>
<listOptionValue builtIn="false" value="../Middlewares/ST/netxduo/common/inc/"/>
<listOptionValue builtIn="false" value="../Middlewares/ST/netxduo/ports/cortex_m7/gnu/inc/"/>
<listOptionValue builtIn="false" value="../Middlewares/ST/threadx/common/inc/"/>
<listOptionValue builtIn="false" value="../Middlewares/ST/threadx/ports/cortex_m7/gnu/inc/"/>
</option>
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.languagestandard.429310486" name="Language standard" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.languagestandard" useByScannerDiscovery="true" value="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.languagestandard.value.isoc11" valueType="enumerated"/>
<inputType id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.input.c.556463812" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.input.c"/>
</tool>
I started my project with an old project, removed the middleware, include paths in the settings as well, but they reappear after creating code via ioc file.
Things I tried:
Removing middleware selections from .ioc file (there is no NetXDuo/ThreadX enabled).
Cleaning the project (make clean) and even deleting Debug/Release folders.
Searching the .ioc and .project files for references → nothing explicit to NetXDuo or ThreadX.
Manually editing .cproject to remove them → but CubeIDE / CubeMX re-inserts them.
Online I did not find anything related, although I might have just been blind and oversaw it. :)
Now to my questions / concerns:
Where does CubeIDE pull these include path entries from if the middleware is not enabled in the .ioc?
How can I permanently prevent them from being regenerated?
Is there some cached setting or leftover middleware configuration that I need to remove?
Although, everything still works, it is annoying, since it pollutes the build with unnecessary include paths. The cleaner the code the less prone is it to unwanted behaviour.
Thanks in advance for any hints or explanations!
Best regards,
Bucky1
2025-08-21 6:09 AM
Hello @Bucky1 and welcome to the ST community.
Could you please try using the last STM32CubeIDE (V1.19.0) and the last STM32CubeMX (V6.15.0). This behavior should be solved on the last version. If no please add your .ioc file to this post.
Best Regards.
STTwo-32
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2025-08-21 6:55 AM
Hi STTwo-32,
What a fast response!
I tested this with the latest versions of CubeMX and CubeIDE, but the issue still persists. Due to company policies, I can’t share the IOC file itself. Which specific settings or entries in the IOC file would you have checked?
Also, are there other places where middleware configurations are stored that the code generator uses as a basis?
Best regards,
Bucky1
2025-08-22 1:29 AM
Hello @Bucky1
I suggest you try the "Delete previously generated files when not re-generated":
But as a recommendation, it will be better if you refer to the configuration of your original .ioc file and start a new one to ensure that nothing will be generated will not configured.
Best Regards.
STTwo-32
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.