Author Topic: How to duplicate a ST32F4 Cube IDE project on another PC?  (Read 793 times)

0 Members and 1 Guest are viewing this topic.

Offline peter-h

  • Super Contributor
  • ***
  • Posts: 1126
  • Country: gb
  • Doing electronics since the 1960s...
How to duplicate a ST32F4 Cube IDE project on another PC?
« on: May 13, 2021, 08:38:03 am »
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.
« Last Edit: May 13, 2021, 09:07:50 am by peter-h »
Z80 Z180 Z280 Z8 S8 8031 8051 H8/300 H8/500 90S1200 32F417
 
The following users thanked this post: ucanel

Online DavidAlfa

  • Super Contributor
  • ***
  • Posts: 1773
  • Country: es
Re: How to duplicate a ST32F4 Cube IDE project on another PC?
« Reply #1 on: May 13, 2021, 09:41:40 am »
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:
« Last Edit: May 13, 2021, 09:45:04 am by DavidAlfa »
Hantek DSO2x1x            Drive        FAQ
Stm32 Soldering FW      Forum      Github      Donate
 

Offline peter-h

  • Super Contributor
  • ***
  • Posts: 1126
  • Country: gb
  • Doing electronics since the 1960s...
Re: How to duplicate a ST32F4 Cube IDE project on another PC?
« Reply #2 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?
« Last Edit: May 13, 2021, 12:36:33 pm by peter-h »
Z80 Z180 Z280 Z8 S8 8031 8051 H8/300 H8/500 90S1200 32F417
 

Offline alexanderbrevig

  • Frequent Contributor
  • **
  • Posts: 602
  • Country: no
  • Musician, developer and EE hobbyist
    • alexanderbrevig.com
Re: How to duplicate a ST32F4 Cube IDE project on another PC?
« Reply #3 on: May 13, 2021, 02:08:05 pm »
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!
 

Offline tru

  • Regular Contributor
  • *
  • Posts: 86
  • Country: gb
Re: How to duplicate a ST32F4 Cube IDE project on another PC?
« Reply #4 on: May 13, 2021, 03:15:56 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?
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.
 

Offline peter-h

  • Super Contributor
  • ***
  • Posts: 1126
  • Country: gb
  • Doing electronics since the 1960s...
Re: How to duplicate a ST32F4 Cube IDE project on another PC?
« Reply #5 on: May 14, 2021, 01:10:24 am »
Yes that explains it completely.

What a stupid system :)
Z80 Z180 Z280 Z8 S8 8031 8051 H8/300 H8/500 90S1200 32F417
 

Online Doctorandus_P

  • Super Contributor
  • ***
  • Posts: 1824
  • Country: nl
Re: How to duplicate a ST32F4 Cube IDE project on another PC?
« Reply #6 on: May 14, 2021, 01:29:55 am »
I do not care much for any particular IDE, and recently I wanted to experiment a bit with GRBLhal, and it also had a project file for some IDE that was unknown to me.

I do not care much for makefiles either, but as long as the're short and simplistic they are sort of manageble, and they are also very portable. So I took a makefile I found somewhere and started tinkering a bit with it, and I got GRBLhal to compile (& flash & run) in a few hours time.

Note that I'm a relative beginner with STM32. I have not tinkered with compiler flags in the attached makefile (yet). Currently they're just the same as what was already present in that "other" project.

I'll share it here so you can do anything you wish with it.
 

Offline peter-h

  • Super Contributor
  • ***
  • Posts: 1126
  • Country: gb
  • Doing electronics since the 1960s...
Re: How to duplicate a ST32F4 Cube IDE project on another PC?
« Reply #7 on: May 14, 2021, 08:54:23 am »
With today's fast PCs, an IDE is hardly needed and one could just compile and link with a batch file, or run a makefile which is how it was done since for ever. What you then don't get is the debugging environment which is really powerful nowadays.
Z80 Z180 Z280 Z8 S8 8031 8051 H8/300 H8/500 90S1200 32F417
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf