Last edited 3 weeks ago

STM32 MPU Flash mapping for Android

Applicable for STM32MP25x lines

Warning DB.png Important
OpenSTDroid is validated against the ecosystem release v5.1.0 . It has not been ported yet on ecosystem release v6.0.0 More info.png .

This article shows the mapping used in STM32MPU Embedded Software distribution for Android™ for ST boards, that can be used as starting point for other boards.

1. Supported Flash memory technologies[edit | edit source]

STM32MP2 series supports different types of Flash memories. For Android, it has been limited to the eMMC on the SDMMC interface. As the eMMC area can be limited, an hybrid configuration is also available for test and demo purpose, using SD card for data partitions.

2. Flash partitions[edit | edit source]

The tables below list the partitions defined for STM32MP2 boards in Cortex-A main processor mode and give typical sizes with OpenSTDroid, that can be tuned, depending on the targeted application needs.

Size Component Comment
Remaining area userdata The user file system contains user data and examples
16 Mbytes metadata This partition contains the userdata metadata
1.4 GKbytes super This partition contains Android system, system_ext, vendor and product logical partitions
512 Kbytes misc This partition contains a raw partition used to share information between Android and the bootloader
512 Kbytes dtbo This partition contains the kernel device tree overlay (board configuration)
16 Mbytes vendor_boot This partition contains the kernel device tree (SoC configuration) and the vendor ramdisk
64 Mbytes boot This partition contains the Linux kernel image and the generic ramdisk.
512 Kbytes vbmeta This partition contains the metadata required for the verified boot mechanism.
512 Kbytes splash This partition contains the splash screen image (bmp format).
512 Kbytes u-boot-env This partition is used to store the U-Boot environment.
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.

OpenSTDroid FIP contains:

512 Kbytes fsbl The first stage boot loader is Arm Trusted Firmware (TF-A). At least two copies are embedded.

3. eMMC memory mapping[edit | edit source]

The eMMC 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.

STM32CubeProgrammer has to be used to prepare the eMMC with the layout shown below, and to populate each partition.

Info white.png Information
The boot area partition used by the eMMC boot sequence is selected via the EXT_CSD[179] register in the eMMC. 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 eMMC EXT_CSD[179] register to select it.
EMMC mapping for Android.png

4. Flashing the built images[edit | edit source]

When the distribution has been built, please refer to the How to populate boards for Android page to learn how to flash your device.