User Guide for AVNET models including: EM-MC-SBC-IMX8M, MaaXBoard8ULP Single Board Computer, MaaXBoard8ULP, Single Board Computer, Board Computer, Computer

EM-MC-SBC-IMX8M-Linux-DG-V1.0

xiongjing

  MaaXBoard-8ULP-Linux-Yocto-Development-Guide-V3.1

MaaXBoard 8ULP | Avnet Boards

MaaXBoard-8ULP-Linux-Yocto-Development-Guide-v3.1


File Info : application/pdf, 14 Pages, 211.79KB

MaaXBoard-8ULP-Linux-Yocto-Development-Guide-V3.1 ?MOD=AJPERES&CACHEID=ROOTWORKSPACE-4fa62a19-239c-40c9-aff6-8a122f993f1e-oKQ
MaaXBoard 8ULP
Linux Yocto Development Guide V3.1

Copyright Statement:

MaaXBoard-8ULP-Linux-Yocto-Development-guide-V3.0

 The MaaXBoard 8ULP single board computer and its related intellectual property are owned by Avnet.
 Avnet has the copyright of this document and reserves all rights. Any part of the document should not be modified, distributed or duplicated in any approach and form with the written permission issued by Avnet.

Disclaimer:

 Avnet does not take warranty of any kind, either expressed or implied, as to the program source code, software and documents provided along with the products, and including, but not limited to, warranties of fitness for a particular purpose; The entire risk as to the quality or performance of the program is with the user of products.

Regulatory Compliance:

 MaaXBoard 8ULP single board computer has passed the CE, FCC & SRRC certification.

https://www.avnet.com/wps/portal/us/products/avnet-boards/avnet-board-families/maaxboard/maaxboard-8ulp/

2

Revision History

MaaXBoard-8ULP-Linux-Yocto-Development-guide-V3.0

Version V1.0 V2.0
V3.0
V3.1

Note Initial version

Author Release Date Lily 2022/11/09

Updated Yocto to kirkstone(4.0), BSP_VERSION to lf5.15.71-2.2.0, Converts the file format to markdown

Lily 20230516

Updated Yocto to Langdale(4.1), BSP_VERSION to lf-6.1.11.0.0

Lily 20230630

Updated Yocto to mickledore(4.2), BSP_VERSION to lf6.1.22-2.0.0

Lily 20231024

https://www.avnet.com/wps/portal/us/products/avnet-boards/avnet-board-families/maaxboard/maaxboard-8ulp/

3

MaaXBoard-8ULP-Linux-Yocto-Development-guide-V3.0
Catalog
Revision History ............................................................................................................................................. 3 Catalog ........................................................................................................................................................... 3 Chapter 1 Build with Yocto ...............................................................................................................................5
1.1 Setup Build Environment ......................................................................................................................5 1.2 Fetch Source Code ...............................................................................................................................5
1.2.1 Download meta layers from NXP .................................................................................................. 5 1.2.2 Download MaaXBoard 8ULP Source Code .................................................................................. 6 1.3 Build ...................................................................................................................................................... 6 1.3.1 Edit build Configuration ..................................................................................................................6 1.3.2 Build ................................................................................................................................................6 Chapter 2 Standalone Build of u-Boot and Kernel .......................................................................................... 7 2.1 Cross-compile tool chain ...................................................................................................................... 7 2.1.1 ARM GCC .......................................................................................................................................7 2.1.2 Yocto SDK ...................................................................................................................................... 7 2.2 Build U-Boot in a standalone environment .......................................................................................... 8 2.2.1 Get the source code and firmware ................................................................................................ 8 2.2.2 Compile script ................................................................................................................................ 9 2.3 Build Kernel in a standalone environment ......................................................................................... 12 Chapter 3 System power on and boot up ......................................................................................................13 Chapter 4 Appendix ....................................................................................................................................... 14 4.1 Hardware Documents .........................................................................................................................14 4.2 Software Documents .......................................................................................................................... 14 4.3 Contact Information ............................................................................................................................ 14

