11.5.1. Setup i.MX 8MQuad
- MCIMX8M-EVK
¶
This section explains how to create an SD card image (including native
compilation tools) and a cross-compilation environment for the MCIMX8M-EVK
.
Note
Evaluation Board Type
This guidelines refers to the MCIMX8M-EVK
evaluation board.
Please refer to the bottom of this page for guidelines on connecting the SE050 Arduino shield to the
MCIMX8M-EVK
11.5.1.1. Downloading and Installing Yocto for MCIMX8M-EVK
¶
Please consult first the detailed information that can be found on https://www.nxp.com. Download the L5.4.70_2.3.4_LINUX_DOCS documentation package (available on https://www.nxp.com/design/software/embedded-software/i-mx-software/embedded-linux-for-i-mx-applications-processors:IMXLINUX?tab=Documentation_Tab under the Supporting Information header) and take the i.MX Yocto Project User’s Guide as a starting point.
Yocto must be installed on a Linux PC (consult the documentation for the Linux distributions officially supported), it’s possible to use a Virtual PC environment as e.g. Virtual Box. The Linux PC must have access to the internet to retrieve additional packages, tools and sources.
Having set-up all tools and packages required by Yocto, initialize a local git repository as follows:
mkdir -p ~/projects/imx-yocto-bsp-5-4-70-2-3-4
cd ~/projects/imx-yocto-bsp-5-4-70-2-3-4
repo init -u https://source.codeaurora.org/external/imx/imx-manifest -b imx-linux-zeus -m imx-5.4.70-2.3.4.xml
repo sync
Add a custom Yocto layer. This custom Yocto layer is part of the Plug&Trust SW
distribution (simw_top/scripts/yocto/layers/meta-custom.tgz
) and must
be copied and unpacked into the sources directory created above. Note: this
custom layer adds a Python package (func-timeout):
cp <PlugTrust>/simw_top/scripts/yocto/layers/meta-custom.tgz ~/projects/imx-yocto-bsp-5-4-70-2-3-4/sources
cd ~/projects/imx-yocto-bsp-5-4-70-2-3-4/sources
tar xzvf meta-custom.tgz
11.5.1.2. Prepare an embedded Linux distribution for the MCIMX8M-EVK
board¶
The bitbake target core-image-full-cmdline
created for
MCIMX8M-EVK
contains a busybox implementation of the usual Unix
command line tools. It assumes you will interact with the embedded system over
the command line:
cd ~/projects/imx-yocto-bsp-5-4-70-2-3-4
DISTRO=fsl-imx-wayland MACHINE=imx8mqevk source imx-setup-release.sh -b build-wayland-imx8mqevk
Now, before issuing the bitbake command, edit two configuration files.
First edit the build-wayland-imx8mqevk/conf/bblayers.conf
so it contains a
reference to the custom layer. Add the following line at the end of the file:
BBLAYERS += " ${BSPDIR}/sources/meta-custom"
The resulting build-wayland-imx8mqevk/conf/bblayers.conf
file will look as
follows:
LCONF_VERSION = "6"
BBPATH = "${TOPDIR}"
BSPDIR := "${@os.path.abspath(os.path.dirname(d.getVar('FILE', True)) + '/../..')}"
BBFILES ?= ""
BBLAYERS = " \
${BSPDIR}/sources/poky/meta \
${BSPDIR}/sources/poky/meta-poky \
\
${BSPDIR}/sources/meta-openembedded/meta-oe \
${BSPDIR}/sources/meta-openembedded/meta-multimedia \
\
${BSPDIR}/sources/meta-freescale \
${BSPDIR}/sources/meta-freescale-3rdparty \
${BSPDIR}/sources/meta-freescale-distro \
"
# i.MX Yocto Project Release layers
BBLAYERS += " ${BSPDIR}/sources/meta-fsl-bsp-release/imx/meta-bsp "
BBLAYERS += " ${BSPDIR}/sources/meta-fsl-bsp-release/imx/meta-sdk "
BBLAYERS += " ${BSPDIR}/sources/meta-fsl-bsp-release/imx/meta-ml "
BBLAYERS += "${BSPDIR}/sources/meta-browser"
BBLAYERS += "${BSPDIR}/sources/meta-rust"
BBLAYERS += "${BSPDIR}/sources/meta-openembedded/meta-gnome"
BBLAYERS += "${BSPDIR}/sources/meta-openembedded/meta-networking"
BBLAYERS += "${BSPDIR}/sources/meta-openembedded/meta-python"
BBLAYERS += "${BSPDIR}/sources/meta-openembedded/meta-filesystems"
BBLAYERS += "${BSPDIR}/sources/meta-qt5"
# +SIMW
BBLAYERS += " ${BSPDIR}/sources/meta-custom"
# -SIMW
Next edit the file build-wayland-imx8mqevk/conf/local.conf
so it matches the
following:
MACHINE ??= 'imx8mqevk'
DISTRO ?= 'fsl-imx-wayland'
PACKAGE_CLASSES ?= 'package_rpm'
# EXTRA_IMAGE_FEATURES ?= "debug-tweaks"
# + SIMW: Extended EXTRA_IMAGE_FEATURES
EXTRA_IMAGE_FEATURES ?= "debug-tweaks dev-pkgs tools-debug tools-sdk tools-testapps package-management"
USER_CLASSES ?= "buildstats image-mklibs image-prelink"
PATCHRESOLVE = "noop"
BB_DISKMON_DIRS ??= "\
STOPTASKS,${TMPDIR},1G,100K \
STOPTASKS,${DL_DIR},1G,100K \
STOPTASKS,${SSTATE_DIR},1G,100K \
STOPTASKS,/tmp,100M,100K \
ABORT,${TMPDIR},100M,1K \
ABORT,${DL_DIR},100M,1K \
ABORT,${SSTATE_DIR},100M,1K \
ABORT,/tmp,10M,1K"
PACKAGECONFIG_append_pn-qemu-system-native = " sdl"
PACKAGECONFIG_append_pn-nativesdk-qemu = " sdl"
CONF_VERSION = "1"
DL_DIR ?= "${BSPDIR}/downloads/"
ACCEPT_FSL_EULA = "1"
# +SIMW
IMAGE_ROOTFS_EXTRA_SPACE = "640000"
IMAGE_INSTALL_append += " rng-tools openssl-bin"
IMAGE_INSTALL_append += " cmake curl git subversion "
# If you want git-submodule
# IMAGE_INSTALL_append += " git-perltools findutils "
IMAGE_INSTALL_append += " python3-pip python3-click python3-cryptography python3-pycparser python3-cffi "
# opcua
IMAGE_INSTALL_append += " python-logging "
IMAGE_INSTALL_append += " e2fsprogs-resize2fs func-timeout "
IMAGE_INSTALL_append += " i2c-tools "
IMAGE_INSTALL_append += " python3-misc"
IMAGE_INSTALL_append += " opensc "
# -SIMW
Note
At this stage it’s possible to also include the Plug&Trust package as a Yocto recipe. Refer to Alternative approach to create SD card: use Yocto recipe for Plug&Trust package on how to do this.
The above local.conf file prepares an embedded Linux distribution with native development tools
After updating the file build-wayland-imx8mqevk/conf/local.conf
issue the
following command:
bitbake core-image-full-cmdline
Note
Output Directory
The directory build-wayland-imx8mqevk will contain downloaded sources and build artefacts.
When the above bitbake command finished successfully a compressed sdcard image
containing bootloader, filesystem and linux kernel is available under
~/projects/imx-yocto-bsp-5-4-70-2-3-4/build-wayland-imx8mqevk/tmp/deploy/images/imx8mqevk/core-image-full-cmdline-imx8mqevk.wic.bz2
.
core-image-full-cmdline-imx8mqevk.wic.bz2
is a symbolic link to the
actual file name - which has a timestamp as part of the filename e.g.
core-image-full-cmdline-imx8mqevk-20191204234929.rootfs.wic.bz2
.
Copy the unzipped sdcard image to a microSD card either with the method described
in the ‘i.MX Yocto Project User’s Guide’ or on a Windows PC with e.g. the
Win32DiskImager tool.
Note
The embedded linux system prepared has a user root
that does not
require a password. Please define a password at your earliest convenience.
11.5.1.3. Create and install SDK and Root file system on Host¶
To populate SDK, run:
cd ~/projects/imx-yocto-bsp-5-4-70-2-3-4
MACHINE=imx8mqevk source setup-environment build-wayland-imx8mqevk
bitbake -c populate_sdk core-image-full-cmdline
To install the SDK in the default location /opt/fsl-imx-wayland/4.19-warrior
:
cd ~/projects/imx-yocto-bsp-5-4-70-2-3-4/build-wayland-imx8mqevk/tmp/deploy/sdk/
./fsl-imx-wayland-glibc-x86_64-core-image-full-cmdline-aarch64-toolchain-4.19-warrior.sh
You have now installed a set of cross-compilation tools for the MCIMX8M-EVK
board on the Linux Host PC.
11.5.1.4. Connecting the MCIMX8M-EVK
to the SE050 Arduino shield¶
The MCIMX8M-EVK
does not come with an Arduino connector, the following figure illustrates how to
make the connection with jump wires.

