2026-05-03 4:00 AM
Hi,
using STM32CubeIDE 2.1.1 and STM32CubeMX 6.17, I'm a little confused on how to import an existing ioc-file created by CubeMX into an existing project in CubeIDE. And to later modify it.
Confusion is drawn from this tutorial: https://community.st.com/t5/stm32-mcus/stm32cubeide-2-0-0-workflow-tutorial/ta-p/864831
At the end, it is somehow saying to use the import function of CubeIDE for an ioc-File which is located (physically) on a different location than the project itself (ioc-file in §2.3 tutorial c:/users/ST/Documents while project is in workspace 2.0.0, from which I assume it is stored in a different folder).
Then, later on in §2.5, MCU gets some modification (added I2C in the example) and code is newly generated (in c:/users/ST/Documents and CubeIDE requires a refresh (F5) to capture the updated MCU configuration) (see also equivalent video tutorial at around 4:05min)
So good, so confusing. Why?
1) CubeIDE shows the ioc-file in the project tree, and is physically stored in the folder as the project (see attached screenshot)ioc-File in product tree and storage location
Note that workspace is "Cpp_KeithBentely" (I'm investigating usage of C++).
So why is the ioc-File not directly saved in the location of the project? And the need to refresh is somehow indicating that there is a link between the ioc-File generated by CubeMX and the ioc-File used by CubeIDE. As, hopefully made clear enough, there are two ioc-files ... Shouldn't be one sufficient?
So, why not simply doing something like, where the new ioc-file is directly stored inside the workspace's folder on the harddisk. Note that project location is actually the workspace!
What I simply fear is something might be broken by doing so. Bascially because I haven't understood this eclipse-world just to a minor fraction in best case.
End of Question 1.
Question 2:
In the tutorials of CubeIDE 2.x it is said that CubeMX shall be launched separately to modify the MCU's configuration. Hm, I still can double click on the ioc-File in CubeIDE and CubeMX opens. Is this, even possible, forbidden to do?
You see, I haven't understood the new philosophy. I hope you can help in put some light into the dark.
2026-05-03 9:51 AM
> Note that project location is actually the workspace!
Not sure about CubeIDE 2.x behavior, but generally Eclipse CDT does not like when a project root directory is same as the workspace directory. This isn't forbidden explicitly but known as a sure recipe for problems.
2026-05-03 11:06 AM
Not sure about CubeIDE 2.x behavior, but generally Eclipse CDT does not like when a project root directory is same as the workspace directory.
Probably some misleading wordings in the GUI of STM32CubeMX - I had similar thoughts as you, but at the end, in conjunction with "Project Name" a sub-folder is created (named what has been entered in the field "Project Name") under the folder "Project Location", which actually STM32CubeIDE will identify as workspace later on.
So, with "Project Name" = "Cpp_KeithBentley" and "Project Location" = "51_Cpp_Test" I get the folders as shown below, and its equvialent in CubeIDE
File Locations
View in CubeIDE
So root directories are actually not the same. The project is one level below.
Despite, what came into my mind is that there seems to be a link between the original ioc-file and the imported one. I.e. the imported ioc-file at one physical location is still linked to its origin at another physical location. So when taken from another project it will updated also when its original has been updated. Kind of bad if not desired. A solution could be if it is possible to break that link - any chance to do this?
2026-05-03 1:11 PM - edited 2026-05-03 1:12 PM
Well, then to the point of importing .ioc file into existing CubeIDE project.
Was the project initially created by some version of standalone CubeMX or integrated in CubeIDE 1.x?
Not all CubeIDE projects are (or must be) associated with .ioc files. They are just sort of Eclipse CDT projects. Many older examples are not based on CubeMX at all.
AFAIK if a project has not been created with CubeMX, there is no any "automatic" workflow for adopting CubeMX generated code into it. The merge can be done manually, it's boring but not a rocket science.
The change from CubeIDE 1.x with integrated CubeMX is that standalone CubeMX (the only option for CubeIDE 2.x) no longer insist that .ioc file must be in certain location or has the same name as the Eclipse project. It just generates the new code where ever the .ioc file happens to be. If you just put a .ioc file in existing project, generation with standalone CubeMX can corrupt the existing project. Take caution, make backups, merge new and existing code carefully.