Difference between revisions of "How to get started with STM32CubeIDE from scratch"

[unchecked revision] [quality revision]
m
m
 

1 Create a new STM32 project[edit]

To start a new project, go to [File]>[New]>[STM32 Project].

Menu option for a new STM32 project - Figure 1

Select the desired STM32 device or board. Demonstrated below, the selected board is the STM32MP157C-EV1. Click on [Next >].

Target selector in STM32CubeIDE - Figure 2

After the target selection, the project setup step shown below has to be done. The Targeted Project Type setting determines whether the project gets generated by STM32CubeMX or not. An empty project is a skeleton of a project that needs building upon while STM32Cube indicates an STM32CubeMX-managed project.

Project setup - Figure 3

2 Create an empty project based on the template in the STM32CubeMP1 Package[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 template 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 made for 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.

3 Import a project from the STM32CubeMP1 Package[edit]

In order to import the STM32Cube firmware project into STM32CubeIDE, go to [File]>[Import...] and select Import ac6 System Workbench for STM32 Project as shown in Figure 10 and click on [Next >].

Import of firmware project into STM32CubeIDE

Then select the correct project. A project example is by default located at $HOME\STM32Cube\Repository\STM32Cube_FW_MP1_VX.X.X\Projects\STM32MP157C-EV1\Examples\ADC\ADC_SingleConversion_TriggerTimer_DMA\SW4STM32\ADC_SingleConversion_TriggerTimer_DMA.'

Firmware project selection

After selecting the project, click on [Finish] to import and build the project.

==Create a new STM32 project==
To start a new project, go to '''[File]>[New]>[STM32 Project]'''.
[[File:IDE_Image13.png|700px|thumb|center|link=|Menu option for a new STM32 project - Figure 1]]

Select the desired STM32 device or board. Demonstrated below, the selected board is the STM32MP157C-EV1. Click on '''[Next >]'''.

[[File:IDE_Image16.png|700px|link=|thumb|center|Target selector in STM32CubeIDE - Figure 2]]

After the target selection, the project setup step shown below has to be done. The ''Targeted Project Type'' setting
determines whether the project gets generated by STM32CubeMX or not. An ''empty project'' is a skeleton of a
project that needs building upon while STM32Cube indicates an STM32CubeMX-managed project.

[[File:IDE_Figure3.png|500px|link=|thumb|center|Project setup - Figure 3]]

==Create an ''empty project'' based on the template in the STM32CubeMP1 Package==

To make sure the project gets a hierarchical structure, the recommended way to is to go to  '''[File]>[New]>[STM32 Project]''' as shown below.
[[File:IDE_Image13.png|700px|link=|thumb|center|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]'''.
[[File:IDE_Image5.png|500px|link=|thumb|center|Project setup with targeted project type selected as empty.]]

After the empty hierarchical project is generated:
# Go to '''[File]>[Import...]'''.
# Import the template project as ''Import ac6 System Workbench for STM32 Project''
# Copy and paste the project content into the sub-project of the empty project by means of STM32CubeIDE project explorer as shown below

[[File:IDE_Image6.png|700px|link=|thumb|center|Copy project content to empty sub-project.]]

{{Info |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 made for 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.{{ReviewsComments|-- [[User:Nathalie Sangouard|Nathalie Sangouard]] ([[User talk:Nathalie Sangouard|talk]]) 12:04, 27 July 2020 (CEST)<br />Why do we mention "" as we are in the article "get started from scratch"}}

==Import a project from the STM32CubeMP1 Package==

In order to import the STM32Cube firmware project into STM32CubeIDE, go to '''[File]>[Import...]''' and select Import
ac6 System Workbench for STM32 Project as shown in Figure 10 and click on '''[Next >]'''.

[[File:IDE_Image7.png|700px|link=|thumb|center|Import of firmware project into STM32CubeIDE]]

Then select the correct project. A project example is by default located at '''$HOME\STM32Cube\Repository\STM32Cube_FW_MP1_VX.X.X\Projects\STM32MP157C-EV1\Examples\ADC\ADC_SingleConversion_TriggerTimer_DMA\SW4STM32\ADC_SingleConversion_TriggerTimer_DMA.'

[[File: IDE_Image8.png|700px|link=|thumb|center|Firmware project selection]]

After selecting the project, click on '''[Finish]''' to import and build the project.
<noinclude>

[[Category:STM32CubeIDE|11]]</noinclude>
Line 34: Line 34:
   
 
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 made for 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.
 
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 made for 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.
{{ReviewsComments|-- [[User:Nathalie Sangouard|Nathalie Sangouard]] ([[User talk:Nathalie Sangouard|talk]]) 12:04, 27 July 2020 (CEST)<br />Why do we mention "" as we are in the article "get started from scratch"}}
 
   
 
==Import a project from the STM32CubeMP1 Package==
 
==Import a project from the STM32CubeMP1 Package==