The same information summarized in a table.
Pin Function |
OM-SE050ARD pins |
MCIMX8M-EVK |
---|---|---|
I2C_SCL |
J2-10 |
J801-I2C-1 |
I2C_SDA |
J2-9 |
J801-I2C-3 |
GND |
J2-7 |
J801-I2C-2 |
3V3 |
J8-4 |
J801-I2C-5 |
11.5.1.5. Alternative approach to create SD card: use Yocto recipe for Plug&Trust package¶
The Plug&Trust MW package also includes a recipe.
Download the Plug&Trust MW from www.nxp.com/se050 and ensure the package version (e.g. 04.00.00) is appended to the file name. (For example: SE050-PLUG-TRUST-MW-v04.00.00.zip)
Put the se05x recipe (se05x_4.0.0.bb), the source code package (SE050-PLUG-TRUST-MW-v04.00.00.zip) and (if applicable) patches into the existing
.../sources/meta-custom/recipes directory
of the Yocto development PC (recipe and patches are available insimw-top/scripts/yocto/v04.00.00
)
The resulting imx-yocto-bsp-5-4-70-2-3-4/sources/meta-custom directory on the Yocto development PC should look like:
├── conf
│ └── layer.conf
├── README
└── recipes
├── func-timeout
│ └── func-timeout_4.3.3.bb
└── se05x
├── files
│ └── SE050-PLUG-TRUST-MW-v04.00.00.zip
└── se05x_4.0.0.bb
To add the Plug&Trust MW to the image to be created add the following line at the end of the
build-wayland-imx8mqevk/conf/local.conf
file:
IMAGE_INSTALL_append += " se05x"