2022-01-31 09:03 AM
I have a project in a workspace in STM32CubeIDE, generated with STM32CubeMX. I would like to duplicate the entire project, including the .ioc information, to use as the starting point for a new project. How can I do this? I am amazed that this topic does not seem to be covered in the STM32CubeIDE User Guide.
If I copy and past the project in the STM32CubeIDE Project Explorer window, it does create a new project, but many names are still those of the old project, and various files are still referencing the old project.
This is such a common task to want to accomplish. How can there not be a straightforward way to do it?
2022-02-02 11:52 AM
@msch It actually *is* this simple. I've used Atollic for few projects, then updated to CubeIDE, and this way still works for me. Of course you need be careful not to have any absolute paths.
The <storageModule moduleId="cdtBuildSystem ... thing in .cproject indeed is not renamed, but does no harm as you've noticed.
The .ioc file needs a manual fix, yes. After a short practice this is not a problem.
I delete the .mxproject files immediately, they do nothing good and are not required to use the MX.
So... would be nice to have but absolutely not a major issue or show stopper.
As for "CDT" projects - i's not clear what you mean by this. Maybe, unmanaged/makefile projects? Both managed and unmanaged types are "CDT".
Internal builder for managed builds does not leave behind a lot of junk generated makefiles. Less confusion for beginners.
-- pa
2022-02-03 09:07 AM
And this is very cool, btw. Kudos to Tilen Majerle!
2022-02-04 12:59 AM
Ohh... There is no "automated process" for this. But I have a couple of things that makes life easier.
You are going to have to copy both files and settings manually from one project to another. It might be easier to launch two instances of CubeIDE when copying the build settings. File copy is easy drag-drop in one IDE instance. But for build setting you can only have the build settings dialog of one project open concurrently. Hence I would say start the new CDT project in a new workspace initially. Especially if your migrating many projects from MX to CDT :)
My migration process would be roughly (maybe I already wrote it in another thread?):
You can do the same thing with symbols
The rest of the settings has to be reviewed manually. But t least this will simplify the most painful exercise...
That to me summarizes the workflow. This is complicated if you rely on additional tools to generate code like TouchGFX Designer. Then you may also need to re-consider how/where this tool generates files and how to best manage them in the new project...
Also people starting from example projects with linked resources cannot really follow this path. The linked resources are the obstacle which will making copying files impossible. But the linked resources can be resolved if the example is imported using the MCUFinder/CubeMX wizard in CubeIDE isntead of the normal Eclipse import frameworks. I hope that makes sense...
2022-02-04 08:25 AM
Ok, I get the picture. A nuisance, but one only has to do it once (per project).
Aside from being able to change the MCU, are there any other advantages over just leaving a project as an MX project? And in a CDT project, what information does CubeIDE take from the MCU setting? In other words, if I change the MCU setting, what things will be automatically changed in the project?
2022-02-07 04:49 AM
Advantages... Well since CubeMX does not manage the project you are free to modify any setting and add/remove any file without having to consider that MX may own some resources. On the other hand you lose MX GUIs and automated code generation completely. So in a nutshell you make the choice between "flexibility" vs "automation".
2022-02-07 06:30 AM
"As for "CDT" projects - i's not clear what you mean by this."
When saying "CDT" projects, I refer to the native Eclipse/CDT project format.
Opposed to "STM32Cube" or "Empty" project which were once we originally created for CubeIDE. As things evolved we fixed some issues allowing our "build and debug" tools to work with CDT projects, which makes this project format a viable option.
Trying to explain the concepts you bring up I would look at it in a tree representation:
The choice between internal vs external builder is primarily based on which of the two builders that has the most traction in the Eclipse/CDT community. External build had (have?) more momentum when we introduced CubeIDE. TrueSTUDIO relied on Internal builder and we considered changing to external, but never got that far.
I hope that clarifies some parts.
2022-02-07 08:21 AM
Ok. Could you address the second part of my question? If I change the MCU setting in a CDT project, what will happen? Is it just changing some of the flags that are passed to the toolchain? Anything else?
2022-02-07 08:23 AM
Thank you, that's a good explanation.
2022-03-01 01:24 AM
Changing MCU does two things:
2022-07-19 04:11 AM
You cannot just copy a project and open it in the same workspace. It seems that this conflict is related to the indexing of projects by name. And two identical names are not allowed.
But you can do it like this.
Method 1.
Import the aligned project into a new workspace
Method 2
1. Copy the project folder to a new location (file manager)
2. Rename the project to Stm32CubeIDE (for example, add its previous version to the name)
3. Import the copied project into Stm32CubeIDE (essentially with the old name)
Method 3.
Manually edit the project files ".project" and ".cproject". These are normal xml files.
In the ".project" file, the project name is contained in the tag
projectDescription->name
There are more tags containing the project name in the ".�?project" file. It is better to carefully drop them all through a file search.