Registered User mNo edit summary |
Registered User mNo edit summary |
||
(10 intermediate revisions by 4 users not shown) | |||
Line 1: | Line 1: | ||
== Extending the STM32 MCU family to the MPU world == | == Extending the STM32 MCU family to the MPU world == | ||
'''Microcontroller units (MCUs)''' are built around MMU-less cores such as the Arm<sup>®</sup> Cortex | '''Microcontroller units (MCUs)''' are built around MMU-less cores such as the Arm<sup>®</sup> Cortex<sup>®</sup>-M, which are very efficient for deterministic operations in a bare metal or real time operating system (RTOS) context. STMicroelectronics STM32 MCUs embed enough SRAM (static RAM) and Flash memory for many applications, and this can be completed with external memories.<br /> | ||
'''Microprocessor units (MPUs)''' rely on cores such as the Arm<sup>®</sup> Cortex | '''Microprocessor units (MPUs)''' rely on cores such as the Arm<sup>®</sup> Cortex<sup>®</sup>-A, with memory management unit (MMU) to manage virtual memory spaces, opening the door to efficient support of a rich operating system (OS) such as Linux<sup>®</sup>. A fast interconnect makes the bridge between the processing unit, high-bandwidth peripherals, external memories (RAM and NVM) and, usually, a graphical Processing Unit (GPU).<br /> | ||
'''STMicroelectronics has a strong presence in MCU markets with STM32 family''' <ref>http://www.st.com/en/microcontrollers/stm32-32-bit-arm-cortex-mcus.html</ref> and entered the MPU market with a first platform referenced as [[STM32MP15 microprocessor|'''STM32MP15''']]. This platform aims to address multiple market segments such as industrial, consumer, healthcare, home and building automation. These markets require more processing power and more flexibility, which can easily be leveraged thanks to the open source components ported on | '''STMicroelectronics has a strong presence in MCU markets with STM32 family''' <ref>http://www.st.com/en/microcontrollers/stm32-32-bit-arm-cortex-mcus.html</ref> and entered the MPU market with a first platform referenced as [[STM32MP15 microprocessor|'''STM32MP15''']]. This platform aims to address multiple market segments such as industrial, consumer, healthcare, home and building automation. These markets require more processing power and more flexibility, which can easily be leveraged thanks to the open source components ported on theArm<sup>®</sup> Cortex<sup>®</sup>-A.<br /> | ||
[[File:MCU to MPU.png|link=|center]] | [[File:MCU to MPU.png|link=|center]] | ||
<br> | <br> | ||
The figure above shows the hardware components that are typically embedded in a MPU, compared to the ones to be found in a MCU. Note that if some of the MPU components are optional, one Arm Cortex-A is always present. | The figure above shows the hardware components that are typically embedded in a MPU, compared to the ones to be found in a MCU. Note that if some of the MPU components are optional, one Arm<sup>®</sup> Cortex<sup>®</sup>-A is always present. | ||
<br><br> | <br><br> | ||
The [[STM32MP13 microprocessor|''' | The [[STM32MP13 microprocessor|'''STM32MP13x lines''']] extend the {{MicroprocessorDevice | device=1}} with a lighter MPU that only embeds a single Cortex-A7 and target applications that have the strongest requirements on security and low power perspectives. | ||
<br><br> | |||
The [[STM32MP25 microprocessor|'''STM32MP25x lines''']] (industrial-grade 64-bit MPUs) are the first of the {{MicroprocessorDevice | device=2}}, and target secure industry 4.0 and advanced edge computing applications that require high-end multimedia capabilities. They are built around single or dual Arm<sup>®</sup> Cortex<sup>®</sup>-A35 cores and a single Arm<sup>®</sup> Cortex<sup>®</sup>-M33. | |||
==Multiple-core architecture concepts== | ==Multiple-core architecture concepts== | ||
Line 16: | Line 18: | ||
ImageMap| | ImageMap| | ||
Image:Boot_time_and_runtime.png {{!}} thumb {{!}} right {{!}} Runtime context initialization at boot time | Image:Boot_time_and_runtime.png {{!}} thumb {{!}} right {{!}} Runtime context initialization at boot time | ||
poly | poly 84 210 84 151 14 151 151 118 289 151 219 151 219 210 [[Boot chain overview|Boot chain]] | ||
}} | }} | ||
Line 24: | Line 26: | ||
Each core can run in a non-secure and, possibly, a secure (Arm Trustzone<sup>TM</sup><ref>https://www.arm.com/products/security-on-arm/trustzone</ref>) modes. <br /> | Each core can run in a non-secure and, possibly, a secure (Arm Trustzone<sup>TM</sup><ref>https://www.arm.com/products/security-on-arm/trustzone</ref>) modes. <br /> | ||
An '''hardware execution context''' is composed of a core and a security mode.<br /> | An '''hardware execution context''' is composed of a core and a security mode.<br /> | ||
The two hardware execution contexts available on STM32MP13 devices are: | |||
* <span style="color:#FFFFFF; background:{{STPink}};"> Arm Cortex-A secure </span> (Trustzone) | |||
* <span style="color:#FFFFFF; background:{{STDarkBlue}};"> Arm Cortex-A non-secure </span> | |||
The three hardware execution contexts available on STM32MP15 devices are: | The three hardware execution contexts available on STM32MP15 devices are: | ||
* <span style="color:#FFFFFF; background:{{STPink}};"> Arm Cortex-A secure </span> (Trustzone) | * <span style="color:#FFFFFF; background:{{STPink}};"> Arm Cortex-A secure </span> (Trustzone) | ||
* <span style="color:#FFFFFF; background:{{STDarkBlue}};"> Arm Cortex-A non secure </span> | * <span style="color:#FFFFFF; background:{{STDarkBlue}};"> Arm Cortex-A non-secure </span> | ||
* <span style="color:#FFFFFF; background:{{STLightBlue}};"> Arm Cortex-M </span> | * <span style="color:#FFFFFF; background:{{STLightBlue}};"> Arm Cortex-M non-secure </span> | ||
The | The five hardware execution contexts available on STM32MP15 devices are: | ||
* <span style="color:#FFFFFF; background:{{STPink}};"> Arm Cortex-A secure </span> (Trustzone) | * <span style="color:#FFFFFF; background:{{STPink}};"> Arm Cortex-A secure </span> (Trustzone) | ||
* <span style="color:#FFFFFF; background:{{STDarkBlue}};"> Arm Cortex-A non secure </span> | * <span style="color:#FFFFFF; background:{{STDarkBlue}};"> Arm Cortex-A non-secure </span> | ||
* <span style="color:#FFFFFF; background:{{STLightBlue}};"> Arm Cortex-M non-secure </span> | |||
* <span style="color:#FFFFFF; background:{{STPurple}};"> Arm Cortex-M secure </span> (Trustzone) | |||
* <span style="color:#FFFFFF; background:{{STLightGreen}};"> Arm Cortex-M0+ non-secure </span><span title="Please contact the ST support for more information about this execution context"><sup>[[File:Warning.png|15px|link=]]</sup></span> | |||
Each hardware execution context can host different firmwares, depending on the platform state. The following contexts can be distinguished: | Each hardware execution context can host different firmwares, depending on the platform state. The following contexts can be distinguished: | ||
Line 43: | Line 52: | ||
Each boot time context executes given '''firmware's''': | Each boot time context executes given '''firmware's''': | ||
* <span style="color:#FFFFFF; background:{{STPink}};"> Arm Cortex-A secure </span> (Trustzone), executes the '''ROM code''' and '''TF-A BL2'''<ref name="STM32MPU ES"/> | * <span style="color:#FFFFFF; background:{{STPink}};"> Arm Cortex-A secure </span> (Trustzone), executes the '''ROM code''' and '''TF-A BL2'''<ref name="STM32MPU ES"/> | ||
* <span style="color:#FFFFFF; background:{{STDarkBlue}};"> Arm Cortex-A non secure </span>, executes '''U-Boot'''<ref name="STM32MPU ES"/> | * <span style="color:#FFFFFF; background:{{STDarkBlue}};"> Arm Cortex-A non-secure </span>, executes '''U-Boot'''<ref name="STM32MPU ES"/> | ||
The ROM code is embedded inside the microprocessor device and it is the first code executed by the Arm<sup>®</sup> Cortex<sup>®</sup>-A core(s) after reset.<br /> | The ROM code is embedded inside the microprocessor device and it is the first code executed by the Arm<sup>®</sup> Cortex<sup>®</sup>-A core(s) after reset.<br /> | ||
TF-A BL2 and U-Boot are '''STM32MPU Embedded Software'''<ref name="STM32MPU ES"/> components. | TF-A BL2 and U-Boot are '''STM32MPU Embedded Software'''<ref name="STM32MPU ES"/> components. | ||
Line 49: | Line 58: | ||
===Firmwares executed in the runtime contexts=== | ===Firmwares executed in the runtime contexts=== | ||
Each runtime context executes given '''firmware's''': | Each runtime context executes given '''firmware's''': | ||
* <span style="color:#FFFFFF; background:{{STPink}};"> Arm Cortex-A secure </span> (Trustzone), executes '''OP-TEE'''<ref name="STM32MPU ES"/> | * <span style="color:#FFFFFF; background:{{STPink}};"> Arm Cortex-A secure </span> (Trustzone), executes '''OP-TEE'''<ref name="STM32MPU ES"/> and/or '''TF-A BL31''''<ref name="STM32MPU ES"/> | ||
* <span style="color:#FFFFFF; background:{{STDarkBlue}};"> Arm Cortex-A non-secure </span>, executes '''Linux'''<ref name="STM32MPU ES"/> | * <span style="color:#FFFFFF; background:{{STDarkBlue}};"> Arm Cortex-A non-secure </span>, executes '''Linux'''<ref name="STM32MPU ES"/> | ||
* <span style="color:#FFFFFF; background:{{STLightBlue}};"> Arm Cortex-M </span> (non-secure | * <span style="color:#FFFFFF; background:{{STLightBlue}};"> Arm Cortex-M non-secure </span>, executes '''STM32Cube'''<ref name="STM32MPU ES"/> | ||
OP-TEE, Linux and | * <span style="color:#FFFFFF; background:{{STPurple}};"> Arm Cortex-M secure </span> (Trustzone), executes '''TF-M'''<ref name="STM32MPU ES"/> | ||
*<span style="color:#FFFFFF; background:{{STLightGreen}};"> Arm Cortex-M0+ non-secure </span><span title="Please contact the ST support for more information about this execution context"><sup>[[File:Warning.png|15px|link=]]</sup></span>, executes '''STM32Cube'''<ref name="STM32MPU ES"/> | |||
OP-TEE, TF-A BL31, Linux, STM32Cube and TF-M are '''STM32MPU Embedded Software'''<ref name="STM32MPU ES"/> components. | |||
===Peripheral assignment to the boot time and runtime contexts=== | ===Peripheral assignment to the boot time and runtime contexts=== | ||
Line 59: | Line 70: | ||
The assignment capabilities for each ''XXX'' peripheral (e.g., GPIO) are described in the "''XXX'' internal peripheral" article (e.g., "GPIO internal peripheral"), and any article named "''STM32MPxx'' peripherals overview" (e.g., "STM32MP15 peripherals overview) summarizes the assignment capabilities for all peripherals of the ''STM32MPxx'' microprocessor device (e.g., STM32MP15), with tables similar to the examples below: | The assignment capabilities for each ''XXX'' peripheral (e.g., GPIO) are described in the "''XXX'' internal peripheral" article (e.g., "GPIO internal peripheral"), and any article named "''STM32MPxx'' peripherals overview" (e.g., "STM32MP15 peripherals overview) summarizes the assignment capabilities for all peripherals of the ''STM32MPxx'' microprocessor device (e.g., STM32MP15), with tables similar to the examples below: | ||
{ | {{#lst:STM32MP1_internal_peripherals_assignment_table_template|stm32mp1_boottime}} | ||
| | <section begin=stm32mp15_boottime /> | ||
| rowspan="3" | XXX | |||
| rowspan="3" | YYY | |||
| YYY1 | |||
| | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | |||
| YYY1 can be assigned (single choice) to whether Cortex-A secure (TF-A BL2) or Cortex-A non-secure | |||
|- | |- | ||
| | | YYY2 | ||
| | | | ||
| | |||
| | | <span title="assignable peripheral" style="font-size:21px">☐</span> | ||
| YYY2 can only be assigned to Cortex-A non-secure | |||
|- | |- | ||
| YYY3 | |||
| <span title="system peripheral" style="font-size:21px">✓</span> | |||
| <span title="system peripheral" style="font-size:21px">✓</span> | |||
| <span title="system peripheral" style="font-size:21px">✓</span> | |||
| YYY3 is shared accross all contexts | |||
|- | |||
<section end=stm32mp15_boottime /> | |||
|} | |} | ||
{{#lst:STM32MP1_internal_peripherals_assignment_table_template|stm32mp15_runtime}} | |||
<section begin=stm32mp15_runtime /> | |||
| rowspan="3" | XXX | |||
| rowspan="3" | YYY | |||
| YYY1 | |||
| | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | |||
| YYY1 can be assigned (single choice) to whether Cortex-A non-secure or Cortex-M | |||
|- | |||
| YYY2 | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | |||
| | |||
| | |||
| YYY2 can only be assigned to Cortex-A secure | |||
|- | |||
| YYY3 | |||
| <span title="system peripheral" style="font-size:21px">✓</span> | |||
| <span title="system peripheral" style="font-size:21px">✓</span> | |||
| <span title="system peripheral" style="font-size:21px">✓</span> | |||
| YYY3 is shared accross all contexts: this is typically the case for system peripherals | |||
|- | |||
<section end=stm32mp15_runtime /> | |||
|} | |||
Refer to [[How to assign an internal peripheral to an execution context]] for detailed instructions. | Refer to [[How to assign an internal peripheral to an execution context]] for detailed instructions. | ||
== | ==STM32 MPUs== | ||
{|width=" | ''What are the main features of an STM32 microprocessor device?''<br> | ||
''How to program STM32 microprocessor device-internal peripherals?''<br> | |||
''How to configure internal peripherals for new boards?''<br> | |||
{{highlight|Click on the links in the frame below and be guided!}} | |||
{| class="st-table" style="border-style: hidden; text-align: center; margin: auto; width: 100%;" | |||
| style="border-style: hidden;" rowspan="2" | [[File:STM32MP1 logo.png|link=|STM32MP1 series]] | |||
| style="border-style: hidden;" rowspan="2" | | |||
| style="border-style: hidden;" | [[File:STM32MP13x_lines.png|250px|link=STM32MP13 microprocessor|STM32MP13x lines]] | |||
| style="border-style: hidden;" | [[File:STM32MP15x_lines.png|250px|link=STM32MP15 microprocessor|STM32MP15x lines]] | |||
|- | |- | ||
| style="border-style: hidden;" | [[STM32MP13 microprocessor|'''STM32MP13x lines''']] | |||
| style="border-style: hidden;" | [[STM32MP15 microprocessor|'''STM32MP15x lines''']] | |||
|- | |- | ||
| | | style="border-style: hidden;" rowspan="2" | [[File:STM32MP2 logo.png|link=|STM32MP2 series]] | ||
| | | style="border-style: hidden;" rowspan="2" | | ||
| style="border-style: hidden;" | [[File:STM32MP25x_lines.png|250px|link=STM32MP25 microprocessor|STM32MP25x lines]] | |||
|- style="border-style: hidden;" | |||
| style="border-style: hidden;" | [[STM32MP25 microprocessor|'''STM32MP25x lines''']] | |||
|} | |} | ||
Latest revision as of 19:01, 7 December 2023
1. Extending the STM32 MCU family to the MPU world[edit | edit source]
Microcontroller units (MCUs) are built around MMU-less cores such as the Arm® Cortex®-M, which are very efficient for deterministic operations in a bare metal or real time operating system (RTOS) context. STMicroelectronics STM32 MCUs embed enough SRAM (static RAM) and Flash memory for many applications, and this can be completed with external memories.
Microprocessor units (MPUs) rely on cores such as the Arm® Cortex®-A, with memory management unit (MMU) to manage virtual memory spaces, opening the door to efficient support of a rich operating system (OS) such as Linux®. A fast interconnect makes the bridge between the processing unit, high-bandwidth peripherals, external memories (RAM and NVM) and, usually, a graphical Processing Unit (GPU).
STMicroelectronics has a strong presence in MCU markets with STM32 family [1] and entered the MPU market with a first platform referenced as STM32MP15. This platform aims to address multiple market segments such as industrial, consumer, healthcare, home and building automation. These markets require more processing power and more flexibility, which can easily be leveraged thanks to the open source components ported on theArm® Cortex®-A.

The figure above shows the hardware components that are typically embedded in a MPU, compared to the ones to be found in a MCU. Note that if some of the MPU components are optional, one Arm® Cortex®-A is always present.
The STM32MP13x lines extend the STM32MP1 series with a lighter MPU that only embeds a single Cortex-A7 and target applications that have the strongest requirements on security and low power perspectives.
The STM32MP25x lines (industrial-grade 64-bit MPUs) are the first of the STM32MP2 series, and target secure industry 4.0 and advanced edge computing applications that require high-end multimedia capabilities. They are built around single or dual Arm® Cortex®-A35 cores and a single Arm® Cortex®-M33.
2. Multiple-core architecture concepts[edit | edit source]
As seen above, the MPU is a multiple-core architecture that can interact with a wide number of peripherals. Some new concepts need to be introduced for a good understanding of the system: these concepts are explained below and are illustrated in the figure on the right.
2.1. Hardware execution contexts[edit | edit source]
Each core can run in a non-secure and, possibly, a secure (Arm TrustzoneTM[2]) modes.
An hardware execution context is composed of a core and a security mode.
The two hardware execution contexts available on STM32MP13 devices are:
- Arm Cortex-A secure (Trustzone)
- Arm Cortex-A non-secure
The three hardware execution contexts available on STM32MP15 devices are:
- Arm Cortex-A secure (Trustzone)
- Arm Cortex-A non-secure
- Arm Cortex-M non-secure
The five hardware execution contexts available on STM32MP15 devices are:
- Arm Cortex-A secure (Trustzone)
- Arm Cortex-A non-secure
- Arm Cortex-M non-secure
- Arm Cortex-M secure (Trustzone)
- Arm Cortex-M0+ non-secure
Each hardware execution context can host different firmwares, depending on the platform state. The following contexts can be distinguished:
- the boot time context, corresponding to a transitory firmware execution (a "boot loader"), when the device is booting up
- the runtime context, corresponding to an established firmware execution, when the device is up-and-running
A firmware is the executable binary that is the build result of an embedded software component[3] (e.g., Linux). Thus, a firmware is executed on a context: through misuse of language, an embedded software component (instead of its firmware) is sometimes said as executed on a context.
2.2. Firmwares executed in the boot time contexts[edit | edit source]
Each boot time context executes given firmware's:
- Arm Cortex-A secure (Trustzone), executes the ROM code and TF-A BL2[3]
- Arm Cortex-A non-secure , executes U-Boot[3]
The ROM code is embedded inside the microprocessor device and it is the first code executed by the Arm® Cortex®-A core(s) after reset.
TF-A BL2 and U-Boot are STM32MPU Embedded Software[3] components.
2.3. Firmwares executed in the runtime contexts[edit | edit source]
Each runtime context executes given firmware's:
- Arm Cortex-A secure (Trustzone), executes OP-TEE[3] and/or TF-A BL31'[3]
- Arm Cortex-A non-secure , executes Linux[3]
- Arm Cortex-M non-secure , executes STM32Cube[3]
- Arm Cortex-M secure (Trustzone), executes TF-M[3]
- Arm Cortex-M0+ non-secure
, executes STM32Cube[3]
OP-TEE, TF-A BL31, Linux, STM32Cube and TF-M are STM32MPU Embedded Software[3] components.
2.4. Peripheral assignment to the boot time and runtime contexts[edit | edit source]
The term peripheral assignment is used to identify the action to assign a set of peripherals to a boot time and/or runtime context. This is a user choice that can be realized via STM32CubeMX[4] or manually, in order to properly configure the boot chain[5] and the several pieces of firmware that run on the platform.
The assignment capabilities for each XXX peripheral (e.g., GPIO) are described in the "XXX internal peripheral" article (e.g., "GPIO internal peripheral"), and any article named "STM32MPxx peripherals overview" (e.g., "STM32MP15 peripherals overview) summarizes the assignment capabilities for all peripherals of the STM32MPxx microprocessor device (e.g., STM32MP15), with tables similar to the examples below:
Click on to expand or collapse the legend...
Domain | Peripheral | Boot time allocation | Comment ![]() | |||
---|---|---|---|---|---|---|
Instance | Cortex-A7 secure (ROM code) |
Cortex-A7 secure (TF-A BL2) |
Cortex-A7 non-secure (U-Boot) | |||
XXX | YYY | YYY1 | ☐ | ☐ | YYY1 can be assigned (single choice) to whether Cortex-A secure (TF-A BL2) or Cortex-A non-secure | |
YYY2 | ☐ | YYY2 can only be assigned to Cortex-A non-secure | ||||
YYY3 | ✓ | ✓ | ✓ | YYY3 is shared accross all contexts |
Click on to expand or collapse the legend...
Domain | Peripheral | Runtime allocation | Comment ![]() | |||
---|---|---|---|---|---|---|
Instance | Cortex-A7 secure (OP-TEE) |
Cortex-A7 non-secure (Linux) |
Cortex-M4 (STM32Cube) | |||
XXX | YYY | YYY1 | ☐ | ☐ | YYY1 can be assigned (single choice) to whether Cortex-A non-secure or Cortex-M | |
YYY2 | ☐ | YYY2 can only be assigned to Cortex-A secure | ||||
YYY3 | ✓ | ✓ | ✓ | YYY3 is shared accross all contexts: this is typically the case for system peripherals |
Refer to How to assign an internal peripheral to an execution context for detailed instructions.
3. STM32 MPUs[edit | edit source]
What are the main features of an STM32 microprocessor device?
How to program STM32 microprocessor device-internal peripherals?
How to configure internal peripherals for new boards?
Click on the links in the frame below and be guided!
4. References[edit | edit source]