STM32CubeProgrammer

Installing STM32CubeProgrammer [1]

Note

The following instructions were tested on Ubuntu 16.04.

STM32CubeProgrammer requires 1.8 version of the Java platform.

sudo apt install openjdk-8-jre
sudo update-alternatives --config java

Select the java-8-openjdk configuration.

Create a directory on your computer:

mkdir $HOME/STM32MPU_workspace/STM32MPU-Tools
mkdir $HOME/STM32MPU_workspace/STM32MPU-Tools/STM32CubeProgrammer-2.2.0

Download the STM32CubeProgrammer v2.2.0 to your computer.

Uncompress the archive file to get the STM32CubeProgrammer installers:

unzip SetupSTM32CubeProgrammer.zip

Execute the Linux installer, which guides you through the installation process. Select “$HOME/STM32MPU-Tools/STM32CubeProgrammer-2.2.0” as the installation directory, when it’s requested by the installer.

./SetupSTM32CubeProgrammer-2.2.0.linux

Add the STM32CubeProgrammer binary path to your PATH environment variable. So append the ~/.bashrc with:

export PATH=$HOME/STM32MPU_workspace/STM32MPU-Tools/STM32CubeProgrammer-2.2.0/bin:$PATH

After this re-source ~/.bashrc:

source ~/.bashrc

Check that the STM32CubeProgrammer tool is properly installed and accessible:

$: STM32_Programmer_CLI --h

-------------------------------------------------------------------
                  STM32CubeProgrammer v2.2.0
-------------------------------------------------------------------

Flash the eMMC

  1. Enable the bootmode on your Evaluation Kit. If you need help see Enabling Bootmode.
  2. Plug-in the Evaluation Kit to power it up.
  3. Press the reset button.
  4. Go to the directory where your Images have been deployed to, or you downloaded our precompiled images to.
cd $HOME/yocto/karo-stm-bsp/tmp-glibc/deploy/images/<machine-name>
  1. Get the device port location for the USB link.
$: STM32_Programmer_CLI -l usb
   -------------------------------------------------------------------
                     STM32CubeProgrammer v2.1.0
   -------------------------------------------------------------------

=====  DFU Interface   =====

Total number of available STM32 device in DFU mode: 1

Device Index           : USB1 <--- see this
USB Bus Number         : 001
USB Address Number     : 005
Product ID             : DFU in HS Mode @Device ID /0x500, @Revision ID /0x0000
Serial number          : 0042001E3438511438333630
Firmware version       : 0x0110
Device ID              : 0x0500
  1. Program the eMMC with the headless image. For a desktop environment use the files in flashlayout_st-image-weston/ folder.
STM32_Programmer_CLI -c port=usb1 -w flashlayout_st-image-core/FlashLayout_emmc_stm32mp157c-qsmp-1570-basic.tsv

Note

When using the trusted Flashlayout we noticed that GPU was no longer working. Everything else worked fine.

Tip

After the setup has run you can disable bootmode and reset your board. You eventually have to fit your u-boot environment to let the image to boot.

[1]From https://wiki.st.com/stm32mpu/index.php/Getting_started/STM32MP1_boards/STM32MP157C-DK2/Let%27s_start/Populate_the_target_and_boot_the_image