2023-07-20 03:23 AM - edited 2023-07-20 05:33 AM
A usual approach is to branch from a given project by making a copy of it and develop further on the copy, leaving the original intact.
How can this be achieved in the STM32CubeIDE project tree?
I tried it by copying the directory in the filsystem, to a different directory, edited every file containing the original project name to the new one. Even edited the .metadata and every occurence of the original name in the new directory tree. It lead to an existing new entry in the tree view Could be that I even did an Import by browsing to that new directory.
But the result was that I was said it not being a CDT project when I wanted to open the properties on the new project icon.
What is a safe way to do achieve this?
Solved! Go to Solution.
2023-07-24 12:27 AM - edited 2023-07-24 12:28 AM
@Piranha wrote:CubeIDE, as every Eclipse based tool ... allows every developers to works as he prefer
That is exactly the thing the Eclipse's workspace and overall design doesn't allow. Read this post for details. If
I must say that - from my own experience - the "copy/paste in the project tree"-method worked for me and is *the* solution. I have no links in my projects. Maybe there are problems when one is using links.
2023-07-20 05:56 PM
I'm not sure that CubeIDE etc is set up to gracefully do this.
I've found that simply copying the project leaves a lot of links in that make problems for you later (like links back to previous locations).
What I've done is a brute force approach.
Copy the main.C program to another reference directory.
Copy the .IOC file to another directory.
Hopefully, you've got a standard structure for directories and the like (I do...)
It's not graceful, but it seems to work. Eclipse (and CubeMX) don't seem to have a "clone project to another directory" capability. I'd like to find one.
Hope this helps a bit.
2023-07-21 01:08 AM
CubeIDE, as every Eclipse based tool has a lot of flexibility that can be powerful or complex, depending on our experience and expertise with the IDE. In my opinion it is a good thing because it allows every developers to works as he prefer (with an initial cost to pay in term of time).
In your case a simple solution is to put all source files inside the project folder, that is the folder containing these elements:
The above SimplePrj example show this case. I generated it from the IDE using the [File > New > STM32 Project] menu command. Now, If I want to move that project I can copy and paste the project folder. To rename the project there are two options:
Not always it is convenient to put all files inside the project folder, for example when you want to share some files between multiple projects (like the ST Middleware).
Another thing that can create issue in your scenario is if your project is using linked resources or virtual folder.
In the above example (available in ElooMTX-SDK in the stm32-hotspot github) the files highlighted in blue are real files inside the Src folder, but the files with a little arrow icon mark, like the red highlighted, are linked resource, that means the real file can be anywhere in the file system. This can be an issue when you copy and past the project folder.
Last thing, be careful also at the way you specify the project settings. The recommendation is to use paths relative to the project folder like in the below image.
Have a good development time with STM32,
Stefano
2023-07-21 01:32 AM - edited 2023-07-21 01:32 AM
Thanks to you both, Harvey and Stefano,
meanwhile I learnt that there exists the most intuitive way to clone a project in the project tree is - and that's was I was initially hoping it would work, but I was unable to detect the right protocol to do it - that you simply select the project with a right mouse click, click copy, then paste (leaving the selection as it is which is a bit confusing since no one wants to paste something into a selected item). You are the asked for the new name (default is the existing name with an incremental number attached). So easy.
2023-07-23 06:06 AM - edited 2023-07-23 06:18 AM
CubeIDE, as every Eclipse based tool ... allows every developers to works as he prefer
That is exactly the thing the Eclipse's workspace and overall design doesn't allow. Read this post for details. If ST would make an IDE based on, for example, Code::Blocks, that could be a decent and worthy IDE. Now CubeIDE is just another bloated under-performing Frankenstein with PITA usability like all Eclipsoids are.
2023-07-23 06:29 AM
This is one of the reasons the Arduino community is so big, just rename a file.
2023-07-23 08:45 AM
When you do a copy, you must make sure that the files you are editing, if you edit and use linked files, are the ones you think you want, not the ones in the older project. Eclipse has an awkward way of linking files.
I have a project with included files common to all such projects. I have to put in absolute paths or eclipse won't find the files, (nor will it tell me where it THINKS they are). Yet in other parts of the project, the workspace paths work just fine.
2023-07-23 08:49 AM
I have a very large and versatile swiss army knife. It has computer tools and just about everything else I might need, including a spatula (and no idea why, makes me wonder about the designers).
It is not what I'd call a rapid deploy tool.
In that sense, it's a lot like CubeMXIDE and Eclipse itself.
There are times that I suspect that the people who write the tools never use them, otherwise, they'd fix stuff, now....
2023-07-23 11:21 AM - edited 2023-07-23 04:06 PM
There are times that I suspect that the people who write the tools never use them, otherwise, they'd fix stuff, now....
This! It is the case for these:
That is apart from some people and whole teams being simply incompetent and incapable of doing better even if they tried...
2023-07-23 10:01 PM
@Piranha wrote:
- Eclipse, especially it's broken Workspace concept.
I already had to reinstall Eclipse once, because I couldn't find a way to solve this.