https://www.avnet.com/wps/portal/us/products/avnet-boards/avnet-board-families/maaxboard/maaxboard-8ulp/

4

Chapter 1

Build with Yocto

MaaXBoard-8ULP-Linux-Yocto-Development-guide-V3.0

1.1 Setup Build Environment
To setup the build environment need:
 Hardware: It is recommended that at least 300GB of disk space and 4GB of RAM  Software: Ubuntu 64-bit OS, 20.04 LTS version or later LTS version (Ubuntu Desktop or Ubuntu
Server version). You could also run the Ubuntu 64-bit OS on virtual machine or in docker container.
The following packages are required for the development environment. The required packages can be installed using the bash script below:
$ sudo apt-get update $ sudo apt-get install -y wget git-core diffstat unzip texinfo gcc-multilib \ build-essential chrpath socat cpio python python3 python3-pip python3-pexpect \ xz-utils debianutils iputils-ping python3-git python3-jinja2 libegl1-mesa libsdl1.2-dev \ pylint3 xterm rsync curl gawk zstd lz4 locales bash-completion
Install repo:
$ mkdir -p ~/bin $ curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo $ chmod a+x ~/bin/repo $ export PATH=~/bin:$PATH
Set Git configuration:
$ git config --global user.name "Your Name" $ git config --global user.email "you@example.com"
1.2 Fetch Source Code
1.2.1 Download meta layers from NXP
$ mkdir ~/imx-yocto-bsp $ cd ~/imx-yocto-bsp $ repo init -u https://github.com/nxp-imx/imx-manifest -b imx-linux-mickledore -m imx-6.1.222.0.0.xml $ repo sync

https://www.avnet.com/wps/portal/us/products/avnet-boards/avnet-board-families/maaxboard/maaxboard-8ulp/

5

MaaXBoard-8ULP-Linux-Yocto-Development-guide-V3.0
1.2.2 Download MaaXBoard 8ULP Source Code
To download the source code of MaaXBoard 8ULP, clone the repository from Github: $ cd ~/imx-yocto-bsp/sources $ git clone https://github.com/Avnet/meta-maaxboard.git -b mickledore meta-maaxboard
1.3 Build
1.3.1 Edit build Configuration
If you want to create a new build folder or set the configuration for the first time, run the command: $ cd ~/imx-yocto-bsp $ MACHINE=maaxboard-8ulp source sources/meta-maaxboard/tools/maaxboard-setup.sh -b maaxboard-8ulp/build If you want to build in an existing build folder, use the following command: $ cd ~/imx-yocto-bsp $ source sources/poky/oe-init-build-env maaxboard-8ulp/build
1.3.2 Build
Execute the following command to build a Weston Wayland image:
$ bitbake avnet-image-full After the build has successfully completed, the output files are deployed in: ~/imx-yocto-bsp/maaxboard-8ulp/build/tmp/deploy/images/maaxboard-8ulp/

imx-boot-tagged
avnet-image-full-maaxboard8ulp -xxxx.rootfs.wic
Image
maaxboard-8ulp.dtb
overlays
avnet-image-full-maaxboard8ulp -xxxx.rootfs.tar.bz2

Bootloader Image System image, this includes: Linux kernel, DTB and root file system. Kernel image MaaXBoard 8ULP device tree binary MaaXBoard 8ULP device tree overlay binary
System image compressed archive file

https://www.avnet.com/wps/portal/us/products/avnet-boards/avnet-board-families/maaxboard/maaxboard-8ulp/

6

MaaXBoard-8ULP-Linux-Yocto-Development-guide-V3.0

Chapter 2 Standalone Build of u-Boot and Kernel
This chapter describes how to build U-boot and Kernel using SDK or ARM GCC in a standalone environment.

2.1 Cross-compile tool chain

The cross-compile tool chain that is used, can be ARM GCC or Yocto SDK.

