i.MX 8 getting started: setup environment
This post will show you how to setup environment(Linux) for NXP i.MX 8 and build a image fot i.MX8 Mini EVK. If you trying to build a Android image, close this post.
Before start
Check your host environment:
- Fedora, openSUSE, CentOS, Debian, or Ubuntu(newer then 14.04, I test with 18.04)
- 120G disk space if graphical support is need
- Git is already setup on your machine
Install tools
There are some packages you might haven’t installed but required by Yocto:
- chrpath
- gawk
- u-boot-tools
use apt install install all of them.
Also for repo:
1 | $ curl https://storage.googleapis.com/git-repo-downloads/repo > /usr/local/bin/repo |
You can choose your own repo install path, but make sure this path was added into PATH.
Yocto project setup
We will use i.MX official repo to init.
1 | $ mkdir imx-yocto-bsp |
Use -b <branch-name> to switch to use other branch if you want. Check on https://source.codeaurora.org/external/imx/imx-manifest to find all available branches.
Start build
Choose one graphical backend for your image
- fsl-imx-x11
- fsl-imx-wayland
- fsl-imx-xwayland
- fsl-imx-fb
For i.MX8, only fsl-imx-wayland and fsl-imx-xwayland are supported.
Then run:Set MACHINE to other variable if you are not using i.MX8 Mini EVK. Use -b in fsl-setup-release to specify build dir.1
2$ DISTRO=fsl-imx-xwayland MACHINE=imx8mmevk source fsl-setup-release.sh -b build-xwayland
$ bitbake fsl-image-qt5-validation-imx
Summaries of my build details:
1 | Build Configuration: |
Restart a build environment
1 | $ source setup-environment <build-dir> |
Flash
Using mfgtools provided by nxp to flash.
Flash to emmc:
1 | sudo uuu -b emmc_all imx-boot-imx8mmevk-sd.bin-flash_evk fsl-image-validation-imx-imx8mmevk.sdcard.bz2/* |
In develop stage, suggest to use TFTP and NFS for a longer flash life span. See i.MX setup TFTP and NFS for more details.