cancel
Showing results for 
Search instead for 
Did you mean: 

Recommended approach for duplicating projects with STM32 CubeID for VSCode v3.x

nk7
Associate

I'd like to clone an existing STM32 C project with CMake that I've previously setup. I've seen posts about how to do this on STM32CubeIDE but none using the VSCode extension.

Currently, I'm aware of 2 methods:

  1. Cloning `.ioc` file
    • Clone the `.ioc` file into new folder with <New Project Name>.
    • Find and replace any <Old Project Name> references with <New Project Name> in the `.ioc` file.
    • Open the updated `.ioc` file in CubeMX and generate code.
    • Copy over any user code from the original `main.c`.(a bit tedious depending on how much user code there is)
    • Copy over any libraries and recreate any symlinks.
    • Build project

  2. Copying the whole project folder and renaming
    • Copy entire project folder and rename it.
    • Find and replace all occurrences of <Old Project Name> with <New Project Name>.
    • Try building and fix any errors that pop up.


Method 1 feels safer but is more tedious than method 2.

Is there a neater way to do this that doesn't involve manually replacing values? (i.e. without find and replace)

I also briefly recall seeing something about ST planning to add a 'Clone Project' feature to the next version of the extension but can't seem to find the post anymore.

Any pointers would be appreciated.

EDIT: Clarity

2 REPLIES 2
Nawres GHARBI
ST Employee

Hi @nk7 

please install the latest version 3.8.0 and try it using the convert menu, it makes you able to convert a project to VSCode project

Screenshot 2026-03-10 221610.png

Thanks @Nawres GHARBI 

However, my question was about how to duplicate existing VSCode projects in clean way.

Sorry if my question implied I was working with STM32 Cube IDE projects. To be clear, I would like to know the best way to clone STM32 Projects that already use the VSCode extension.