How to import existing C/C++ source files into STM32CubeIDE

In STM32CubeIDE, first create a folder for your source files to reside in. In order to do this, right click on your project and select New -> Folder:

Step 1: Create folder

In the dialog that opens, select the correct location (project & optionally subfolder) where the folder will be created. For this example, we’ll use occutils .

Step 2: Import files

Right click on the folder where you want to import the files into and click Import:

Now click General -> File system.

In the dialog that opens, select the From directory where you want to import the files from.

and click Finish. After that, your files will be included in the project.