How to build STM32MPU distribution for Android

Revision as of 16:18, 8 August 2019 by Registered User


1. Article purpose[edit source]


This article is intended for Distribution Package users (see Which Package better suits your needs for more information).

This page explains how to change build the STM32MPU distribution.

2. Prerequisites[edit source]

The environment must be installed using the Distribution Package adapted to your selected microprocessor device, STM32MP1 Distribution Package for Android. You should also follow the PC prerequisites dedicated to Android to ensure all necessary packages to use the environment are present.

3. Build[edit source]

Before doing anything you should launch the command:

 source ./build/envsetup.sh

This will set all the necessary environment variables needed to execute every script and to work in the distribution environment. It is mandatory to start with this command as soon as you are in a new terminal.

The command:

 hmm 

will list some interested aliases created by envsetup.sh.

If you have never set up an environment to build Android continue to read. Otherwise you can directly go to Choosing a build target

3.1. Memory settings[edit source]

It is possible to change the memory size and type you want to use. More information in How to customize the STM32MPU distribution for Android

Edit the file device/stm/stm32mp1/layout/android_layout.config.

Locate the two lines below:

PART_MEMORY_TYPE
PART_MEMORY_SIZE

Current options are :

  • PART_MEMORY_TYPE sd and PART_MEMORY_SIZE 8GiB
  • PART_MEMORY_TYPE sd and PART_MEMORY_SIZE 4GiB
  • PART_MEMORY_TYPE emmc and PART_MEMORY_SIZE 4GiB

When change have been done on the file you need to relaunch the previous command:

 source ./build/envsetup.sh

3.2. Setup[edit source]

This setup needs to be executed only once.

 <SocId>setup

This will apply specific patches link with your <SocId> to customize Android and load the necessary libraries and modules.

3.3. Choosing a build target[edit source]

You need to choose your target device to set up the build environment. Launch the command

 lunch aosp_<BoardId>-<build_type>

Available build_type values:

  • user: to generate an end-user production image;
  • userdebug: similar to an user build but with root access and debug capabilities;
  • eng: development configuration with additional debugging tools.

3.4. Generating the image[edit source]

You are now ready to compile. Just do:

 make -j

This command can take several hours on the first build, depending on your computer settings and on whether this is your first build.

When the build is finish the result can be found in the out folder.

Generated images are located in out/target/product/<BoardId>

To flash images please refer to Flashing the built image