cancel
Showing results for 
Search instead for 
Did you mean: 

What is the best way to duplicate a project in a workspace in Stm32CubeIDE?

scottSD
Lead

Using Stm32CubeIDE 1.3.0...

When I Copy and Paste a project in the Project Explorer (and name differently), it does copy the project. I also renamed the CubeMX IOC file to match the new project name. Then I did a Clean and a new Build.

However, when I go to Debug, I get a number.

To verify that the new project is using the new project paths I do a "Close" on the first project, then rename the old project in Windows Explorer.

Builds fine, but when debugging it is complains that it can't find source files.

It is still looking for the source files in the original project.... I changed the source lookup path in the Debug Configurations > Source to look in this project, and it still cannot find the files.

And when checking if there are any files in the new project's Debug folders, they are indeed empty.

 Does anyone have an idea how to fix this?

1 ACCEPTED SOLUTION

Accepted Solutions
scottSD
Lead

I did get this to work following the following steps:

1) Edit > Copy.

2) Edit > Paste.

3) Rename the ioc files.

4) Delete the Debug.launch file.

5) Project > Clean.

6) Generate the CubeMX.

7) Project > Build Project.

8) Debug As Stm32 Application.

9) And debug the application.

View solution in original post

10 REPLIES 10
Pavel A.
Evangelist III

IMHO the quickest, most reliable procedure to fix such errors is :

* close the project

* delete it in eclipse (this will only remove the project from workspace and purge the accumulated debris)

* import it again into the workspace

* Refresh, clean, rebuild index

* build

-- pa

scottSD
Lead

I did get this to work following the following steps:

1) Edit > Copy.

2) Edit > Paste.

3) Rename the ioc files.

4) Delete the Debug.launch file.

5) Project > Clean.

6) Generate the CubeMX.

7) Project > Build Project.

8) Debug As Stm32 Application.

9) And debug the application.

LMI2
Lead

With Keil, I simply copy and paste project folder. I get something like old_project_copy folder, then I rename only the folder name. Files inside keep their names. When I changed file names too, I got errors.

@LMI2​  I appreciate the input. I am using Stm32CubeIDE and this post is tagged for it as well.

inotec
Associate III

Below cloning works, but I found that in my case it deletes src folder in the old project, so that file needs to be copied back to the old project! Do this by making 2 copies…

1) Copy and paste 2 copies

2) Rename new folder (Copy 2)

In new folder…

3) Rename the ioc files.

4) Delete the Debug.launch file

5) Open IDE project in MXIDE

6) Rename project

7) Project > Clean.

8)Build

9)Open .ioc

10) Generate the CubeMX. THIS will delete src folder in the original folder.

11) So delete the original folder and change name of –Copy folder  back to the original name

12 Project > Build Project.

13) Debug and test

AKall.2
Associate II

Remember to have the project in debug configuration set active, otherwise for me it causes missing source files upon trying to debug.

Thanks for the help
Rajat
Associate

To copy an STM32CubeIDE project:

1. Make sure the new name does not exist in the workspace, if it does, then

delete it inside the IDE. Make sure old project is error free.

2. Copy the folder in explorer

3. Rename the folder in explorer

4. Edit .project using vi or other text editor and rename

  <name>OLD_PROJECT_NAME</name> to <name>NEW_PROJECT_NAME</name>

  in line 3

5. Edit .cproject

  Change all references from OLD_PROJECT_NAME to NEW_PROJECT_NAME

6. Start IDE by clicking on .project

7. Import should start automatically.

8. Use your new project and enjoy!

Thank you, Rajat!

Very helpful!