Difference between revisions of "Getting started with STM32 MPU devices"

[quality revision] [quality revision]
m
m

1 Extending the STM32 MCU family to the MPU world[edit]

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.

The STMicroelectronics approach for a smooth transition to the MPU world consists of putting both worlds in a single device, seeing the MCU as a subsystem of the MPU: Template:ProductMarketingReviewsComments

MCU to MPU.png


2 Multiple-core architecture concepts[edit]

Boot chain
Runtime context initialization at boot time
Template:WarningImageMapOverlay

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]

Each core can run in a non-secure and - eventually - a secure (Arm Trustzone[2]) mode.
A hardware execution context corresponds to a core and security mode.
The three hardware execution contexts available on STM32 MPU devices are:

  •  Arm Cortex-A secure  (Trustzone)
  •  Arm Cortex-A non secure 
  •  Arm Cortex-M  (non-secure)

Each hardware execution context can host different firmware, depending on the platform state. The following contexts can be distinguished:

  • the boot time context, corresponding to a transitory firmware execution, when the device is booting up
  • the runtime context, corresponding to an established firmware execution, when the device is up-and-running

2.2 Firmwares executed in the runtime contexts[edit]

Each runtime context executes a given piece of firmware:

  •  Arm Cortex-A secure  (Trustzone), executes OP-TEE[3]
  •  Arm Cortex-A non secure , executes Linux[3]
  •  Arm Cortex-M  (non-secure), executes STM32Cube[3]

OP-TEE, Linux and STM32Cube are STM32MPU Embedded Software[3] components.

2.3 Peripheral assignment to the runtime contexts[edit]

The term peripheral assignment is used to identify the action to assign a set of peripherals to a 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.

Each microprocessor peripheral-overview article shows the assignment capabilities for each peripheral, with a table similar to the example below:

Domain Peripheral Runtime allocation Comment
Instance Cortex-A S
(OP-TEE)
Cortex-A NS
(Linux)
Cortex-M
(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 a runtime context for detailed instructions.

3 STM32MP1 family microprocessors[edit]

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!
STM32MP1 marketing block diagram.png
STM32MP15 microprocessor

4 References[edit]


Template:ToBeReviewedByProductMarketing


== Extending the STM32 MCU family to the MPU world ==
'''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.<br />


'''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).<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.<br />


The STMicroelectronics approach for a smooth transition to the MPU world consists of putting both worlds in a single device, seeing the MCU as a subsystem of the MPU:
{{ReviewsCommentsProductMarketingReviewsComments| JLD (product marketing): Today: The overall introduction is perfect. My comment relates to this last sentence. Even if true on the technical perscpective, I would tend to remove it for marketing perspective. I would replace by:
The new markets STMicro targets require more power and more flexibility which can be easily leveraged thanks to the OpenOS environment ported onto the cortexA cores. or some thing like this..Seen from another angle: the previous sentence is very market minded while the last one si more technical..}}
[[File:MCU to MPU.png|link=|center]]<br />


==Multiple-core architecture concepts==
{{
ImageMap|
Image:Boot_time_and_runtime.png {{!}} thumb {{!}} right {{!}} Runtime context initialization at boot time <br/> {{WarningImageMapOverlay}}
poly 94 228 61 228 124 183 186 228 156 228 156 357 94 357 94 228 [[Boot chains overview|Boot chain]]
}}

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.

