Last edited 2 weeks ago

How to build OpenSTDroid distribution

Applicable for STM32MP25x lines


This article explains how to build the OpenSTDroid distribution. It is intended for Distribution Package users.

1. Prerequisites[edit source]

The environment must be installed using the Distribution Package adapted to your microprocessor device.

In addition follow the PC prerequisites dedicated to Android to make sure all the packages required to use the environment are present.

2. Build[edit source]

First execute the following command:

 source ./build/envsetup.sh

It sets several required environment variables for the build and adds several useful scripts in your path. It is mandatory to start with this command as soon as you are using a new terminal.

Use the command below to list some interested aliases created by envsetup.sh:

 hmm 


If this is the first time you set up an environment to build Android, continue to read this article. Otherwise directly go to Choosing a build target.

2.1. Choosing a build target[edit source]

To choose your target device, execute the command below:

 lunch aosp_<BoardId>-<build_type>

The available build_type values are the following:

  • 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.

2.2. Platform setup[edit source]

Execute this <STM32Series> setup only once, for example for STM32MP2 Series:

 stm32mp2setup

It applies specific patches related to your <STM32Series> to customize Android and load the necessary libraries and modules.

Info white.png Information
The stm32mp2setup instruction needs to be run only once for the distribution


2.3. Customizing the distribution[edit source]

To customize the distribution, refer to How to customize OpenSTDroid distribution page.

2.4. Generating the image[edit source]

Info white.png Information

In case you selected user build, it's recommended to rebuild the kernel as the prebuilt images contains by default debug options (see How to build kernel for Android)

You are now ready to build. To do this, just launch the command:

 make -j

Depending on your computer settings, several hours might be required to execute this command on the first build.

The result can be found in the out folder. The generated partition images are located in out/target/product/<BoardId>.

To flash images, refer to How to populate boards for Android page.