STM32MP15 Evaluation boards - Starter Package for Android

Revision as of 16:37, 19 February 2020 by Registered User

This article shows how to start up a STM32MPU Embedded Software distribution for Android™ on STM32MP157x-EV1 Evaluation boards (high-end development platforms for the STM32MP15 microprocessor devices). It is valid for the STM32MP157C-EV1 Evaluation boards: the part numbers are specified in the STM32MP15 microprocessor part numbers article.

It lists the required material, points to the board features description, and gives the step-by-step process to set up the system.

1 Starter Package content[edit]

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

To sum up, this Starter Package provides:

  • the software image for the STM32MPU Embedded Software distribution for Android™, which includes:
    • the binaries for the STM32MPU distribution for Android™
    • one or more firmware example(s) for the STM32Cube MPU Package
  • the tool (STM32CubeProgrammer) to install this image on the STM32MP15 Evaluation board
Components of the Starter Package

2 Material prerequisites[edit]


PC Linux or Windows operating systems. See PC prerequisites for more details on the required configurations
STM32MP157x-EV1 Evaluation board High-end development platform for the STM32MP15 microprocessor device including:
Power supply Power supply block (5V, 3A) for the MB1263 daughterboard
MicroSD card It is populated with OpenSTLinux distribution (Linux software), and provides extra storage capacity. A 2-Gbyte minimum MicroSD card is needed
USB micro-B cable It connects the STM32MP157x-EV1 Evaluation board to the PC through the USB micro-B (ST-LINK/V2-1) connector
USB micro-AB cable It connects the STM32MP157x-EV1 Evaluation board to an USB OTG device through the USB micro-AB connector


USB keyboard and mouse Thanks to the USB type A connectors, the STM32MP157x-EV1 Evaluation board can be equipped with a full-size keyboard and mouse
Ethernet cable It can connect the STM32MP157x-EV1 Evaluation board to a network through the RJ45 connector
RS232 cable It can connect the STM32MP157x-EV1 Evaluation board to the PC through the UART connector as an alternative of the ST-LINK/V2-1 connection
CAN cable It can connect the STM32MP157x-EV1 Evaluation board to CAN devices through the CAN FD/TT connectors
Trace cable It can connect the STM32MP157x-EV1 Evaluation board to an external tool through the Trace connector
JTAG cable It can connect the STM32MP157x-EV1 Evaluation board to an external tool through the JTAG connector

Optionally, devices and extension boards might be plugged to the STM32MP157x-EV1 Evaluation board thanks to connectors such as:

  • the Ethernet daughterboard connector
  • the GPIO expansion connector
  • the Motor control connector
  • ...

The following figure shows the material not included in the STM32MP15 Evaluation board package that is used in this Starter Package.

Recommended material for this Starter Package

3 Assembling the board[edit]

Warning white.png Warning
The starter package for Android™ is compatible only with STM32MP157C-EV1

STM32MP157C-EV1 - board assembly

4 Installing the tools[edit]

4.1 Installing the STM32CubeProgrammer tool[edit]

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

Version v2.15.0

  • Go on to download the STM32CubeProgrammer software
  • Download the archive file on your host PC in a temporary directory
  • Uncompress the archive file to get the STM32CubeProgrammer installers:


  • Execute the Linux installer, which guides you through the installation process.
$> ./SetupSTM32CubeProgrammer-2.15.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 .

4.2 Preparing the USB serial link for flashing[edit]

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 Downloading the image and flashing it on the board[edit]

5.1 Image download[edit]

The software package is provided AS IS, and by downloading it, you agree to be bound to the terms of the software license agreement (SLA0048). The detailed content licenses can be found here.

STM32MPU distribution for Android™
Tag Flash device Link Release note
st-android-10.0.0-2020-02-21 microSD card st-android-10.0.0-2020-02-21 release note
st-android-9.0.0-2019-09-27 microSD card st-android-9.0.0-2019-09-27 release note

5.2 Image flashing[edit]

The STM32CubeProgrammer tool is used to flash the STM32MP15 Evaluation board with the downloaded image.

