Fast Flashing STM32MP1 Boards

STM32CubeProgrammer is the official STMicroelectronics tool for creating partitions into any Flash device available on STM32 platforms. Once created, STM32CubeProgrammer allows populating and updating the partitions with the prebuilt binaries.

Unfortunately, this tool is quite slow.

Here we show a way to program our QSMP and TXMP modules much faster. Measurements have shown that programming is possible in 1/6 of the time or faster.

Prerequisites

  • USB port of the module connected to your Linux host (Either a native Linux PC or Linux on Windows with WSL)

  • You have downloaded precompiled images or built your own

  • uuu.auto is part of this

  • You have changed to the image directory in the command shell on your host

Start Fastboot

(Re-)boot the board and “Hit any key to stop autoboot” to get to the U-Boot command line interface

fastboot usb 0

Only if the above is not possible

U-Boot in fastboot mode can also be started via USB

Close the Bootmode Jumper (Enabling USB-Bootmode) - Reset the Board

sudo apt install dfu-util
dfu-util -a 1 -D tf-a-stm32mp157c-qsmp-1570-usb.stm32
dfu-util -a 3 -D fip-stm32mp157c-qsmp-1570-mfg.bin
dfu-util -a 0 -e

U-Boot starts in STM DFU mode. Cancel this and enable fastboot manually:

<CTRL-C>
fastboot usb 0

Only for Linux on Windows with WSL

Refer to Linux on Windows with WSL -> Connect USB devices

Open a Windows command shell with administrator permissions. Get the {busid} of the download gadget and attach it.

usbipd wsl list
usbipd bind --busid {busid}
usbipd attach --wsl --busid {busid}

Execute UUU

wget https://github.com/nxp-imx/mfgtools/releases/download/uuu_1.5.141/uuu
chmod a+x uuu
sudo ./uuu -v