2.1.1 ARM GCC
Download the tool chain for the A-profile architecture on arm Developer GNU-A Downloads page. It is recommended to use the 10.3 version for this release. You can download the "gcc-arm-10.3-2021.07x86_64-aarch64-none-linux-gnu.tar.xz ", and decompress the file into a local directory.
$ mkdir ~/toolchain $ tar -xJf gcc-arm-10.3-2021.07-x86_64-aarch64-none-linux-gnu.tar.xz -C ~/toolchain Execute the following command to check that the toolchain can be directly run.

$ cd toolchain/gcc-arm-10.3-2021.07-x86_64-aarch64-none-linux-gnu/bin/ $ ./aarch64-none-linux-gnu-gcc -v
To compile a project with ARM GCC, first set the environment with the following commands before building :

$ TOOLCHAIN_PATH=$HOME/toolchain/gcc-arm-10.3-2021.07-x86_64-aarch64-none-linuxgnu/bin $ export PATH=$TOOLCHAIN_PATH:$PATH $ export ARCH=arm64 $ export CROSS_COMPILE=aarch64-none-linux-gnu-

2.1.2 Yocto SDK

Generate an SDK from the Yocto Project build environment with the following command after generating the image in the previous chapter.

$ cd ~/imx-yocto-bsp $ source sources/poky/oe-init-build-env maaxboard-8ulp/build $ bitbake avnet-image-full -c populate_sdk The generated file is: ~/imx-yocto-bsp/maaxboard-8ulp/build/tmp/deploy/sdk/
fsl-imx-wayland-lite-glibc-x86_64-avnet-image-full-armv8a-maaxboard-8ulp-toolchain-6.1-mickledore..sh

https://www.avnet.com/wps/portal/us/products/avnet-boards/avnet-board-families/maaxboard/maaxboard-8ulp/

7

