Registered User mNo edit summary |
Registered User (Merge articles) |
||
(22 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
This article explains how to import OpenSTLinux | <noinclude> | ||
{{ApplicableFor | |||
| MPUs list=STM32MP13x, STM32MP15x | |||
| MPUs checklist=STM32MP13x, STM32MP15x}}<br> | |||
</noinclude> | |||
This article explains how to import OpenSTLinux projects supporting FIP (TF-A firmware image package) into STM32CubeIDE on a Linux<sup>®</sup> workstation. Following examples are based on board with {{MicroprocessorDevice | device=15}} but they apply also on board with {{MicroprocessorDevice | device=13}}. | |||
==Overview== | ==Overview== | ||
It is possible to import into an existing | It is possible to import, into an existing STM32MP15x project, some OpenSTLinux projects using STM32CubeIDE, v1.11.0, compatible with {{EcosystemRelease | revision=4.0.0 | range=and after}}. | ||
This is done | This is done using the '''''Import an OpenSTLinux project...''''' contextual menu of the Cortex<sup>®</sup>-A hierarchical project, providing access to Linux<sup>®</sup>, TF-A, U-boot, and OP-TEE. | ||
[[File:OSTL-Src-Prj-Menu.png|500px|thumb|center|OpenSTLinux Project Import Menu]] | [[File:OSTL-Src-Prj-Menu.png|500px|thumb|center|link=|OpenSTLinux Project Import Menu]] | ||
==OpenSTLinux project structure== | ==OpenSTLinux project structure== | ||
All | All OpenSTLinux projects follow the same project structure approach with three main parts: | ||
* '''''Eclipse artifact''''', | * '''''Eclipse artifact''''', to make project usage easier | ||
* '''''Build artifact''''' identifying clearly the project output | * '''''Build artifact''''' identifying clearly the project output | ||
* '''''Sources''''', as they appear in Yocto environment | * '''''Sources''''', as they appear in the Yocto Project<sup>®</sup> environment | ||
<br> | <br> | ||
'''Device tree sources''' generated by STM32CubeMX into ''DeviceTree/'' directory of Cortex-A hierarchical project | '''Device tree sources''' are generated by STM32CubeMX into the ''DeviceTree/'' directory of the Cortex<sup>®</sup>-A hierarchical project. They are automatically included inside the corresponding OpenSTLinux projects: Linux<sup>®</sup>, TF-A and U-boot, with: | ||
* source file links | * source file links | ||
* dedicated ''Build target'' | * dedicated ''Build target'' | ||
'''FIP''' | STM32CubeIDE supports '''FIP'''. The ''FIP_artifacts/'' directory of the Arm<sup>®</sup>-Cortex<sup>®</sup>-A hierarchical project hosts all the deployment objects needed to build the FIP image. Those objects are generated by the TF-A, U-boot, or OP-TEE projects. | ||
{{Warning|It is recommended to refresh project explorer with '''''Refresh''''' Cortex-A hierarchical project | {{Warning|It is recommended to refresh the project explorer with the '''''Refresh''''' contextual menu of the Cortex<sup>®</sup>-A hierarchical project to get an update on FIP artifacts.}} | ||
<br> | <br> | ||
==Linux project== | ==Linux project== | ||
Several ''Build targets'' are proposed for Linux project addressing device trees, module and kernel. | Several ''Build targets'' are proposed for a Linux<sup>®</sup> project addressing device trees, module, and kernel. | ||
[[File:OSTL-Linux-Prj-Structure.png|500px|thumb|center|OpenSTLinux Linux Project Structure]] | [[File:OSTL-Linux-Prj-Structure.png|500px|thumb|center|link=|OpenSTLinux Linux Project Structure]] | ||
Double-click on ''Build target'' to launch the corresponding compilation with the associated Yocto Project<sup>®</sup> SDK. | |||
[[File:OSTL-SRC-Linux-DTMX-Build.png|800px|thumb|center|link=|OpenSTLinux Linux Device Tree MX Build]] | |||
It is then possible to update the running STM32MP15x target with the new build artifacts using the ''STM32 Cortex-A Linux Deployment'' > ''Run Configurations...'' menu. | |||
[[File:OSTL-SRC-Linux-Deployment.png|700px|thumb|center|link=|OpenSTLinux Linux Deployment]] | |||
In this dedicated ''Run Configurations...'' menu, build artifact (such as device tree binary, module, kernel or other) is added using the ''Add...'' button and providing: | |||
* Local path, on the Linux<sup>®</sup> workstation (here build/arch/arm/boot/dts/stm32mp157-dk2f-mx-mx.dtb) | |||
* Remote path, browsing the remote target file system | * Remote path, browsing the remote target file system | ||
For a new device tree, it is possible to update ''extlinux.conf'' target file | For a new device tree, it is possible to update the ''extlinux.conf'' target file to take it into account at the next target reboot. See the ''Actions'' sub-window. | ||
{{Warning|To get correct support, select the ''extlinux.conf'' file corresponding to your board browsing onto the target!}} | |||
[[File:OSTL-SRC-Linux-Deployment-DT.png|800px|thumb|link=|center|OpenSTLinux Linux Deployment Menu]] | |||
After download of build artifacts to the | After download of build artifacts to the STM32MP15x board: | ||
* a script can be executed (optional) | * a script can be executed (optional) | ||
* | * STM32MP15x board is rebooted (default) | ||
==Bootloader projects== | |||
For {{EcosystemRelease | revision=3.0.0 | range=and after}}, the boot architecture has been updated, as explained in [[TF-A_overview|TF-A overview]]. | |||
Since {{EcosystemRelease | revision=3.0.0 | range=}}, two objects are needed to update the STM32MP15x flash memory device: TF-A BL2 flash memory partition and FIP Image. Both of them are generated inside STM32CubeIDE: | |||
*TF-A BL2 flash memory partition, available from the TF-A project build artifact | |||
*FIP image, located into the ''fip'' directory of FIP artifacts | |||
Since the FIP image relies on three projects, there are dependencies between TF-A, U-boot, and OP-TEE. | |||
The '''all''' build target in those projects launches the ''fiptool'', which builds the FIP image. This succeeds only if all the objects are generated. | |||
A build target using generated the device tree sources is also proposed inside STM32CubeIDE. | |||
These generated device trees target only the trusted mode. As a result, there is no support inside the OP-TEE project. | |||
<br> | <br> | ||
As depicted in the figure below, the generated device tree sources for TF-A and U-boot are inside the ''DeviceTree/'' directory. They are linked into the projects TF-A and U-boot, and specific build targets are generated: | |||
*'''''stm32 (stm32mp157c-mymp157cdk2-mx)''''' for the TF-A project, which must be launched first | |||
* and '''''all (stm32mp157c-mymp157cdk2-mx)''''' for the U-boot project | |||
The FIP image for the generated device tree is then available from the fip directory of the FIP artifact. | |||
[[File:OSTL-FIP-Prj-Structure.png|500px|thumb|link=|center|OpenSTLinux FIP Project Structure]] | |||
As depicted in the figure below, | |||
*'''''stm32 (stm32mp157c-mymp157cdk2-mx)''''' for TF-A project | |||
* and '''''all (stm32mp157c-mymp157cdk2-mx)''''' for U-boot project | |||
FIP image for the generated device tree is then available from fip directory of FIP artifact. | |||
[[File:OSTL-FIP-Prj-Structure.png|500px|thumb|center|OpenSTLinux FIP Project Structure]] | |||
From STM32CubeIDE release v1.8.0, it is possible to update bootloader objects (TF-A BL2 & FIP image) directly on a running STM32MP15x target. | |||
Before working with STM32CubeIDE, it is recommended to first update the STM32MP15x boot flash memory with [[STM32CubeProgrammer]]. | |||
All flash memory devices available on the STM32MP157x-EV1 (SD™ card, eMMC, NAND, and NOR) are supported by STM32CubeIDE. It is possible to update them, typically with a customized device tree, by means of the integrated STM32CubeMX. Note that trusted image only is supported. | |||
*[[How to manage OpenSTLinux projects in STM32CubeIDE/SD card update with customized trusted image|SD card update with customized trusted image]], SD card is also supported on {{Board | type=157x-DKx}} and {{Board | type=135x-DK}} | |||
*[[How to manage OpenSTLinux projects in STM32CubeIDE/eMMC update with customized trusted image|eMMC update with customized trusted image]] | |||
*[[How to manage OpenSTLinux projects in STM32CubeIDE/NAND update with customized trusted image|NAND update with customized trusted image]] | |||
*[[How to manage OpenSTLinux projects in STM32CubeIDE/NOR update with customized trusted image|NOR update with customized trusted image]] | |||
<noinclude> | <noinclude> | ||
[[Category:STM32CubeIDE|14]] | [[Category:STM32CubeIDE|14]] | ||
{{PublicationRequestId | 26422 |2023-03-10 }} | |||
</noinclude> | </noinclude> |
Latest revision as of 16:36, 4 May 2023
This article explains how to import OpenSTLinux projects supporting FIP (TF-A firmware image package) into STM32CubeIDE on a Linux® workstation. Following examples are based on board with STM32MP15x lines but they apply also on board with STM32MP13x lines
.
1. Overview[edit | edit source]
It is possible to import, into an existing STM32MP15x project, some OpenSTLinux projects using STM32CubeIDE, v1.11.0, compatible with ecosystem release ≥ unknown revision 4.0.0 .
This is done using the Import an OpenSTLinux project... contextual menu of the Cortex®-A hierarchical project, providing access to Linux®, TF-A, U-boot, and OP-TEE.
2. OpenSTLinux project structure[edit | edit source]
All OpenSTLinux projects follow the same project structure approach with three main parts:
- Eclipse artifact, to make project usage easier
- Build artifact identifying clearly the project output
- Sources, as they appear in the Yocto Project® environment
Device tree sources are generated by STM32CubeMX into the DeviceTree/ directory of the Cortex®-A hierarchical project. They are automatically included inside the corresponding OpenSTLinux projects: Linux®, TF-A and U-boot, with:
- source file links
- dedicated Build target
STM32CubeIDE supports FIP. The FIP_artifacts/ directory of the Arm®-Cortex®-A hierarchical project hosts all the deployment objects needed to build the FIP image. Those objects are generated by the TF-A, U-boot, or OP-TEE projects.
![]() |
It is recommended to refresh the project explorer with the Refresh contextual menu of the Cortex®-A hierarchical project to get an update on FIP artifacts. |
3. Linux project[edit | edit source]
Several Build targets are proposed for a Linux® project addressing device trees, module, and kernel.
Double-click on Build target to launch the corresponding compilation with the associated Yocto Project® SDK.
It is then possible to update the running STM32MP15x target with the new build artifacts using the STM32 Cortex-A Linux Deployment > Run Configurations... menu.
In this dedicated Run Configurations... menu, build artifact (such as device tree binary, module, kernel or other) is added using the Add... button and providing:
- Local path, on the Linux® workstation (here build/arch/arm/boot/dts/stm32mp157-dk2f-mx-mx.dtb)
- Remote path, browsing the remote target file system
For a new device tree, it is possible to update the extlinux.conf target file to take it into account at the next target reboot. See the Actions sub-window.
![]() |
To get correct support, select the extlinux.conf file corresponding to your board browsing onto the target! |
After download of build artifacts to the STM32MP15x board:
- a script can be executed (optional)
- STM32MP15x board is rebooted (default)
4. Bootloader projects[edit | edit source]
For ecosystem release ≥ v3.0.0 , the boot architecture has been updated, as explained in TF-A overview.
Since ecosystem release v3.0.0
, two objects are needed to update the STM32MP15x flash memory device: TF-A BL2 flash memory partition and FIP Image. Both of them are generated inside STM32CubeIDE:
- TF-A BL2 flash memory partition, available from the TF-A project build artifact
- FIP image, located into the fip directory of FIP artifacts
Since the FIP image relies on three projects, there are dependencies between TF-A, U-boot, and OP-TEE.
The all build target in those projects launches the fiptool, which builds the FIP image. This succeeds only if all the objects are generated.
A build target using generated the device tree sources is also proposed inside STM32CubeIDE.
These generated device trees target only the trusted mode. As a result, there is no support inside the OP-TEE project.
As depicted in the figure below, the generated device tree sources for TF-A and U-boot are inside the DeviceTree/ directory. They are linked into the projects TF-A and U-boot, and specific build targets are generated:
- stm32 (stm32mp157c-mymp157cdk2-mx) for the TF-A project, which must be launched first
- and all (stm32mp157c-mymp157cdk2-mx) for the U-boot project
The FIP image for the generated device tree is then available from the fip directory of the FIP artifact.
From STM32CubeIDE release v1.8.0, it is possible to update bootloader objects (TF-A BL2 & FIP image) directly on a running STM32MP15x target.
Before working with STM32CubeIDE, it is recommended to first update the STM32MP15x boot flash memory with STM32CubeProgrammer.
All flash memory devices available on the STM32MP157x-EV1 (SD™ card, eMMC, NAND, and NOR) are supported by STM32CubeIDE. It is possible to update them, typically with a customized device tree, by means of the integrated STM32CubeMX. Note that trusted image only is supported.
- SD card update with customized trusted image, SD card is also supported on STM32MP157x-DKx Discovery kit
and STM32MP135x-DK Discovery kit
- eMMC update with customized trusted image
- NAND update with customized trusted image
- NOR update with customized trusted image