Electronics > Microcontrollers

How to duplicate a ST32F4 Cube IDE project on another PC?

(1/2) > >>

peter-h:
I am posting this solved issue in case it helps somebody.

Cube has many "Import" options, plus "Open file" options. However, while this should be absolutely totally bloody trivial, none of them worked. It would complain about Can't overwrite an existing project, or a button was greyed out without an explanation. Well, it was written in Java, and Java programmers are paid $10 per opcode :) :)

I have Cube v1.6.1 (the latest, I am not updating anymore) installed on two machines.

The existing project is on one, under c:\projectname\project1.

In it are these files and folders

12/05/2021 18:53      169,656 .cproject
05/10/2020 15:37      84,465 .cproject_org
07/12/2020 19:00       1,744 .project
05/10/2020 15:37       1,898 .project_org
09/04/2021 20:51  <DIR>     .settings
09/04/2021 20:51  <DIR>     CMSIS
12/05/2021 18:53  <DIR>     Debug
09/04/2021 20:52  <DIR>     HAL_Driver
10/05/2021 16:24  <DIR>     inc
14/09/2020 15:55        447 Kxx-SWD.xml
28/10/2019 12:41        440 Kxx.xml
12/05/2021 18:58       6,673 LinkerScript.ld
09/04/2021 20:52  <DIR>     Middlewares
10/05/2021 16:24  <DIR>     src
09/04/2021 20:52  <DIR>     startup
07/05/2021 11:39       8,916 TestCPPProject (1).launch

and that seems to be standard.

On the other machine I created c:\projectname\project1 and copied the above data there.

Of course I googled all over the place, like everybody does, and this is a common issue, all over the place, but all the advice is old, from say 2017, when it was different software. Just different enough...

Then I had an idea. Even when I copied the data into project2, hoping to import that into a project in project1 (project 1 dir did not exist at the time!) it complained that project1 already exists, so obviously there was some reference to "project1" in the project files... So, maybe Cube is storing project config somewhere else also, not within the above project directory (folder). Perhaps in the registry, which would be a bit messy to copy over. But it was simple. When I copied over the following rather usefully named directory (btw the original install was 1.4.0, then updated online to 1.6.1)

C:\ST\STM32CubeIDE_1.4.0\STM32CubeIDE\configuration

from the source machine to the target one (obviously with Cube not running) and started up Cube on the target one, it just came up, whole project on-screen :)

The obvious implication, unless I am doing something wrong, is that to backup a Cube project you have to back up not just the project directory but also the above Configuration directory in c:\st.

You might still have fun with the debugger not connecting, but again that one (esp. the cryptic "joined drives" error) is aaaallll oooover the internet too :) On the win10 machine it went away after some reboots, and ticking all the boxes for private and public networks for the debugger, when the win10 "do you want to give this thing access" window pops up.

Win10 installs also don't show up the weird bug I get on win7-64, where you see a load of blank lines when the project is being built. Looks like a display driver issue.

DavidAlfa:
Import...existing project.... Select your project folder.
Then your project should show up, click on finish, done.
Check the video for the T12 firmware, It shows exactly that:

peter-h:
Nope.

That video is so fuzzy it is barely readable.

Yes the project1 project did show up, but it would not import it. Maybe it has to first be Exported by the previous system?

alexanderbrevig:
Export mad import should probably work. Honestly though, you should look into git. I always make sure I can clone my projects to lay computer, and follow my README to get it up and running.
I find it useful to document the setup while it is top of mind.

Good luck!

tru:

--- Quote from: peter-h on May 13, 2021, 12:24:23 pm ---Nope.

That video is so fuzzy it is barely readable.

Yes the project1 project did show up, but it would not import it. Maybe it has to first be Exported by the previous system?

--- End quote ---
In the past I've encountered this very same problem.  STM32CubeIDE will refuse to import when the project name is referenced in another project that already exists in your workspace, or referenced in another project that you're trying to import with the new one.  This happens whenever I make a copy of an existing project and rename the project folder to say v2.

The solution I've found that works is to manually edit (e.g. find and replace with NotePad++) the old project name references with the new project name within these files:
.cproject
.mxproject
.project
[projectname].ioc

Also, the .ioc file needs renaming to the new project name.

Then in STM32CubeIDE you can import using the "File/Open Projects from File System...", select the "Directory" button, browse to the root/parent folder of where your projects are stored in, then I prefer to "Deselect All" and tick only the projects I want to import.

Navigation

[0] Message Index

[#] Next page

There was an error while thanking
Thanking...
Go to full version