iMX8MP-COMPACT-CM Yocto Linux
Overview
The Yocto Project is an open source collaboration project that helps developers create custom Linux-based systems for embedded products, regardless of the hardware architecture.
This article show how to build Yocto Image for iMX8MP-COMPACT-CM CPU module using:
Linux Kernel | U-BOOT | |
---|---|---|
Yocto micledore | 6.1.55 | v2023.04 |
Setting Boot mode
BOOT | J4:1-2 | J4:3-4 | J4:5-6 | J4:7-8 |
---|---|---|---|---|
Cortex-A53 Serial Downloader | close | open | open | open |
Cortex-A53, eMMC | open | close | open | open |
Terminal Setup
The carrier board connects the host PC using the micro-B USB connector (J6).
Common serial communication programs such as Minicom, HyperTerminal, Tera Term, or PuTTY can be used.
The iMX8MP-COMPACT-CM board uses the second port for the Arm Cortex-A cores console.
Installing required packages
Please make sure your host PC is running Ubuntu 20.04+ 64-bit and install the following packages:
$ sudo apt-get install gawk wget git diffstat unzip texinfo gcc-multilib \ build-essential chrpath socat cpio python3 python3-pip python3-pexpect \ xz-utils debianutils iputils-ping libsdl1.2-dev xterm python-is-python3 lz4 $ sudo apt-get install autoconf libtool libglib2.0-dev libarchive-dev python-git-doc \ sed cvs subversion coreutils texi2html docbook-utils \ help2man make gcc g++ desktop-file-utils libgl1-mesa-dev libglu1-mesa-dev \ mercurial automake groff curl lzop asciidoc u-boot-tools dos2unix mtd-utils pv \ libncurses5 libncurses5-dev libncursesw5-dev libelf-dev zlib1g-dev bmap-tools
More details about the Yocto Environment Setup can be found on the Yocto official site
Download Yocto based on Freescale Community BSP
$ git config --global user.name "Your Name" $ git config --global user.email "Your Email"
$ mkdir ~/bin $ curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo $ chmod a+x ~/bin/repo $ export PATH=~/bin:$PATH
$ mkdir ~/yocto-ronetix $ cd ~/yocto-ronetix
- Download the Yocto repository
$ repo init -u https://github.com/ronetix/imx-manifest -b imx-linux-mickledore -m imx-6.1.55-2.2.0.xml $ repo sync
Setup and build Yocto
- Setup first time:
$ MACHINE=imx8mp-cm DISTRO=fsl-imx-xwayland source ./imx-setup-release.sh -b build-imx8mp-cm
- or setup if already configured:
$ source setup-environment build-imx8mp-cm
- Build:
$ bitbake imx-image-core
Build Results
The resulted images are located in tmp/deploy/images/imx8mp-cm.
Booting Linux
This section describes how to copy the images (U-Boot, Linux kernel, device tree, and rootfs) to the eMMC device on the module.
Universal update utility
The Universal Update Utility (UUU) runs on a Windows or Linux OS host and is used to download images to devices on an i.MX board.
Downloading UUU
Download UUU version 1.5.21 or later from https://github.com/nxp-imx/mfgtools/releases
Write WIC image info eMMC
Follow the instructions below:
- Connect a USB cable from a computer to the J7, port USB Type C port on the carrier board for download link.
- Connect a USB cable from J6, port UART-DBG (Micro-AB) port to the computer for console output.
- Open a Terminal emulator program
- Set the boot mode to "Cortex-A53 Serial Downloader", see #Setting Boot mode
$ cd tmp/deploy/images/imx8mp-cm $ uuu -b emmc_all imx-boot-tagged imx-image-core-imx8mp-cm.wic.zst
Boot Linux
- set the boot mode to "Cortex-A53, eMMC", see #Setting Boot mode
- reset the board