Building Linux Kernel Print


This application note explains how to build Linux kernel images for the Emcraft STM32MP1 System-On-Module. 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 ./

  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 SOM 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 Linux tarball:
  9. $ tar xfz meta-emcraft/recipes-kernel/linux/linux-stm32mp/linux-emcraft-4.14-stm32mp1.tar.gz
    $ cd linux

  10. Copy the Device Source Tree file for the STM32MP1 SOM into the kernel tree:
  11. $ cp ../meta-emcraft/recipes-kernel/linux/linux-stm32mp/stm32mp1-som.dts arch/arm/boot/dts/

  12. Configure the kernel tree build:
  13. $ cp ../meta-emcraft/recipes-kernel/linux/linux-stm32mp/stm32mp1-som.kernel arch/arm/configs/stm32mp1-som_defconfig
    $ make stm32mp1-som_defconfig

  14. Build the kernel image:
  15. $ make -s -j10 uImage LOADADDR=0xC2000040
    $ ls -l arch/arm/boot/uImage

  16. Build the DTB:
  17. $ make stm32mp1-som.dtb
    $ ls -l arch/arm/boot/dts/stm32mp1-som.dtb

  18. Build kernel modules:
  19. $ make modules