This article explains how to create an STM32 Arm® Cortex® MPUs
projects with STM32CubeMX and how to import them in STM32CubeIDE.
1. Prerequisites[edit | edit source]
- STM32CubeMX must be installed.
2. Definitions on some generated folders and files[edit | edit source]
Complete definitions are available in the STM32CubeMX user manual.
Here are given only the definitions of files and folders generated systematically whatever the STM32 Arm® Cortex® MPUs
.
- ".settings" folder : contains IDE preferences and settings, includes things like compiler settings, code formatting, and environment variables.
- .ioc : STM32CubeMX configuration for hardware initialization and middleware setup.
- manifest.prop : project manifest version and path to .dts mx for OSTL projects: KERNEL , OPTEE , TF-A and U-BOOT
- .mxproject : stores STM32CubeMX-specific project information.
- .project : contains IDE project metadata such as build configurations.
- .ld : linker script defining memory layout for the Cortex-M33 application in RAM.
- ".cproject" file: contains build settings and configurations specific to the C/C++ project.
3. Create an STM32MP13x lines
project[edit | edit source]
For STM32MP13x lines
, 2 distributions are possible:
3.1. Create a project for a specific board[edit | edit source]
The project is created for a specific ST board.
- Launch STM32CubeMX.
- Create a new project via the menu
File > New Project - Select the board: in the tab
Board Selector, typeMP1inCommercial Part Number, the list of possible boards is displayed. For this example, the selected board isSTM32MP135F-DK. - then click on the button
Start Project - for this example the generated code is the default one , for that approve the proposal to
Initialize all peripherals with their default Mode - then select which software must be generated amongst the 2 possible solutions:
or
The project creation starts loading the IOC file
ThenPinout & Configuration tab appears
In Project manager tab:
- define the name of the generated project in
Project Namefield, - select
STM32CubeIDEinToolchain/IDEfield,
- press
GENERATE CODEbutton to generate the project.
Once project generation done, a new pop up Code Generation appears to indicate that the generation is done.
The generated project is automatically save in the directory identified, previously, in Project Name field (as written in next picture)
This directory can be simply opened (identified as option1 later in the article ) or the project can be opened (identified as option2 later in the article) meaning, imported directly in the STM32CubeIDE.
Screenshots of the generation for Baremetal use case
3.1.1. Structure of STM32MP13 OpenSTLinux generated code[edit | edit source]
If MP13 OpenSTLinux has been selected during this step:
Generated code is :
.settingsfolderDevice treefolder: Each software component has its own folder under "DeviceTree/Project Name/" with relevant ".dts" and makefile files.- Linux kernel,
- OP-TEE secure OS,
- Trusted Firmware-A,
- U-Boot.
.iocmanifest.prop.mxproject.project: this file is used to make the import of the project generated by STM32CubeMX in STM32CubeIDE (Option1).
The picture below shows the project structure after import in STM32CubeIDE
3.1.2. Structure of STM32MP13 Bare metal generated code[edit | edit source]
If MP13 Bare Metal has been selected during this step:
Generated code is :
.settingsfolderApplicationfolder: User-level application logic, features, and modulesCorefolder :The Core folder contains the main application source and header files, startup assembly, and system initialization code.Driversbare-metal user application source code, include file, startup files, application-specific HAL drivers..cproject.ld
Driversfolder:CMSISfolder: CMSIS core filesSTM32MP13xx_HAL_Driverfolder: the STM32MP13 HAL driver library, providing low-level peripheral support.
.mxproject.ioc.project: this file is used to make the import of the project generated by STM32CubeMX in STM32CubeIDE (Option1).
The picture below shows the project structure after import in STM32CubeIDE
4. Create an STM32MP15x lines
project[edit | edit source]
4.1. Create a project for a specific board[edit | edit source]
The project is created for a specific ST board.
- Launch STM32CubeMX.
- Create a new project via the menu
File > New Project - Select the board: in the tab
Board Selector, typeMP1inCommercial Part Number, the list of possible boards is displayed. For this article, the selected board isSTM32MP157D-DK1. - then click on the button
Start Project - then for this example the generated code is the default one , for that approve the proposal to
Initialize all peripherals with their default Mode
The project creation starts loading the IOC file
Then Pinout & Configuration tab appears
In Project manager tab:
- define the name of the generated project in
Project Namefield, - select the
STM32CubeIDEinToolchain/IDEfield, - press
GENERATE CODEbutton.
Once project generation done, a new pop up Code Generation appears to indicate that the generation is done.
The generated project is automatically saved in the directory identified, previously, in Project Name field (as written in next picture)
This directory can be simply opened (identified as option1 later in the article ) or the project can be opened (identified as option2 later in the article) meaning, imported directly in the STM32CubeIDE.
4.2. Structure of generated code[edit | edit source]
.settingsfolderCA7 folder: Software and configuration targeting the Cortex-A7.CM4 folder: Software targeting the Cortex-M4, including RTOS applications and inter-core communication (OPENAMP).Common, Drivers, Middlewares: Shared code and libraries..mxproject.ioc.project: this file is used to make the import of the project generated by STM32CubeMX in STM32CubeIDE (Option1).
The picture below shows the project structure after import in STM32CubeIDE
5. Create an STM32MP2 series project[edit | edit source]
5.1. Create a project for a specific board[edit | edit source]
The project is created for a specific ST board.
- Launch STM32CubeMX.
- Create a new project via the menu
File > New Project - Select the board: in the tab
Board Selector, typeMP2inCommercial Part Number, the list of possible boards is displayed. For this article, the selected board isSTM32MP257F-EV1. - then click on the button
Start Project - then for this example the generated code is the default one , for that approve the proposal to
Initialize all peripherals with their default Mode
- Select the TD flavor and, for A35-TD flavor only, if the TrustedZone must be activated or not
The project creation starts loading the IOC file
In Project manager tab:
- define the name of the generated project in
Project Namefield, - select the
STM32CubeIDEinToolchain/IDEfield, - press
GENERATE CODEbutton.
Once project generation done, a new pop upCode Generation appears to indicate that the generation is done.
The generated project is automatically saved in the directory identified, previously, in Project Name field (as written in next picture)
This directory can be simply opened (identified as option1 later in the article ) or the project can be opened (identified as option2 later in the article) meaning, imported directly in the STM32CubeIDE.
5.2. Structure of generated code for A35-TD flavor
[edit | edit source]
In next chapters, are described the structures generated into the folder ProjectName depending if TZ is activated or not
5.2.1. TZ activated[edit | edit source]
CA35folder : software and configuration related to the Cortex-A35 cores (application processors).DeviceTreefolder: Device Tree source files (.dts and .dtsi) describing the hardware configuration for the Cortex-A35. These are used by the Linux kernel or bare-metal embedded software running on Cortex-A35.manifest.prop
CM33folder : software and configuration related to the Cortex-M33, typically used for real-time or secure processing.DeviceTreefolder:TF-Mfolder: Device Tree Source files describing the hardware configuration for the CM33 core for TF-M
NonSecurefolder:Commonfolder : shared code, utilities, or libraries used by both cores or common to the entire project.Corefolder: Source code and headers for the Cortex-M33 application.Driversfolder: Peripheral drivers used by the Cortex-M33.STM32MP257FAIX_RAM.ld.cproject
Commonfolder : shared code, utilities, or libraries used by both cores or common to the entire project.Driversfolder : General peripheral drivers or libraries shared across cores or used globally..ioc.project: this file is used to make the import of the project generated by STM32CubeMX in STM32CubeIDE (Option1).
The picture below shows the project structure after import in STM32CubeIDE
5.2.2. TZ not activated[edit | edit source]
- "CA35" folder :software and configuration related to the Cortex-A35 cores (application processors).
- "DeviceTree" folder: Device Tree source files (.dts and .dtsi) describing the hardware configuration for the Cortex-A35. These are used by the Linux kernel or bare-metal embedded software running on Cortex-A35.
- "manifest.prop"
- "CM33" folder :software and configuration related to the Cortex-M33, typically used for real-time or secure processing.
- "Core" folder: Source code and headers for the Cortex-M33 application.
- "Drivers" folder:Peripheral drivers used by the Cortex-M33.
- STM32MP257FAIX_RAM.ld:
- ".cproject"
- "Common" folder: shared code, utilities, or libraries used by both cores or common to the entire project.
- "Drivers" folder : General peripheral drivers or libraries shared across cores or used globally.
- ".project": this file is used to make the import of the project generated by STM32CubeMX in STM32CubeIDE (Option1).
- ".ioc"
The picture below shows the project structure after import in STM32CubeIDE
5.3. Structure of generated projects for M33-TD flavor
[edit | edit source]
In next chapters, are described the structures generated into the folder "ProjectName" .
- "CA35" folder : software and configuration related to the Cortex-A35 cores (application processors).
- "DeviceTree" folder: Device Tree source files (.dts and .dtsi) describing the hardware configuration for the Cortex-A35. These are used by the Linux kernel or bare-metal embedded software running on Cortex-A35.
- "manifest.prop" file: project manifest version and path to "mx" .dts for Kernel, OP-TEE, TF-A and U-BOOT
- "CM33" folder : software and configuration related to the Cortex-M33, typically used for real-time or secure processing.
- "DeviceTree" folder: Device Tree Source files describing the hardware configuration for the Cortex-M33 for TF-M and mcuboot configuration
- "TF-M" folder: Device Tree Source files describing the hardware configuration for the Cortex-M33 for TF-M
- "mcuboot" folder: Device Tree Source files describing the hardware configuration for the Cortex-M33 for mcuboot
- "NonSecure" folder:
- "Core" folder: Source code and headers for the Cortex-M33 application.
- '"Drivers" folder: Peripheral drivers used by the Cortex-M33.
- STM32MP257FAIX_RAM.ld: Linker script defining memory layout for the Cortex-M33 application in RAM.
- ".cproject" file:contains build settings and configurations specific to the C/C++ project.
- "DeviceTree" folder: Device Tree Source files describing the hardware configuration for the Cortex-M33 for TF-M and mcuboot configuration
- "Common" folder : shared code, utilities, or libraries used by both cores or common to the entire project.
- "Drivers" folder : General peripheral drivers or libraries shared across cores or used globally.
- " ExtMemLoader/DeviceTree" folder : device tree for CA35 flashloader (optee-os, TF-a, u-Boot) .
- ".ioc"
- ".inc"
- ".project": this file is used to make the import of the project generated by STM32CubeMX in STM32CubeIDE (Option1).
The picture below shows the project structure after import in STM32CubeIDE
6. Import project generated by STM32CubeMX in STM32CubeIDE[edit | edit source]
visit How_to_import_STM32MPU_project_generated_by_STM32CubeMX_in_STM32CubeIDE
7. How to go further[edit | edit source]
For more details about MP1x families please refer to :
- STM32CubeMP15_Package_-_Getting_started
- STM32CubeMP13_Package_-_Getting_started
- [[How_to_import_and_build_STM32MPU_OpenSTLinux_projects_in_STM32CubeIDE] and its associated sub-pages
- How to manage STM32CubeMP1 projects in STM32CubeIDE ???








