cancel
Showing results for 
Search instead for 
Did you mean: 

STM32CubeIDE changes "Preprocessor" and "Include paths" settings whenever the code is updated

irene
Associate II

I created a new project on STM32CubeIDE and I'm using the code generated by the software itself when I set the MCU pinout configuration using the Device Configuration Tool (.ioc file, aka the STM32CubeMX interface). Whenever I modify the pinout (i.e. the .ioc file), the generated code is updated, but file settings are refreshed. Therefore, every time I modify the pinout I have to set up again all the settings, like Properties -> C/C++ Build -> Settings -> Tool Settings -> MCU GCC Compiler -> Preprocessor and Properties -> C/C++ Build -> Settings -> Tool Settings -> MCU GCC Compiler -> Include paths.

Is this a bug or is there a way to set up "fixed" settings?

I'm using STM32CubeIDE Version 1.0.2.

15 REPLIES 15

In fact, "Core/Inc" comes up after code regeneration and it causes a warning in the project. As for the ordering issue relatated to the preprocessor, I haven't provided a screenshot yet. You simply notice that items appear in a different order.

Please share preprocessor defines too. Wil help.

 "Core/Inc" comes up after code regeneration: which action is leading to ?

Attached the preprocessor, before and after code re-generation.

As for the wrong include entries automatically added after the code re-generation, they have to be manually deleted, to avoid warnings.

"Core/Inc"

"Drivers/..."

I think it is clear from the first screenshot. I don't have a clue why they come up.

Ok thanks for sharing.

I've done myself test about using my F302 based project and IDE 1.5.0 release.

I've no issue if includes (if some i may have been angry about earlier ...). But i can confirm preprocessor defines order is not preserved. To be honest I've not paid attention to because not disturbing me too much as fully functional whatever ordering.

From your knowledge (I've not such) is jeopardizing preprocessors defines ordering may be an issue ?

The issue of the wrong entries in the include paths may be due to the fact that the ioc file was at the beginning generated using the CubeMX. Anyway I don't know how to fix it, besides re creating a new ioc from inside the cubeide. As for the second issue, related to the preprocessor defines ordering, it should be considered as a minor issue, since it makes the code less neat, especially with long define lists.

Agree about fact having order jeopardized is a pain but not functional issue. Would advice too ST to fix.

About .ioc ... I guess best way of working here if relying on a STM32CubeMX one is to rely on File > New > STM32 project from an existing .ioc file.

Most probably if you've done copy / paste you're mixing non compliant data each others. I'm especially thinking to some project modes setups which are directly impacting relative paths setup because project structure are not same. Such project options are Basic / Advanced and Under root / Non Under root is refering to STM32CubeMX project manager panel UI.