Several Flash devices (microSD, eMMC...) are available on this board: to know more about the supported Flash memory technologies and the Flash partitions, refer to the STM32MP15 Flash mapping for Android article . The steps below consider the microSD card as the Flash device.

As explained in the boot chains overview, the trusted boot chain is the default solution delivered by STMicroelectronics. Thus, the steps below use the image corresponding to the trusted boot chain.

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

  • Remove the jumper JP1 (1).
  • Set the boot switches (2) to the off position.
  • Connect the USB micro-AB (OTG) port (3) to the host PC that contains the downloaded image.
  • Insert the delivered microSD card into the dedicated slot (4).
  • Connect the delivered power supply to the power connector (5) of the MB1263 daughterboard.
  • Press the reset button (6) to reset the board.

Evaluation board connections for flashing
STM32MP157A-EV1 shown here (picture is not contractual)
  • Go to the Starter Package directory (<version> and <date> depend on the delivery) that contains the binaries and the flash layout files:
 cd <Starter Package installation directory>/android-<version>-aosp-eval-sd-ev1-<date>/
Info white.png Information
The commands below correspond to a Linux host PC; however, they are similar for a Windows host PC except that STM32_Programmer_CLI is replaced by STM32_Programmer_CLI.exe.
  • Check that the STM32CubeProgrammer tool is installed and accessible; otherwise, go to the installation procedure (installing the tools):
 STM32_Programmer_CLI --h
                        STM32CubeProgrammer <tool version>                  
  • Get the device port location for the USB link:
 STM32_Programmer_CLI -l usb
                        STM32CubeProgrammer <tool version>                  

Total number of available STM32 device in DFU mode: 1

  Device Index           : USB1
  USB Bus Number         : 002
  USB Address Number     : 002
  Product ID             : DFU in HS Mode @Device ID /0x500, @Revision ID /0x0000
  Serial number          : 000000000000
  Firmware version       : 0x011a
  Device ID              : 0x0500
  • Flash the microSD card with the image:
 STM32_Programmer_CLI -c port=usb1 -w flashlayout/FlashLayout_sd_optee.tsv
This operation takes several minutes (mainly depending of the system partition size).

Go through the STM32CubeProgrammer article:

  • to use another Flash device than the microSD card
  • to know more about the flash loading operation

6 Booting the board[edit]

Now that the image is flashed on the STM32MP157x-EV1 Evaluation board, let's finalize the system configuration:

  • Step 1: check the configuration of the switches and jumpers:
    • The boot related switches must be configured so that the device (e.g. microSD card ) on which the image has been flashed is selected as boot source.
    • The jumpers related to the UART4 of the STM32MP15 microprocessor device must be set so that UART4 is used by the ST-LINK/V2-1 controller (7)
The figure below shows the boot switches for the recommended boot from microSD card.
Boot from microSD card
  • Step 2: (optionally) connect a USB keyboard and/or a USB mouse (not provided) using the USB type-A ports (10 and 11).
  • Step 3: (optionally) connect an Ethernet cable (not provided) to the dedicated connector (13).

MB1262 motherboardMB1263 daughterboard: STM32MP157x 18x18  PMIC  DDR3MB1230 DSI 720p displayMB1379 daughterboard cameraMicroSD card slotMB1263 power 5V-3AUSB micro-B (ST-LINK/V2-1) → PC virtual COM port and debugDisplay ledsReset button2 x USB type A (host) → E.g. mouse  keyboard  USB driver...2 x USB type A (host) → E.g. mouse  Keyboard  USB driver...UART → PC consoleEthernet → Network
STM32MP157x-EV1 Evaluation board connections

