cancel
Showing results for 
Search instead for 
Did you mean: 

How to clone/copy an STMCube Example project

cc2
Associate

Hello,

I'm new to STM32Cube-IDE (and Eclipse). Normally I use the ARM-gcc toolchain and do assembly coding.

I managed to create a New STM Project by using the Example Selector tab in the Target Selection window.

In this case it was the BSP Example for the B-U585I-IOT02A Discovery Kit (with the STM32U585 chip).

 

After modifying the code in accordance with how-to-use-semihosting-with-stm32cubeide  the code runs OK.

 

Now I would like to COPY the Project and edit that.

 

From the multiple "how to clone a project" threads it appears that this is not trivial. (?) One of the threads I read was from 2022 and IDE version 1.8. It seemed that multiple otherwise experienced developers found it odd that this wasn't a straightforward task.

 

Manually copying and search/replace seems very odd and error-prone.

Has there been any progress on automating this?

 

 

In my case there aren't even any .ioc or .project files.

 

As expected, the following don't work:

Simply copying the Project's directory (in the Workspace directory)

Using File->Open Projects From File System...

 

 

For now, I have created a new workspace and reimported the STM32Cube Example. But now I have to redo the edits and modifications to get the semihosting working again...

 

 

As an aside, at the end of the Example import I get the following (not very informative) error (which I ignore).

 

Screenshot 2024-08-11 at 02.02.14.png

 

1 ACCEPTED SOLUTION

Accepted Solutions
Pavel A.
Evangelist III

This is very fast and straighforward:

1. Copy the project directory (so that it is on same directory level, to avoid relative issues)

2. Delete all eclipse dotted sub directories. Keep only .project and .cproject dot files.

2 Edit the .project file and change only the project name there. 

Done. Now import the new project into Eclipse and do REFRESH.

 

View solution in original post

2 REPLIES 2
Pavel A.
Evangelist III

This is very fast and straighforward:

1. Copy the project directory (so that it is on same directory level, to avoid relative issues)

2. Delete all eclipse dotted sub directories. Keep only .project and .cproject dot files.

2 Edit the .project file and change only the project name there. 

Done. Now import the new project into Eclipse and do REFRESH.

 

cc2
Associate

Thank you Pavel!

That was indeed pretty easy

In <proj-name>/STM32CubeIDE subdirectory I only had .osx.project (empty) and .settings/ (some prefs and language settings) in addition to .cproject and .project. I didn't bother deleting those.

File->Import->General->Existing Projects into Workspace  seems to have done the trick.