Registered User |
Registered User No edit summary |
||
(47 intermediate revisions by 8 users not shown) | |||
Line 1: | Line 1: | ||
{{ApplicableFor | |||
|MPUs list=STM32MP13x, STM32MP15x, STM32MP21x, STM32MP23x, STM32MP25x | |||
|MPUs checklist=STM32MP13x, STM32MP15x, STM32MP21x, STM32MP23x, STM32MP25x | |||
}} | |||
This article shows the mapping used in STM32 MPU Embedded Software distribution for ST boards, that can be used as starting point for other boards. | |||
__FORCETOC__ | __FORCETOC__ | ||
{{ReviewsComments|-- [[User:Loic Pallardy|Loic Pallardy]] ([[User talk:Loic Pallardy|talk]]) 14:20, 2 November 2023 (CET)<br />Add Cortex M33 main processor flash memory mapping for MM}} | |||
== Supported Flash memory technologies == | == Supported Flash memory technologies == | ||
{{MicroprocessorDevice | device=1}} and {{MicroprocessorDevice | device=2}} support the different types of Flash memory. The bullets below show which interfaces are supported on STMicroelectronics boards: | |||
* SD card on the SDMMC interface | * SD card on the SDMMC interface | ||
* ''e''•MMC on the SDMMC interface | :* used on [[:Category:STM32MP13 Discovery kits|STM32MP13 DISCO board]] | ||
* | :* used on [[:Category:STM32MP15 Evaluation boards|STM32MP15 EVAL board]] | ||
* | :* used on [[:Category:STM32MP15 Discovery kits|STM32MP15 DISCO board]] | ||
The next section lists all partitions used on | :* used on [[:Category:STM32MP25 Evaluation boards|STM32MP25 EVAL board]] | ||
:* used on [[:Category:STM32MP25 Discovery kits|STM32MP25 DISCO board]] | |||
* ''e''•MMC on the SDMMC interface | |||
:* used on [[:Category:STM32MP15 Evaluation boards|STM32MP15 EVAL board]] | |||
:* used on [[:Category:STM32MP25 Evaluation boards|STM32MP25 EVAL board]] | |||
:* used on [[:Category:STM32MP25 Discovery kits|STM32MP25 DISCO board]] | |||
* NAND Flash memory on the FMC interface | |||
:* used on [[:Category:STM32MP15 Evaluation boards|STM32MP15 EVAL board]] only. | |||
* Serial NOR Flash memory on the Dual QSPI/OCTOSPI interface | |||
:* used on [[:Category:STM32MP15 Evaluation boards|STM32MP15 EVAL board]] | |||
:* used on [[:Category:STM32MP25 Evaluation boards|STM32MP25 EVAL board]] | |||
* Serial NAND Flash memory on the Dual QSPI/OCTOSPI interface | |||
:* not present on ST boards | |||
* HyperFlash memory on the OCTOSPI interface | |||
:* not present on ST boards | |||
The next section lists all partitions used on STM32MPU boards (size, name, and content), and the following sections show how they are mapped on the different types of Flash memory. | |||
== Flash partitions == | == Flash partitions == | ||
The tables below list the partitions defined for | The tables below list the partitions defined for STMP32MP1 and STM32MP2 boards in Cortex-A main processor mode and gives typical sizes with OpenSTLinux, that can be tuned, depending on the targeted application needs. | ||
<br> | <br> | ||
{| class="st-table" | {| class="st-table" | ||
Line 22: | Line 42: | ||
| 16 Mbytes || vendorfs || This partition is preferred to the rootfs for third-party proprietary binaries, and ensures that they are not contaminated by any open source licence, such as GPL v3 | | 16 Mbytes || vendorfs || This partition is preferred to the rootfs for third-party proprietary binaries, and ensures that they are not contaminated by any open source licence, such as GPL v3 | ||
|- | |- | ||
| 64 Mbytes || bootfs || The boot file system contains: | | 64 Mbytes || bootfs<br>or<br>boot (NAND)|| The boot file system contains: | ||
* (option) the init RAM file system, which can be copied to the external RAM and used by Linux before mounting a fatter rootfs | * (option) the init RAM file system, which can be copied to the external RAM and used by Linux before mounting a fatter rootfs | ||
* Linux kernel device tree (can be in a Flattened Image Tree - FIT) | * Linux kernel device tree (can be in a Flattened Image Tree - FIT) | ||
Line 29: | Line 49: | ||
* [[U-Boot_overview#Generic_Distro_configuration|U-Boot distro config file]] ''extlinux.conf'' | * [[U-Boot_overview#Generic_Distro_configuration|U-Boot distro config file]] ''extlinux.conf'' | ||
|- | |- | ||
| 2 * 256 Kbytes (*) || env || This partition is used to store the U-Boot environment | | 2 * 256 Kbytes (*) || u-boot-env<br>or uboot_config / uboot_config_r (NAND) || This partition is used to store the U-Boot environment.<br>uboot_config_r is used for redundancy management with uboot_config, in NAND Flash. | ||
|- | |- | ||
| 4 Mbytes || fip || The [[ | | (2 *) 4 Mbytes || fip || The [[How_to_configure_TF-A_FIP|TF-A firmware image package (FIP)]] is a binary file that encapsulates several binaries, and their certificates (optionally, for authentication), that will be loaded by TF-A BL2.<br> | ||
OpenSTLinux FIP contains: | OpenSTLinux FIP contains: | ||
* the second stage boot loader (SSBL): | * the second stage boot loader (SSBL): | ||
** U-Boot binary | ** U-Boot binary | ||
** U-Boot device tree blob | ** U-Boot device tree blob | ||
* | * the OP-TEE binary | ||
* | * the [[How_to_configure_TF-A_FW_CONFIG|firmware configuration file]] used by TF-A BL2 | ||
There are two partitions, fip-a and fip-b, when A/B (seamless) FIP firmware update is activated in TF-A BL2. | |||
** | |||
|- | |||
| 256 Kbytes to 512 Kbytes (*) || metadata || Metadata are used by TF-A BL2 to localize the FIP version to use, when the FIP is subject to firmware update. | |||
Notes: | |||
* The metadata are not used when the FIP firmware update is not activated in TF-A BL2; these partitions can be removed or left empty in this case. | |||
* The metadata update is failsafe against power loss during the FIP update process with two copies. | |||
|- | |- | ||
| 256 Kbytes to 512 Kbytes (*) || | | 2 * 256 Kbytes to 512 Kbytes (*) || fsbla || The first stage boot loader is Arm Trusted Firmware ([[TF-A_overview#BL2|TF-A]]). At least two copies are embedded (fsbla1, fsbla2).<br> | ||
Notes: | |||
* The FSBL-A payload is limited to 128 Kbytes on STM32MP13 and 247 Kbytes on STM32MP15 and STM32MP2. | |||
* The TF-A BL2 update is failsafe against power loss during the process with two copies (see [[STM32_MPU_ROM_code_overview#Boot_from_SD_card|ROM code]] page for details). | |||
|} | |} | ||
(*): The partition size depends on the Flash technology, to be aligned to the block erase size of the Flash memory present on the board: NOR (256 Kbytes) / NAND (512 Kbytes). | (*): The partition size depends on the Flash technology, to be aligned to the block erase size of the Flash memory present on the board: NOR (256 Kbytes) / NAND (512 Kbytes). | ||
{{Info | Some boards can be equipped with multiple Flash devices, like the [[:Category: | {{Info | Some boards can be equipped with multiple Flash devices, like the [[:Category:STM32MP15 Evaluation boards|STM32MP15 EVAL board]], where all of the Flash devices can be programmed with [[STM32CubeProgrammer]]. However, caution must be taken for the serial NOR/NAND and SLC NAND because a '''static bootable MTD partitioning''' is defined in U-Boot default config (see [[How_to_configure_U-Boot_for_your_board#MTD_partitions|MTD configuration ]] for details), with the consequence that up to 6 Mbytes of space is lost at the beginning of each such device, '''even those which are not bootable'''.}} | ||
== SD card memory mapping == | == SD card memory mapping == | ||
The SD card has to be partitioned with GPT format in order to be recognized by the | The SD card has to be partitioned with GPT format in order to be recognized by the STM32MP1 and STM32MP2 ROM code. The easiest way to achieve this is to use [[STM32CubeProgrammer]].<br /> | ||
The ROM code looks for the GPT entries whose name begins with "fsbl": fsbl1 and fsbl2 for example.<br/> | The ROM code looks for the GPT entries whose name begins with "fsbl": fsbl1 and fsbl2 for example.<br/> | ||
Note: The SD card can be unplugged from the board and inserted into a Linux host computer for direct partitioning with Linux utilities and access to the '''bootfs''', '''rootfs''' and '''userfs''' partitions. The file system is Linux EXT4. | Note: The SD card can be unplugged from the board and inserted into a Linux host computer for direct partitioning with Linux utilities and access to the '''bootfs''', '''rootfs''' and '''userfs''' partitions. The file system is Linux EXT4. | ||
Line 65: | Line 92: | ||
== NOR memory mapping == | == NOR memory mapping == | ||
As NOR Flash memory is expensive, its size is usually limited to the minimum needed to store only the bootloaders. The system files (bootfs, rootfs and userfs) are usually stored in another Flash memory, such as the SD card in OpenSTLinux distribution.<br /> [[STM32CubeProgrammer]] must be used to prepare the NOR Flash and the SD card with the layout shown below, and to populate each partition.<br /><br> | As NOR Flash memory is expensive, its size is usually limited to the minimum needed to store only the bootloaders. The system files (bootfs, rootfs and userfs) are usually stored in another Flash memory, such as the SD card in OpenSTLinux distribution.<br /> [[STM32CubeProgrammer]] must be used to prepare the NOR Flash and the SD card with the layout shown below, and to populate each partition.<br /><br> | ||
[[File:NOR mapping.png|center|link=]] | |||
It is possible to use an ''e''•MMC card or NAND as second-level Flash memory, rather than an SD card. This requires the following aspects to be changed: | It is possible to use an ''e''•MMC card or NAND as second-level Flash memory, rather than an SD card. This requires the following aspects to be changed: | ||
* The Flash memory layout, using [[STM32CubeProgrammer]] in order to write the rootfs and userfs to the targeted Flash memory | * The Flash memory layout, using [[STM32CubeProgrammer]] in order to write the rootfs and userfs to the targeted Flash memory | ||
* The Linux kernel parameters, using [[U-Boot overview|U-Boot]], in order to indicate where the rootfs and userfs have to be mounted. | * The Linux kernel parameters, using [[U-Boot overview|U-Boot]], in order to indicate where the rootfs and userfs have to be mounted. | ||
== NAND memory mapping == | == NAND memory mapping == | ||
Line 80: | Line 108: | ||
* the number of software updates estimated on this partition, | * the number of software updates estimated on this partition, | ||
* the selected NAND flash characteristics | * the selected NAND flash characteristics | ||
ST set foundations in the | ST set foundations in the STM32MP1 and STM32MP2 devices in order to allow the integration of NAND flash memories but the product definition remains the customer responsibility. Please, contact your memory provider for further advice.}} | ||
<noinclude> | <noinclude> | ||
[[Category: | [[Category:Platform configuration]] | ||
{{PublicationRequestId | 14615 | 2020-01-15 |}} | {{PublicationRequestId | 14615 | 2020-01-15 |}} | ||
</noinclude> | </noinclude> |
Latest revision as of 09:23, 14 October 2024
This article shows the mapping used in STM32 MPU Embedded Software distribution for ST boards, that can be used as starting point for other boards.
1. Supported Flash memory technologies[edit | edit source]
STM32MP1 series and STM32MP2 series support the different types of Flash memory. The bullets below show which interfaces are supported on STMicroelectronics boards:
- SD card on the SDMMC interface
- used on STM32MP13 DISCO board
- used on STM32MP15 EVAL board
- used on STM32MP15 DISCO board
- used on STM32MP25 EVAL board
- used on STM32MP25 DISCO board
- e•MMC on the SDMMC interface
- used on STM32MP15 EVAL board
- used on STM32MP25 EVAL board
- used on STM32MP25 DISCO board
- NAND Flash memory on the FMC interface
- used on STM32MP15 EVAL board only.
- Serial NOR Flash memory on the Dual QSPI/OCTOSPI interface
- used on STM32MP15 EVAL board
- used on STM32MP25 EVAL board
- Serial NAND Flash memory on the Dual QSPI/OCTOSPI interface
- not present on ST boards
- HyperFlash memory on the OCTOSPI interface
- not present on ST boards
The next section lists all partitions used on STM32MPU boards (size, name, and content), and the following sections show how they are mapped on the different types of Flash memory.
2. Flash partitions[edit | edit source]
The tables below list the partitions defined for STMP32MP1 and STM32MP2 boards in Cortex-A main processor mode and gives typical sizes with OpenSTLinux, that can be tuned, depending on the targeted application needs.
Size | Component | Comment |
---|---|---|
Remaining area | userfs | The user file system contains user data and examples |
768 Mbytes | rootfs | Linux root file system contains all user space binaries (executable, libraries, and so on), and kernel modules |
16 Mbytes | vendorfs | This partition is preferred to the rootfs for third-party proprietary binaries, and ensures that they are not contaminated by any open source licence, such as GPL v3 |
64 Mbytes | bootfs or boot (NAND) |
The boot file system contains:
|
2 * 256 Kbytes (*) | u-boot-env or uboot_config / uboot_config_r (NAND) |
This partition is used to store the U-Boot environment. uboot_config_r is used for redundancy management with uboot_config, in NAND Flash. |
(2 *) 4 Mbytes | fip | The TF-A firmware image package (FIP) is a binary file that encapsulates several binaries, and their certificates (optionally, for authentication), that will be loaded by TF-A BL2. OpenSTLinux FIP contains:
There are two partitions, fip-a and fip-b, when A/B (seamless) FIP firmware update is activated in TF-A BL2. |
256 Kbytes to 512 Kbytes (*) | metadata | Metadata are used by TF-A BL2 to localize the FIP version to use, when the FIP is subject to firmware update.
Notes:
|
2 * 256 Kbytes to 512 Kbytes (*) | fsbla | The first stage boot loader is Arm Trusted Firmware (TF-A). At least two copies are embedded (fsbla1, fsbla2). Notes:
|
(*): The partition size depends on the Flash technology, to be aligned to the block erase size of the Flash memory present on the board: NOR (256 Kbytes) / NAND (512 Kbytes).
![]() |
Some boards can be equipped with multiple Flash devices, like the STM32MP15 EVAL board, where all of the Flash devices can be programmed with STM32CubeProgrammer. However, caution must be taken for the serial NOR/NAND and SLC NAND because a static bootable MTD partitioning is defined in U-Boot default config (see MTD configuration for details), with the consequence that up to 6 Mbytes of space is lost at the beginning of each such device, even those which are not bootable. |
3. SD card memory mapping[edit | edit source]
The SD card has to be partitioned with GPT format in order to be recognized by the STM32MP1 and STM32MP2 ROM code. The easiest way to achieve this is to use STM32CubeProgrammer.
The ROM code looks for the GPT entries whose name begins with "fsbl": fsbl1 and fsbl2 for example.
Note: The SD card can be unplugged from the board and inserted into a Linux host computer for direct partitioning with Linux utilities and access to the bootfs, rootfs and userfs partitions. The file system is Linux EXT4.

4. e•MMC memory mapping[edit | edit source]
The e•MMC embeds four physical partitions:
- Boot area partition 1: one copy of the FSBL
- Boot area partition 2: one copy of the FSBL
- User data area: formatted with GPT partitioning and used to store all remaining partitions
- Replay Protected Memory Block (RPMB): not shown in the figure below, since not involved in the current boot chain.
STM32CubeProgrammer has to be used to prepare the e•MMC with the layout shown below, and to populate each partition.
![]() |
The boot area partition used by the e•MMC boot sequence is selected via the EXT_CSD[179] register in the e•MMC. The STM32CubeProgrammer execution is concluded with the selection of the last written partition from the flashlayout file, typically partition 2. The other copy is never used as long as the user does not explicitly change the e•MMC EXT_CSD[179] register to select it. |

5. NOR memory mapping[edit | edit source]
As NOR Flash memory is expensive, its size is usually limited to the minimum needed to store only the bootloaders. The system files (bootfs, rootfs and userfs) are usually stored in another Flash memory, such as the SD card in OpenSTLinux distribution.
STM32CubeProgrammer must be used to prepare the NOR Flash and the SD card with the layout shown below, and to populate each partition.

It is possible to use an e•MMC card or NAND as second-level Flash memory, rather than an SD card. This requires the following aspects to be changed:
- The Flash memory layout, using STM32CubeProgrammer in order to write the rootfs and userfs to the targeted Flash memory
- The Linux kernel parameters, using U-Boot, in order to indicate where the rootfs and userfs have to be mounted.
6. NAND memory mapping[edit | edit source]
STM32CubeProgrammer has to be used to prepare the NAND Flash memory with the layout shown below, and to populate each partition.

![]() |
In the RAW/MTD area, the number of copies to embed and the number of blocks to reserve at the end of each partition, for future bad blocks replacement, are a critical part of NAND based product dimensioning ! The strategy has to take into account many parameters such as:
ST set foundations in the STM32MP1 and STM32MP2 devices in order to allow the integration of NAND flash memories but the product definition remains the customer responsibility. Please, contact your memory provider for further advice. |