Building U-Boot Print

 

This application note explains how to build the U-Boot image for booting the Emcraft STM32MP1 System-On-Module from SD card. Step through the following procedure:

  1. Download the Yocto toolchain from the Emcraft website.
  2. Install the toolchain to your development host. The toolchain can be installed to an arbitrary directory:
  3. $ sh ./meta-toolchain-qt5-openstlinux-weston-stm32mp1-som-x86_64-toolchain-2.4-snapshot.sh

  4. Activate the cross-build environment:
  5. $ source /opt/st/stm32mp1-som/2.4-snapshot/environment-setup-cortexa7hf-neon-vfpv4-openstlinux_weston-linux-gnueabi
    $ unset CCACHE_PATH

  6. Download the Emcraft STM32MP1 add-on Yocto layer from the Emcraft website and unpack it to an arbitrary directory on your development host:
  7. $ mkdir build
    $ cd build
    $ tar xfj meta-emcraft-stm32mp1.tar.bz2

  8. Unpack the U-Boot and imx-mkimage tarballs:
  9. $ tar xfz meta-emcraft/recipes-bsp/u-boot/u-boot-stm32mp/\
    u-boot-emcraft-2018.09-stm32mp1.tar.gz

    $ tar xfz meta-emcraft/recipes-bsp/trusted-firmware-a/tf-a-stm32mp/\
    tfa-emcraft-2.0-stm32mp1.tar.gz

  10. Clean up the build directory:
  11. $ cd u-boot/
    $ make distclean

  12. Configure the build:
  13. $ make stm32mp1_som_defconfig

  14. Build the STM32MP1 SOM U-Boot image:
  15. $ make

  16. The U-Boot image is here:
  17. ls -l u-boot.stm32

  18. Build the ARM Trusted Firmware image:
  19. make -C tools/stm32image
    make LDFLAGS= CFLAGS= PLAT=stm32mp1 ARCH=aarch32 ARM_ARCH_MAJOR=7 DEBUG=1 \
    LOG_LEVEL=40 STM32MP1_REV_A_REV_B=1 DTB_FILE_NAME=stm32mp1-som.dtb AARCH32_SP=sp_min

  20. The ARM Trusted Firmware image is here:
  21. $ ls -l build/stm32mp1/debug/tf-a-stm32mp1-som.stm32