Last edited 2 weeks ago

STM32 MPU Flash mapping for Android

Applicable for STM32MP25x lines

Important
OpenSTDroid is validated against the ecosystem release v5.1.0 . It has not been ported yet on STM32 MPU ecosystem release v6. Visit the ecosystem release v5.1.0 wiki to access to user guide explaining how to port Android on top of STM32 MPU ecosystem release v5.

This article shows the mapping used in Android-based OpenSTDroid embedded software for ST boards, which can be used as a starting point for other boards.

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

The STM32MP2 series supports different types of flash memories. For Android™, it has been limited to e•MMC devices connected to an SDMMC interface. Using STM32MP2 series in M33-TD flavor , the memory mapping is in single boot storage device configuration (all the boot images are stored in a single storage which remains used by the Arm® Cortex®-A (secondary boot core)). As the eMMC area can be limited, a hybrid configuration is also available for test and demonstration purpose, using an SD card for data partitions.

2. Flash partitions[edit | edit source]

The table below lists the partitions defined for STM32MP2 boards in M33-TD flavor , which can be tuned depending on the targeted application needs.

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

  • the second stage bootloader (SSBL):
    • U-Boot binary
    • U-Boot device tree blob
  • the Trusty binary
  • the firmware configuration file used by TF-A BL2
fsbla The first stage bootloader is Arm Trusted Firmware (TF-A).
m33fw The Cortex-M33 firmware (including secure and non-secure) required to start the Fw-ST-M exosystem.

The content of the partition is linked to the MCUboot packaging and includes:

m33ddr The DDR firmware required to manage the DDR training.
fsblm The first stage bootloader is (MCUboot).

3. eMMC memory mapping[edit | edit source]

The eMMC embeds four physical partitions:

  • Boot area partition 1: one copy of the FSBLM
  • Boot area partition 2: one copy of the FSBLM
  • 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.

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

Information
The boot area partition used by the eMMC boot sequence is selected via the EXT_CSD [179] register of 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.

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

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