===Hardware execution contexts===
Each core can run in a non-secure and - eventually - a secure (Arm Trustzone<ref>https://www.arm.com/products/security-on-arm/trustzone</ref>) mode. <br />

A '''hardware execution context''' corresponds to a core and security mode.<br />

The three hardware execution contexts available on STM32 MPU devices are:

* <span style="color:#FFFFFF; background:#D4007A">&nbsp;Arm Cortex-A secure&nbsp;</span> (Trustzone)
* <span style="color:#FFFFFF; background:#002052">&nbsp;Arm Cortex-A non secure&nbsp;</span>

* <span style="color:#FFFFFF; background:#39A9DC">&nbsp;Arm Cortex-M&nbsp;</span> (non-secure)

Each hardware execution context can host different firmware, depending on the platform state. The following contexts can be distinguished:
* the '''boot time''' context, corresponding to a transitory firmware execution, when the device is booting up
* the '''runtime''' context, corresponding to an established firmware execution, when the device is up-and-running

===Firmwares executed in the runtime contexts===
Each runtime context executes a given piece of '''firmware''':
* <span style="color:#FFFFFF; background:#D4007A">&nbsp;Arm Cortex-A secure&nbsp;</span> (Trustzone), executes '''OP-TEE'''<ref name="STM32MPU ES">[[STM32MPU_Embedded_Software_architecture_overview|STM32MPU Embedded Software]]</ref>

* <span style="color:#FFFFFF; background:#002052">&nbsp;Arm Cortex-A non secure&nbsp;</span>, executes '''Linux'''<ref name="STM32MPU ES"/>

* <span style="color:#FFFFFF; background:#39A9DC">&nbsp;Arm Cortex-M&nbsp;</span> (non-secure), executes '''STM32Cube'''<ref name="STM32MPU ES"/>

OP-TEE, Linux and STM32Cube are '''STM32MPU Embedded Software'''<ref name="STM32MPU ES"/> components.

===Peripheral assignment to the runtime contexts===
The term '''peripheral assignment''' is used to identify the action to assign a set of peripherals to a runtime context. This is a user choice that can be realized via STM32CubeMX<ref>[[STM32CubeMX]]</ref> or manually, in order to properly configure the boot chain<ref>[[Boot_chains_overview]]</ref> and the several pieces of firmware that run on the platform.

Each microprocessor peripheral-overview article shows the assignment capabilities for each peripheral, with a table similar to the example below:
{| class="wikitable" style="text-align: center;" width=80% 
 | rowspan="2" width=12% | '''Domain'''
 | rowspan="2" width=12% | '''Peripheral'''
 | colspan="4" width=51% | '''Runtime allocation'''
 | rowspan="2" width=25% | '''Comment'''
 |-
 | bgcolor="#90989E" width=15% | '''Instance'''
 | bgcolor="#D4007A" width=12% style="color: white;" | '''Cortex-A S''' <br /> (OP-TEE)
 | bgcolor="#002052" width=12% style="color: white;" | '''Cortex-A NS''' <br /> (Linux)
 | bgcolor="#39A9DC" width=12% style="color: white;" | '''Cortex-M''' <br /> (STM32Cube)
 |-
 | 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
 |-
 |-
 |}

Refer to [[How to assign an internal peripheral to a runtime context]] for detailed instructions.

==STM32MP1 family microprocessors==

{|class="wikitable" style="text-align:left; border-style:solid; border-color:#00C0FF; background:white;" width="95%" cellspacing="1"
|-
! style="text-align:left; border-color:#00C0FF; background:#00C0FF; color:white;" valign="top" colspan="1" | ''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><br> {{highlight|Click on the links in the frame below and be guided!}}
|- 
|style="border-color:#00C0FF; background:white;" align="center" | [[File: STM32MP1_marketing_block_diagram.png|200px|link=STM32MP15 microprocessor]] <br> [[STM32MP15 microprocessor|''' STM32MP15 microprocessor''']] <br>

|-
|}

==References==<references />

<noinclude>

{{ToBeReviewedByProductMarketing}}
{{PublicationRequestId | 9187 | 2018-10-11 | PhilipS - 11Oct'18 - 9187}}
[[Category:Sub-articles]]</noinclude>
Line 7: Line 7:
   
 
The STMicroelectronics approach for a smooth transition to the MPU world consists of putting both worlds in a single device, seeing the MCU as a subsystem of the MPU:
 
The STMicroelectronics approach for a smooth transition to the MPU world consists of putting both worlds in a single device, seeing the MCU as a subsystem of the MPU:
{{ProductMarketingReviewsComments| JLD : Today: The overall introduction is perfect. My comment relates to this last sentence. Even if true on the technical perscpective, I would tend to remove it for marketing perspective. I would replace by:
+
{{ReviewsComments| JLD (product marketing): Today: The overall introduction is perfect. My comment relates to this last sentence. Even if true on the technical perscpective, I would tend to remove it for marketing perspective. I would replace by:
 
The new markets STMicro targets require more power and more flexibility which can be easily leveraged thanks to the OpenOS environment ported onto the cortexA cores. or some thing like this..Seen from another angle: the previous sentence is very market minded while the last one si more technical..}}
 
The new markets STMicro targets require more power and more flexibility which can be easily leveraged thanks to the OpenOS environment ported onto the cortexA cores. or some thing like this..Seen from another angle: the previous sentence is very market minded while the last one si more technical..}}
 
[[File:MCU to MPU.png|link=|center]]
 
[[File:MCU to MPU.png|link=|center]]
Line 95: Line 95:
   
 
<noinclude>
 
<noinclude>
{{ToBeReviewedByProductMarketing}}
 
 
{{PublicationRequestId | 9187 | 2018-10-11 | PhilipS - 11Oct'18 - 9187}}
 
{{PublicationRequestId | 9187 | 2018-10-11 | PhilipS - 11Oct'18 - 9187}}
 
[[Category:Sub-articles]]
 
[[Category:Sub-articles]]
 
</noinclude>
 
</noinclude>

Attachments

Discussions