MaaXBoard-8ULP-Linux-Yocto-Development-guide-V3.0
and execute this script to install the SDK. The default location is /opt but can be placed anywhere on the host machine.
$ sudo ./fsl-imx-wayland-lite-glibc-x86_64-avnet-image-full-armv8a-maaxboard-8ulp-toolchain-6.1mickledore.sh NXP i.MX Release Distro SDK installer version 6.1-mickledore ============================================================ Enter target directory for SDK (default: /opt/fsl-imx-wayland-lite/6.1-mickledore): You are about to install the SDK to "/opt/fsl-imx-wayland-lite/6.1-mickledore". Proceed [Y/n]? Extracting SDK......................................................................................................................................done Setting it up...done SDK has been successfully set up and is ready to be used. When using SDK to compile a project, first execute the following command to configure environment variables :
$ . /opt/fsl-imx-wayland-lite/6.1-mickledore/environment-setup-armv8a-poky-linux
2.2 Build U-Boot in a standalone environment
2.2.1 Get the source code and firmware
To get the source code of u-boot, imx-atf and imx-mkimage, execute the following commands:
$ mkdir tmp $ cd tmp $ git clone https://github.com/Avnet/uboot-imx.git -b maaxboard_lf-6.1.22-2.0.0 $ git clone https://github.com/Avnet/imx-atf.git -b maaxboard_lf-6.1.22-2.0.0 $ git clone https://github.com/Avnet/imx-mkimage.git -b maaxboard_lf-6.1.22-2.0.0
Download the firmware-imx, decompress and accept NXP EULA when running:
$ wget https://www.nxp.com.cn/lgfiles/NMG/MAD/YOCTO/firmware-imx-8.20.bin $ chmod +x firmware-imx-8.20.bin $ ./firmware-imx-8.20.bin
Execute the `ls' command to view the tmp directory:
$ ls tmp firmware-imx-8.20 firmware-imx-8.20.bin imx-atf imx-mkimage uboot-imx
So far, the required source code and firmware have been prepared.

https://www.avnet.com/wps/portal/us/products/avnet-boards/avnet-board-families/maaxboard/maaxboard-8ulp/

8

2.2.2 Compile script

MaaXBoard-8ULP-Linux-Yocto-Development-guide-V3.0

Create a bash script in the tmp directory and change the file mode:

$ cd tmp $ touch make_mx8ulp_uboot.sh $ chmod 766 make_mx8ulp_uboot.sh $ vi make_mx8ulp_uboot.sh

Copy the following content into the make_mx8ulp_uboot.sh script:

#!/bin/bash PRJ_PATH=`pwd` export JOBS=`cat /proc/cpuinfo | grep processor | wc -l` export CROSS_COMPILE=$HOME/toolchain/gcc-arm-10.3-2021.07-x86_64-aarch64-none-linuxgnu/bin/aarch64-none-linux-gnuMKIMG_BIN_PATH=$PRJ_PATH/imx-mkimage/iMX8ULP/ set -e function fetch_firmware() {
if [ ! -d firmware-sentinel-0.10 ] ; then wget https://www.nxp.com/lgfiles/NMG/MAD/YOCTO/firmware-sentinel-0.10.bin bash firmware-sentinel-0.10.bin --auto-accept > /dev/null 2>&1
fi if [ ! -d firmware-upower-1.3.0 ] ; then
wget https://www.nxp.com/lgfiles/NMG/MAD/YOCTO/firmware-upower-1.3.0.bin bash firmware-upower-1.3.0.bin --auto-accept > /dev/null 2>&1 fi if [ ! -d meta-maaxboard ] ; then git clone https://github.com/Avnet/meta-maaxboard.git -b mickledore fi rm -f *.bin } function build_atf() { SRC=imx-atf if [ ! -d $SRC ] ; then git clone https://github.com/Avnet/$SRC.git -b maaxboard_lf-6.1.22-2.0.0 fi cd $SRC

https://www.avnet.com/wps/portal/us/products/avnet-boards/avnet-board-families/maaxboard/maaxboard-8ulp/

9

MaaXBoard-8ULP-Linux-Yocto-Development-guide-V3.0
make -j${JOBS} CROSS_COMPILE=${CROSS_COMPILE} PLAT=imx8ulp bl31 cd $PRJ_PATH } function build_cortexM() { DEMO_PATH=boards/evkmimx8ulp/multicore_examples/rpmsg_lite_str_echo_rtos/armgcc DEMO_BIN=release/rpmsg_lite_str_echo_rtos.bin SRC=mcore_sdk_8ulp cd $PRJ_PATH/${SRC} cd $DEMO_PATH export ARMGCC_DIR=$MCORE_COMPILE #bash clean.sh if [ ! -s $DEMO_BIN ] ; then
bash build_release.sh fi set -x cp $DEMO_BIN $MKIMG_BIN_PATH/m33_image.bin # For Yocto cp $DEMO_BIN $PRFX_PATH/maaxboard_8ulp_m33_image.bin set +x } function build_uboot() { SRC=uboot-imx if [ ! -d $SRC ] ; then
git clone https://github.com/Avnet/$SRC.git -b maaxboard_lf-6.1.22-2.0.0 fi

cd $PRJ_PATH/${SRC}

if [ ! -f .config ] ; then make ARCH=arm ${BOARD}_defconfig
fi make -j${JOBS} CROSS_COMPILE=${CROSS_COMPILE} ARCH=arm cd $PRJ_PATH } function build_imxboot() {

https://www.avnet.com/wps/portal/us/products/avnet-boards/avnet-board-families/maaxboard/maaxboard-8ulp/

10

MaaXBoard-8ULP-Linux-Yocto-Development-guide-V3.0
SRC=imx-mkimage if [ ! -d $SRC ] ; then
git clone https://github.com/Avnet/$SRC.git -b maaxboard_lf-6.1.22-2.0.0 fi cd $SRC # copy firmware cp $PRJ_PATH/firmware-upower-*/upower_a1.bin iMX8ULP/upower.bin cp $PRJ_PATH/firmware-sentinel-*/mx8ulpa0-ahab-container.img iMX8ULP/

# copy atf-imx image cp $PRJ_PATH/imx-atf/build/imx8ulp/release/bl31.bin iMX8ULP/ # copy uboot-imx image cp $PRJ_PATH/uboot-imx/u-boot.bin iMX8ULP/ cp $PRJ_PATH/uboot-imx/u-boot-nodtb.bin iMX8ULP/ cp $PRJ_PATH/uboot-imx/spl/u-boot-spl.bin iMX8ULP/ cp $PRJ_PATH/uboot-imx/arch/arm/dts/maaxboard-8ulp.dtb iMX8ULP/imx8ulp-evk.dtb cp $PRJ_PATH/uboot-imx/tools/mkimage iMX8ULP/mkimage_uboot # generate bootloader image make SOC=iMX8ULP flash_singleboot_m33 cp iMX8ULP/flash.bin u-boot-maaxboard-8ulp.imx chmod a+x u-boot-maaxboard-8ulp.imx # copy bootloader image out cp u-boot-maaxboard-8ulp.imx $PRJ_PATH } fetch_firmware build_atf build_cortexM build_uboot build_imxboot

Execute the script to build:

$ ./make_mx8ulp_uboot.sh

$ ls -t

u-boot-maaxboard-8ulp.imx uboot-imx meta-maaxboard firmware-sentinel-0.8 firmware-

upower-1.3.0

imx-mkimage

imx-atf make_mx8ulp_uboot.sh firmware-imx-8.18

The boot image for Maaxboard 8ULP is u-boot-maaxboard-8ulp.imx in the current directory.

https://www.avnet.com/wps/portal/us/products/avnet-boards/avnet-board-families/maaxboard/maaxboard-8ulp/

11

MaaXBoard-8ULP-Linux-Yocto-Development-guide-V3.0
2.3 Build Kernel in a standalone environment
Get the Linux source code
$ git clone https://github.com/Avnet/linux-imx.git -b maaxboard_lf-6.1.22-2.0.0
Check that the environment variables are correctly set :
$ echo $CROSS_COMPILE $ARCH
Build the kernel sources
$ cd linux-imx $ make distclean $ make maaxboard-8ulp_defconfig $ make -j4
Execute the `ls' command to view the Image and dtb files after compilation.
$ ls arch/arm64/boot/Image $ ls arch/arm64/boot/dts/freescale/maaxboard*dtb arch/arm64/boot/dts/freescale/maaxboard-8ulp.dtb
Execute the following command to compile the kernel modules, and install the modules to rootfs in the current directory.
$ make modules $ make modules_install INSTALL_MOD_PATH=./rootfs

