PC prerequisites about STM32MPU distribution for Android

Revision as of 18:12, 7 January 2019 by deleted>Frq08988
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Template:ArticleMainWriter Template:ArticleApprovedVersion


Before downloading and building the STM32MPU distribution for Android, make sure your system meets the following requirements:

  • 64-bit environment.
  • At least 150 Gbytes of free disk space. If you conduct multiple builds or employ ccache, even more space is required.
  • At least 8 Gbytes of RAM/swap. If you are running Linux on a virtual machine, at least 16 Gbytes of RAM/swap are required.

For more détails, refer to Android web site[1].

Use the following commands to install the packages required to build an environment for Android[2] (Distribution Package):

sudo apt-get update
sudo apt-get install openjdk-8-jdk chrpath curl libxml2-utils

To avoid memory allocation errors when less than 16 Gbytes of RAM are available in your system, you can use the ANDROID_JACK_VM_ARGS environment variable to specify how much memory 'Jack' can be used. Most of the time, allocating 50% of your server RAM is enough. Example of a server featuring 8 Gbytes of RAM:

export ANDROID_JACK_VM_ARGS="-Xmx4g -Dfile.encoding=UTF-8 -XX:+TieredCompilation"

You may need to select Java OpenJDK version 8 instead of the existing one. To do this, use the following commands:

$ sudo update-alternatives --config java
$ sudo update-alternatives --config javac

By default, regular users cannot directly access USB devices. To allow such access, the system must be configured as follows:

  • Create the 51-stm-android.rules file within /etc/udev/rules.d/ directory with the following content:
# adb/fastboot protocol on stm
SUBSYSTEM=="usb", ATTR{idVendor}=="0483", ATTR{idProduct}=="df11", MODE="0666", GROUP="plugdev"
SUBSYSTEM=="usb", ATTR{idVendor}=="0483", ATTR{idProduct}=="5270", MODE="0666", GROUP="plugdev"
  • You then have to reload the udev rules by executing the following command:
$ udevadm control --reload-rules

At this stage: Your environment is ready for Android build, debug and test.



Article references:

  1. Android requirements page : https://source.android.com/setup/requirements
  2. Establishing a Build Environment: http://source.android.com/source/initializing.html