STM32MP157A-EV1 shown here (picture is not contractual)

  • Step 4: if the Flash device is a microSD card, check that it is inserted into the dedicated slot (5).
  • Step 5: connect the delivered power supply (5V, 3A) to the power connector (6) of the MB1263 daughterboard. Check that the display board (MB1230) is well connected. In this case, the 2 green LEDs (8) are switched on.
  • Step 6: (optionally) install and configure a remote Terminal program (e.g. Minicom on Ubuntu Linux PC or Tera Term on Windows PC) onto your host PC, and connect
    • either the ST-LINK/V2-1 USB micro-B port (7) to a host PC that runs a Terminal program with ST-LINK/V2-1 virtual port (recommended method)
    • or the RS232 UART4 connector (12) to the host PC that runs a Terminal program with COM1 port.
      • the ST-LINK/V2-1 USB micro-B port (7) and the RS232 UART4 connector (12) cannot be used simultaneously: see how to set the JP4 and JP5 jumpers to select one of the two configurations
  • Step 7: press the reset button (9) to reset the board

The board boots and the system will be available after few seconds.

7 Default resource allocation for Arm® Cortex®-M4[edit]

A set of hardware peripheral resources are provided within the Starter Package for Android™. They are allocated by default in the Arm Cortex-M4 in order to run some examples.

Below the list of the hardware peripheral resources dedicated to the Arm Cortex-M4.
Be aware that these resources can be used when developing an Arm Cortex-M4 firmware using the Developer Package.

Category Hardware peripherals for Arm Cortex-M4
System Core DMA2, GPIO* (PA14 for User1 button, PD8 for LED7 Orange)
Analog ADC1, ADC2, DAC1
Timers TIM2, TIM7
Connectivity I2C5, SPI1, UART7
Security CRYPT2, HASH2, RNG2
Computing CRC2

* Any other GPIO not already used by the Arm Cortex-A Linux kernel can be used by the Arm Cortex-M4 firmware. Refer to the STM32MP15 Datasheet and to STM32MP15 Evaluation board schematics.

8 Examples[edit]

8.1 Examples running with the coprocessor service[edit]

The Starter Package for Android™ embeds some Android applications (named STCoproM4xxx) that interact with the Arm Cortex-M4 through the coprocessor services (CoproService).

These applications provide examples on how to configure, load and interact with the Arm Cortex-M4 firmware.

8.2 Examples running in standalone mode on Arm Cortex-M4[edit]

Some Arm Cortex-M4 firmware examples are includes both in the Starter Package for Android™ and in the STM32CubeMP1 Package.
They run in standalone mode on Arm Cortex-M4 core.

8.2.1 How to run the examples[edit]

Open a Linux console (please refer to How_to_get_Terminal), and follow the steps below:

  • Select examples related to your board
 cd /vendor/firmware/Cube-M4-examples/stm32mp157c/Examples
Example of output log:
console:/vendor/firmware/Cube-M4-examples/stm32mp157c/Examples $ ls -l
total 16
drwxr-xr-x 2 root shell 4096 2019-07-10 15:52 ADC_SingleConversion_TriggerTimer_DMA
drwxr-xr-x 2 root shell 4096 2019-07-10 15:52 TIM_DMABurst
  • Select the example to run:
 cd <Example_to_run>
Each example is structured as follows:
  |- ELF file for Arm Cortex-M4
Example of output log:
console:/vendor/firmware/Cube-M4-examples/stm32mp157c/Examples/ADC_SingleConversion_TriggerTimer_DMA $ ls -l
total 2000
-rw-r--r-- 1 root root 2190512 2019-07-10 15:52 ADC_SingleConversion_TriggerTimer_DMA.elf
-rw-r--r-- 1 root root    5515 2019-07-10 15:52 README

  • Read the README file carefully. It provides all the information about the example setup and verdict.
  • Start the firmware:

Use the following command to start the selected example:

#Enable first the super user rights
#Run the example
 fw_cortex_m4_<board_name>.sh start
