STM32MP1 Distribution Package for Android

Revision as of 09:29, 9 July 2019 by Registered User

Template:ArticleMainWriter Template:ArticleApprovedVersion


1. Distribution Package content[edit source]

If you are not yet familiar with the STM32MPU Embedded Software for Android distribution and its Packages, please read the following articles:


To sum up, this Distribution Package provides:

  • an Android build framework (aka distribution builder)
  • for the STM32MPU distribution for Android (development on Arm Cortex-A processor):
    • the BSP (Linux kernel, U-Boot, TF-A, optionally OP-TEE) pieces in binary (prebuilt). Several scripts are provided to load source code and re-build them.
    • the application frameworks (including hardware abstraction code) pieces in source code.


  • for the STM32Cube MPU Package (development on Arm Cortex-M processor), all pieces of software in source code: BSP, HAL, middlewares and applications
  • a toolset to tune the system for your needs, and to handle the built image (e.g. STM32CubeProgrammer to install the built image on the board)

2. Checking the prerequisites[edit source]

2.1. Knowledges[edit source]

The STM32MP1 Distribution Package aims at creating an Android distribution for the targeted product: solid knowledges about Linux and Android are recommended to make the most of this Package.

The STM32MPU distribution for Android is an Android distribution based on the Android build framework: a short introduction about Android is available in AOSP[1].

Having a look at the STM32MPU Embedded Software for Android architecture overview is also highly recommended.

2.2. Development setup[edit source]

The recommended setup for the development PC (host) is specified in the following article: PC prerequisites.

Whatever the development platform (board) and development PC (host) used, the range of possible development setups is illustrated by the picture below.

Development setup for Developer and Distribution Packages


The following components are mandatory:

  • Host PC for cross-compilation and cross-debugging, installed as specified above
  • Board assembled and configured as specified in the associated Starter Package article
  • Mass storage device (for example, microSD card) to load and update the software images (binaries)

The following components are optional, but recommended:

  • A serial link between the host PC (through Terminal program) and the board for traces (even early boot traces), and access to the board from the remote PC (command lines)
  • An Ethernet link between the host PC and the board for cross-development and cross-debugging through a local network. This is an alternative or a complement to the serial (or USB) link
  • A display connected to the board, depending on the technologies available on the board: DSI LCD display, HDMI monitor (or TV) and so on
  • A mouse and a keyboard connected through USB ports

Additional optional components can be added by means of the connectivity capabilities of the board: cameras, displays, JTAG, sensors, actuators, and much more.

3. Installing the STM32MPU distribution for Android[edit source]

Under construction.png Delivery for Android coming soon (Q4 2019)

4. Building the STM32MPU distribution for Android[edit source]

Under construction.png Delivery for Android coming soon (Q4 2019)

5. Flashing the built image[edit source]

The Android images flashing is done in two steps inside flasher-device script:

  • 1st boot stages are flashed though USB DFU by STM32CubeProgrammer
  • Android images are flashed though USB fastboot

5.1. Installing the STM32CubeProgrammer tool[edit source]

STM32CubeProgrammer for Linux® host PC STM32CubeProgrammer for Windows® host PC
Download

Version 2.4.0

  • To access the SetupSTM32CubeProgrammer link and follow instructions to download the package, you need a myST account.
  • Download the archive file on your host PC in a temporary directory
  • Uncompress the archive file to get the STM32CubeProgrammer installers:


unzip en.stm32cubeprog.zip

Installation
  • Execute the Linux installer, which guides you through the installation process.
./SetupSTM32CubeProgrammer-2.4.0.linux
  • The path to the STM32CubeProgrammer binary must be added to the PATH environment variable
    • either in each Terminal program in which the STM32CubeProgrammer binary needs to be used, using the following command:
export PATH=<my STM32CubeProgrammer install directory>/bin:$PATH
  • or once for all by creating a link to the STM32CubeProgrammer binary in a directory already present in PATH. For example, if "/home/bin" is in the PATH environment variable, run the following command:
ln -s <my STM32CubeProgrammer install directory>/bin/STM32_Programmer_CLI /home/bin/STM32_Programmer_CLI
  • Execute the Windows installer, which guides you through the installation process.
User manual
Detailed release note
  • Details about the content of this tool version are available from ST web site at Release Note .


5.2. Preparing the USB serial link for flashing[edit source]

It is recommended to use the USB (in DFU mode) for flashing rather than the UART, which is too slow.

Below indications on how to install the USB in DFU mode under Linux and Windows OS, respectively.

  • For Linux host PC or Windows host PC with VMWare:

The libusb1.0 package (including USB DFU mode) must be installed to be able to connect to the board via the USB port. This is achieved by typing the following command from the host PC terminal:

 sudo apt-get install libusb-1.0-0


To allow STM32CubeProgrammer to access the USB port through low-level commands, proceed as follows:

 cd <your STM32CubeProgrammer install directory>/Drivers/rules 
sudo cp *.* /etc/udev/rules.d/
  • For Windows host PC:

Run the “STM32 Bootloader.bat” file to install the STM32CubeProgrammer DFU driver and activate the STM32 microprocessor device in USB DFU mode. This driver (installed by STM32 Bootloader.bat) is provided within the STM32CubeProgrammer release package. It is located in the DFU driver folder, \Drivers\DFU_Driver.

In case of issue, refer to How to proceed when the DFU driver installation fails on Windows host PC.

To validate the installation, the DFU driver functionality can be verified by following the FAQ instructions provided in how to check if the DFU driver is functional.


5.3. Image flashing[edit source]

Let's flash the downloaded image on the microSD card:

  • Set the boot switches (1) to the off position
  • Connect the USB Type-C (OTG) port (2) to the host PC that contains the downloaded image
  • Insert the delivered microSD card into the dedicated slot (3)
  • Connect the delivered power supply to the USB Type-C port (4)
  • Press the reset button (5) to reset the board
Discovery kit connections for flashing
STM32MP157C-DK2 shown here (picture is not contractual)
  • Go to the Distribution Package directory, and run flash-device:
 flash-device
  • Select the flashlayout you want to use (ex:FlashLayout_sd_optee.tsv to flash optee build for microSD card)
1) FlashLayout_emmc_optee.tsv	 3) FlashLayout_sd_optee.tsv
2) FlashLayout_sd_trusted.tsv	 4) FlashLayout_emmc_trusted.tsv
Which layout do you want to flash ?
This operation takes several seconds.
  • When images are downloaded though DFU, set the boot switches (1) to the on position
  • press on reset button, and make a long press on the button associated to fastboot (USER2 for Disco board and PA13 for Eval board) : images download will continue.
This operation takes several minutes.
  • When download is finished, press the reset button (5) to reset the board : the Android software will start.

6. References[edit source]