9.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
9.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 L4.19.35_1.1.0_LINUX_DOCS documentation package (available on https://www.nxp.com/design/i-mx-developer-resources/i-mx-software-and-development-tools:IMX-SW under the header Overview - Documentation - Linux 4.19.35_1.1.0 Documentation 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-4-19-35-1-1-0
cd ~/projects/imx-yocto-bsp-4-19-35-1-1-0
repo init -u https://source.codeaurora.org/external/imx/imx-manifest -b imx-linux-warrior -m imx-4.19.35-1.1.0.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-4-19-35-1-1-0/sources
cd ~/projects/imx-yocto-bsp-4-19-35-1-1-0/sources
tar xzvf meta-custom.tgz
9.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-4-19-35-1-1-0
DISTRO=fsl-imx-wayland MACHINE=imx8mqevk source fsl-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 "
# -SIMW
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-4-19-35-1-1-0/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.
9.5.1.3. Create and install SDK and Root file system on Host¶
To populate SDK, run:
cd ~/projects/imx-yocto-bsp-4-19-35-1-1-0
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-4-19-35-1-1-0/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.
9.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 |