Example of output log:
... fmw_name=Cube-M4-examples/stm32mp157c/Examples/ADC_SingleConversion_TriggerTimer_DMA/ADC_SingleConversion_TriggerTimer_DMA.elf
[  509.548381] remoteproc remoteproc0: powering up m4
[  509.552707] remoteproc remoteproc0: Booting fw image Cube-M4-examples/stm32mp157c/Examples/ADC_SingleConversion_TriggerTimer_DMA/ADC_SingleConversion_TriggerTimer_DMA.elf, size 2190512
[  509.552772] remoteproc remoteproc0: header-less resource table
[  509.557328] remoteproc remoteproc0: not resource table found for this firmware
[  509.557533] remoteproc remoteproc0: header-less resource table
[  509.575656] rproc-srm-dev m4@0:m4_system_resources:dac@40017000: Linked as a consumer to regulator.9
[  509.585570] rproc-srm-dev m4@0:m4_system_resources:adc@48003000: Linked as a consumer to regulator.9
[  509.606466] rproc-srm-core m4@0:m4_system_resources: bound m4@0:m4_system_resources:timer@40000000 (ops rproc_srm_dev_ops)
[  509.606496] rproc-srm-core m4@0:m4_system_resources: bound m4@0:m4_system_resources:timer@40005000 (ops rproc_srm_dev_ops)
[  509.606518] rproc-srm-core m4@0:m4_system_resources: bound m4@0:m4_system_resources:serial@4000f000 (ops rproc_srm_dev_ops)
[  509.606539] rproc-srm-core m4@0:m4_system_resources: bound m4@0:m4_system_resources:i2c@40015000 (ops rproc_srm_dev_ops)
[  509.609348] rproc-srm-core m4@0:m4_system_resources: bound m4@0:m4_system_resources:dac@40017000 (ops rproc_srm_dev_ops)
[  509.609381] rproc-srm-core m4@0:m4_system_resources: bound m4@0:m4_system_resources:spi@44004000 (ops rproc_srm_dev_ops)
[  509.609402] rproc-srm-core m4@0:m4_system_resources: bound m4@0:m4_system_resources:dma@48001000 (ops rproc_srm_dev_ops)
[  509.609428] rproc-srm-core m4@0:m4_system_resources: bound m4@0:m4_system_resources:adc@48003000 (ops rproc_srm_dev_ops)
[  509.609473] rproc-srm-core m4@0:m4_system_resources: bound m4@0:m4_system_resources:hash@4c002000 (ops rproc_srm_dev_ops)
[  509.609495] rproc-srm-core m4@0:m4_system_resources: bound m4@0:m4_system_resources:rng@4c003000 (ops rproc_srm_dev_ops)
[  509.609516] rproc-srm-core m4@0:m4_system_resources: bound m4@0:m4_system_resources:crc@4c004000 (ops rproc_srm_dev_ops)
[  509.609537] rproc-srm-core m4@0:m4_system_resources: bound m4@0:m4_system_resources:cryp@4c005000 (ops rproc_srm_dev_ops)
[  509.609558] rproc-srm-core m4@0:m4_system_resources: bound m4@0:m4_system_resources:qspi@58003000 (ops rproc_srm_dev_ops)
[  509.609577] rproc-srm-core m4@0:m4_system_resources: bound m4@0:m4_system_resources:button (ops rproc_srm_dev_ops)
[  509.609595] rproc-srm-core m4@0:m4_system_resources: bound m4@0:m4_system_resources:m4_led (ops rproc_srm_dev_ops)
[  509.610246] remoteproc remoteproc0: remote processor m4 is now up
This loads and starts the firmware using the Linux Remote Processor component in Arm Cortex-M4 core.
  • Stop the firmware

Use the following command to stop the example that is currently running:

 fw_cortex_m4_<board_name>.sh stop
Example of output log:
... fmw_name=Cube-M4-examples/stm32mp157c/Examples/ADC_SingleConversion_TriggerTimer_DMA/ADC_SingleConversion_TriggerTimer_DMA.elf
[ 1254.820404] remoteproc remoteproc0: warning: remote FW shutdown without ack
[ 1254.828392] rproc-srm-dev m4@0:m4_system_resources:dac@40017000: Dropping the link to regulator.9
[ 1254.833056] rproc-srm-dev m4@0:m4_system_resources:adc@48003000: Dropping the link to regulator.9
[ 1254.844085] remoteproc remoteproc0: stopped remote processor m4
This stops the firmware using the Linux Remote Processor component.
It releases the relevant resources settings used by the example.

9 How to go further?[edit]

Now that the image is flashed on the STM32MP15 Evaluation board, you might want to switch to the STM32MP1 Developer Package for Android, in order to develop your own application.