https://www.avnet.com/wps/portal/us/products/avnet-boards/avnet-board-families/maaxboard/maaxboard-8ulp/

12

MaaXBoard-8ULP-Linux-Yocto-Development-guide-V3.0
Chapter 3 System power on and boot up
To program the generated new Bootloader and System image files into MaaXBoard 8ULP's eMMC memory, or for guidance on power-up MaaXBoard 8ULP, the boot-up process, and how to exercise the supported BSP features of MaaXBoard 8ULP, please refer to MaaXBoard-8ULP-Linux-YoctoUserManual.

https://www.avnet.com/wps/portal/us/products/avnet-boards/avnet-board-families/maaxboard/maaxboard-8ulp/

13

Chapter 4 Appendix

MaaXBoard-8ULP-Linux-Yocto-Development-guide-V3.0

4.1 Hardware Documents
For the detail hardware introduction, please refer to MaaXBoard 8ULP Hardware user manual.
4.2 Software Documents
MaaXBoard 8ULP supports Yocto Linux, for additional information, please refer to the following documents:
 MaaXBoard 8ULP Linux Yocto User Manual - Describes how to boot up MaaXBoard 8ULP and aspects of the BSP functionality
 MaaXBoard 8ULP Linux Yocto Development Guide - Detailed guidance on how to rebuild the Linux system image (This document)
4.3 Contact Information
 Product Webpage:
https://www.avnet.com/wps/portal/us/products/avnet-boards/avnet-board-
families/maaxboard/maaxboard-8ulp/

https://www.avnet.com/wps/portal/us/products/avnet-boards/avnet-board-families/maaxboard/maaxboard-8ulp/

14



References

WPS 文字