How to move from SW4STM32 to STM32CubeIDE

Revision as of 14:31, 2 November 2020 by Bich Hemon (talk | contribs) (Import an SW4STM32 project without an ioc file)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

1 Import an SW4STM32 project with an ioc file[edit]

If the project already contains an ioc file, the easiest way to import the project into a working STM32CubeIDE environment is to copy it and open the copy through STM32CubeMX stand alone, then, in the Project Manager, change the Toolchain / IDE to STM32CubeIDE and regenerate the project.

After the project is regenerated, go to [File]>[Import...] and choose to import it as an Existing projects into Workspace.

Import an existing project with an ioc file - Figure 4

Then copy the code inside the different /* USER CODE BEGIN */ blocks that exists in the project into the new STM32CubeIDE environment.

2 Import an SW4STM32 project without an ioc file[edit]

To make sure the project gets a hierarchical structure, the recommended way to is to go to [File]>[New]>[STM32 Project] as shown below.

Menu option for a new STM32 project - Figure 1

Select the device for the project being imported and click on [Next >].

When setting up the project as shown below, make sure the Targeted Project Type is set to Empty and click on [Finish].

Project setup with targeted project type selected as empty.

After the empty hierarchical project is generated:

  1. Go to [File]>[Import...].
  2. Import the SW4STM32 project as Import ac6 System Workbench for STM32 Project
  3. Copy and paste the project content into the sub-project of the empty project by means of STM32CubeIDE project explorer as shown below
Copy project content to empty sub-project.
Info white.png Information
It is not recommended to import the .cproject, .project or .settings files.

It is important to remember to also configure the same build settings that was used previously while the project was in the SW4STM32 environment. If the project contains linked resources those needs to be updates to point to the correct resource in the file system. This process is necessary because when importing a project from SW4STM32 without any special treatment and that does not have an ioc-file then it will be imported into STM32CubeIDE with a flat project structure.