Skip to main content

Yocto Linux BSP User Guide

Introduction

(Write a short intro to this BSP here.)

Getting Started

Building Yocto Image — System Requirements

  • CPU Cores: Quad-core processor (or higher recommended)
  • Memory: 8 GB RAM (more is recommended for better performance)
  • Disk Space: 350 GB (SSD recommended for better performance)

Conventions

  • ${PREBUILT_IMAGE} : compressed prebuilt image (*.img.gz)
  • ${CONTAINER_NAME} : container name (e.g., imx6LBVB0016)
  • ${BSP_TARBALL} : BSP tarball (*.tgz)
  • ${BSP_HOME} : home directory of the BSP
  • ${BDIR} : build directory (e.g., build_x11)
  • ${MX6PROC} : i.MX6 Processor
    Example mapping: mx6q for i.MX6 Dual Quad Core
  • ${IMX6PROC} : i.MX6 Processor (e.g., imx6q)
  • ${BOARD} : available target boards list (e.g., rsb3430)
  • ${BOARD_REV} : board revision (e.g., a1)
  • ${MC} : machine code combined with ${IMX6PROC}${BOARD}${BOARD_REV}.
    Examples:
    • imx6qrsb3430a1 for RSB-3430 A1
    • imx6qrom7420a2 for ROM-7420 A2
      To check supported machines in BSP, you can run:
    ls sources/*/conf/machine/*.conf
  • ${MEM_SIZE} : memory size (e.g., 1G/2G)
  • ${UC} : U‑Boot config (e.g., 1G/2G/4G/FSPI_1G/FSPI_2G …)
  • ${SD_DEVICE} : SD card device path in Linux (e.g., /dev/sdf)
  • ${SDCARD_IMAGE} : SD card image built by bitbake (*.wic.bz2)
  • ${WORKSPACE} : host workspace folder path
  • ${UBOOT} : U‑Boot version (e.g., 2016.03)
  • ${KERNEL} : Linux kernel version (e.g., 4.14.98)
  • ${TOOLCHAIN} : toolchain install dir (e.g., /opt/fsl-imx-x11/4.1.15-2.0.0)

Serial console: use minicom/putty/teraterm at 115200 8N1.
Terminal console: gnome-terminal / xfce4-terminal …

Docker Install & Setup

If Docker is not installed, please refer to the official Docker docs for your platform.

Pull Ubuntu 18.04 image

docker pull advrisc/u18.04-imx8lbv1

Create a container

Make sure ${WORKSPACE} exists on the host.

docker run --privileged -it --name "${CONTAINER_NAME}"   -v "${WORKSPACE}:/home/adv/adv-release-bsp"   -v /dev:/dev advrisc/u18.04-imx8lbv1 /bin/bash

Get BSP

You can obtain the BSP via Git or by copying a BSP tarball into the container.

1) Download BSP from GitHub

The following example downloads the Advantech Yocto BSP. For this example, a directory called adv-release-bsp is used.

git config --global user.name "Your Name"
git config --global user.email you@example.com
sudo chown adv:adv adv-release-bsp
cd adv-release-bsp
repo init -u git://github.com/ADVANTECH-Corp/adv-arm-yocto-bsp.git -b refs/tags/imx6LBVB0209 -m imx6LBVB0209.xml
repo sync

Alternative tags/branches:

# 5.10.35-2.0.0
repo init -u git://github.com/ADVANTECH-Corp/adv-arm-yocto-bsp.git -b imx-linux-hardknott -m imx-5.10.35-2.0.0.xml
repo sync
# 5.10.72-2.2.0
repo init -u git://github.com/ADVANTECH-Corp/adv-arm-yocto-bsp.git -b imx-linux-hardknott -m imx-5.10.72-2.2.0.xml
repo sync

Troubleshooting Git:

If you encounter server certificate verification failed (self-signed certs), either:

export GIT_SSL_NO_VERIFY=1

or

git config --global http.sslverify false

If you see “The unauthenticated git protocol on port 9418 is no longer supported.”:

git config --global url."https://".insteadOf git://

2) Copy BSP tarball to the container

If you have a BSP tarball (e.g., imx6LBVB0029_2021-10-23.tgz), copy it to ${WORKSPACE} on host, then inside the container unpack it.

  1. Exit the container back to the host:
exit
  1. Copy BSP tarball to ${WORKSPACE} and change owner:
cp imx6LBVB0029_2021-10-23.tgz "${WORKSPACE}"
sudo chown adv:adv "${WORKSPACE}/imx6LBVB0029_2021-10-23.tgz"
  1. Re-enter the container:
docker start "${CONTAINER_NAME}"
docker attach "${CONTAINER_NAME}"
  1. Unpack inside the container:
tar zxvf imx6LBVB0029_2021-10-23.tgz

During a Yocto build, a downloads/ folder is generated. To reduce fetch failures, you can pre-populate it from a tarball (e.g., downloads_imx8_5.10.35.tar.gz, MD5: 912999faf861bf413cef4cf7a9f18dfa).

  1. Exit container to host:
exit
  1. Copy the downloads tarball to ${WORKSPACE} and fix owner:
cp downloads_imx8_5.10.35.tar.gz "${WORKSPACE}"
sudo chown adv:adv "${WORKSPACE}/downloads_imx8_5.10.35.tar.gz"
  1. Re-enter the container:
docker start "${CONTAINER_NAME}"
docker attach "${CONTAINER_NAME}"
  1. Unpack and link:
tar zxvf downloads_imx8_5.10.35.tar.gz
cd adv-release-bsp
ln -s "${WORKSPACE}/downloads_imx8_5.10.35" downloads

Introducing BSP

The BSP is based on the Yocto Project with NXP/Freescale enhancements for i.MX6, plus Advantech board-specific layers. The release directory typically contains:

  • sources/ — Yocto layers (community + Advantech)
  • fsl-setup-release.sh — create a new build environment
  • setup-environment — continue an existing build environment
  • one or more build_* directories

Naming Rule

  • BSP tarball name: imx6LBVA0010_2019-08-27.tgz
    • LB = Linux BSP
    • VA0010 = Version A.0010
  • Yocto image name: 3420A1AIM20LIVA0010_iMX6M_2G_2020-08-27.img.gz
    • 5720A1 stands for RSB-3430 A1
    • LI = prebuilt Linux Image
    • 2G = DDR size

Build Instructions

Create a new build environment

cd "${BSP_HOME}"
MACHINE="${MC}" DISTRO=fsl-imx-xwayland source imx-setup-release.sh -b "${BDIR}"
# Optionally specify default U-Boot config
MACHINE="${MC}" UBOOT_CONFIG="${UC}" DISTRO=fsl-imx-xwayland source imx-setup-release.sh -b "${BDIR}"
# Accept the EULA when prompted

Continue an existing build environment

cd "${BSP_HOME}"
source setup-environment "${BDIR}"

Build SD card image

bitbake imx-image-full
# Output: tmp/deploy/images/${MC}/imx-image-full-${MC}.wic.bz2

Build toolchain installer

bitbake meta-toolchain
# Output: tmp/deploy/sdk/
# Example:
# fsl-imx-xwayland-glibc-x86_64-meta-toolchain-aarch64-toolchain-${KERNEL}-zeus.sh

Build bootloader

bitbake imx-boot

Build Linux kernel

If operating inside Docker, install tmux:

sudo apt-get update && sudo apt-get install -y tmux
tmux

Kernel menuconfig:

bitbake linux-imx -c menuconfig

Exit tmux window after editing:

exit

Build kernel image:

bitbake linux-imx
# Outputs:
# tmp/deploy/images/${MC}/Image
# tmp/deploy/images/${MC}/Image-${IMX6PROC}-${BOARD}-${BOARD_REV}.dtb

Creating boot-up media from prebuilt image

Create a bootable SD card (from prebuilt)

sudo sh -c 'gunzip -c "${PREBUILT_IMAGE}" | dd of="${SD_DEVICE}" bs=1M status=progress'
sync

Creating boot-up media from built SD card image

Create a bootable SD card (from .wic.bz2)

pushd "${BSP_HOME}/${BDIR}/tmp/deploy/images/${MC}"
sudo sh -c 'bzcat "${SDCARD_IMAGE}" | dd of="${SD_DEVICE}" bs=1M status=progress'
sync
popd

Caution: dd will overwrite the target device. Double-check ${SD_DEVICE} before running.