Skip to main content

IoTGateway/BSP/Linux/iMX6/Yocto LBVD User Guide

Introduction

This guide explains how to obtain, build, and flash the Advantech i.MX6 Yocto LBVD (mickledore / Linux 6.1.x) BSP, and how to set up a development environment.


Getting Started

System Requirements

  • CPU Cores: Quad‑core (or higher recommended)
  • Memory: 8 GB RAM (more recommended)
  • Disk Space: 400 GB (SSD recommended)

Conventions

  • ${PREBUILT_IMAGE} : compressed prebuilt image (e.g., *.img.gz)
  • ${CONTAINER_NAME} : container name (e.g., imx6LBVD0014)
  • ${BSP_TARBALL} : BSP tarball (*.tgz)
  • ${BSP_HOME} : BSP root directory (host side)
  • ${BDIR} : build directory (e.g., build_xwayland or build_x11)
  • ${MX6PROC} : i.MX6 processor short name — e.g., mx6q
  • ${IMX6PROC} : i.MX6 processor family — e.g., imx6q
  • ${BOARD} : board name — e.g., rsb4411
  • ${BOARD_REV} : board revision — e.g., a1
  • ${MC} : machine code, ${IMX6PROC}${BOARD}${BOARD_REV}
    Example: imx6qrsb4411a1 (RSB‑4411 A1)
    To list supported machines after env setup:
    source setup-environment
  • ${MEM_SIZE} : memory size — 1G/2G
  • ${UC} : U‑Boot config — 1G/2G
  • ${SD_DEVICE} : SD card device path in Linux (e.g., /dev/sdf)
  • ${SDCARD_IMAGE} : SD card image produced by bitbake (e.g., *.wic.zst)
  • ${WORKSPACE} : host workspace folder (host side)
  • ${UBOOT} : U‑Boot version (e.g., v2023.04_6.1.22-2.0.0)
  • ${KERNEL} : Linux kernel version (e.g., 6.1.22-2.0.0)
  • ${TOOLCHAIN} : toolchain install dir (e.g., opt/fsl-imx-wayland/6.1-mickledore/environment)

Serial console: use minicom/putty/teraterm @ 115200 8N1.
Terminal: gnome-terminal / xfce4-terminal, etc.


Docker Install & Setup

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

Pull the Ubuntu 20.04 image

docker pull advrisc/u20.04-imx8lbv1

Create a container (run this on the host)

Ensure ${WORKSPACE} exists on the host and is shared with Docker.

# PowerShell example
$env:WORKSPACE = "I:dv-release-bsp"
$env:CONTAINER_NAME = "imx6LBVD0014"

docker run --privileged -it --name "$env:CONTAINER_NAME" `
-v "$env:WORKSPACE:/home/adv/adv-release-bsp" `
-v /dev:/dev advrisc/u20.04-imx8lbv1 /bin/bash
# bash/zsh example
export WORKSPACE="$HOME/adv-release-bsp"
export CONTAINER_NAME="imx6LBVD0014"

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

Inside the container, always use the mount path: /home/adv/adv-release-bsp (avoid ${WORKSPACE} to prevent “not defined”).


Get BSP

You can obtain the BSP from GitHub or by copying a BSP tarball into the container.

1) Download BSP from GitHub (inside the container)

cd /home/adv/adv-release-bsp
git config --global user.name "Your Name"
git config --global user.email you@example.com
sudo chown adv:adv /home/adv/adv-release-bsp
repo init -u git://github.com/ADVANTECH-Corp/adv-arm-yocto-bsp.git -b imx-linux-mickledore -m adv-6.1.22-2.0.0.xml
repo sync

If your platform is imx6dlrsb4411a2, use the tag below instead:

repo init -u git://github.com/ADVANTECH-Corp/adv-arm-yocto-bsp.git -b imx-linux-mickledore -m imx6LBVD0027.xml
repo sync

Git tips:

# Self-signed certs (SSL verify failure)
export GIT_SSL_NO_VERIFY=1
# or
git config --global http.sslverify false

# 9418 unauthenticated git protocol disabled
git config --global url."https://".insteadOf git://

2) (Optional) Pre-populate downloads

During Yocto builds, a downloads/ folder is populated. To reduce fetch failures, preload it from a tarball (e.g., downloads_imx6_6.1.22_2.0.0.tar.gz).

On the host:

# Copy the tarball into the shared folder
cp downloads_imx6_6.1.22_2.0.0.tar.gz "${WORKSPACE}"

Back in the container:

docker start "${CONTAINER_NAME}"
docker attach "${CONTAINER_NAME}"

# Inside container
cd /home/adv/adv-release-bsp
sudo chown adv:adv /home/adv/adv-release-bsp/downloads_imx6_6.1.22_2.0.0.tar.gz
tar zxvf /home/adv/adv-release-bsp/downloads_imx6_6.1.22_2.0.0.tar.gz
ln -s /home/adv/adv-release-bsp/downloads_imx6_6.1.22_2.0.0 downloads

BSP Structure (Overview)

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

Build Instructions

Create a new build environment (inside the container)

cd /home/adv/adv-release-bsp
MACHINE="${MC}" DISTRO=fsl-imx-xwayland source imx-setup-release.sh -b "${BDIR}"

# Optional: specify default U‑Boot config
MACHINE="${MC}" UBOOT_CONFIG="${UC}" DISTRO=fsl-imx-xwayland source imx-setup-release.sh -b "${BDIR}"

# Example (RSB‑4411 Dual‑Lite 2G):
MACHINE=imx6dlrsb4411a2 DISTRO=fsl-imx-xwayland source imx-setup-release.sh -b build_x11

# Accept the EULA when prompted

Continue an existing build environment

cd /home/adv/adv-release-bsp
source setup-environment "${BDIR}"

Build SD card image

bitbake imx-image-full
# Outputs (on success):
# tmp/deploy/images/${MC}/imx-image-full-${MC}.wic.zst
# tmp/deploy/images/${MC}/imx-image-full-${MC}.wic.bmap

Build toolchain installer

bitbake meta-toolchain
# Output directory:
# tmp/deploy/sdk/
# (run the generated SDK installer .sh from that directory)

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

Menuconfig:

bitbake linux-imx -c menuconfig

Exit the tmux window after editing:

exit

Build kernel:

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

Flashing / Boot Media

From prebuilt image (*.img.gz)

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

From built SD card image

.wic.zst (mickledore default):

pushd "/home/adv/adv-release-bsp/${BDIR}/tmp/deploy/images/${MC}"
sudo sh -c 'zstdcat "${SDCARD_IMAGE}" | dd of="${SD_DEVICE}" bs=1M status=progress conv=fsync'
sync
popd

.wic.bz2:

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

(Optional) Use bmaptool to speed up copy

sudo bmaptool copy --bmap "${SDCARD_IMAGE/.zst/.bmap}" "${SDCARD_IMAGE}" "${SD_DEVICE}"

Caution: dd will overwrite the target device. Verify ${SD_DEVICE} before proceeding.


Debug Console

  • Use minicom/putty/teraterm with 115200 8N1.
  • Board‑specific debug port details: see your board hardware manual (e.g., RSB‑4411).

Customization

Setting up SDK

cd "/home/adv/adv-release-bsp/${BDIR}/tmp/deploy/sdk"
sudo ./<your-sdk-installer>.sh
# Follow prompts for install path; when asked `Proceed [y/n]?`, answer accordingly.

SDK Setup

Setting up cross‑compile environment

For i.MX6 (ARMv7):

source "${TOOLCHAIN}/environment-setup-cortexa9t2hf-neon-poky-linux-gnueabi"

Build U‑Boot (standalone)

Configure

make ${IMX6PROC}_${BOARD}${BOARD_REV}_${MEM_SIZE}_defconfig
# Example:
# make mx6qrsb4411a1_1G_defconfig

Build

make -j$(nproc)

Replace imx-boot on media

To SD card:

dd if=u-boot_crc.bin.crc of="${SD_DEVICE}" bs=512 seek=2 conv=fsync
dd if=u-boot_crc.bin of="${SD_DEVICE}" bs=512 seek=3 conv=fsync

To on‑board eMMC (example device node):

dd if=u-boot_crc.bin.crc of=/dev/mmcblk0 bs=512 seek=2 conv=fsync
dd if=u-boot_crc.bin of=/dev/mmcblk0 bs=512 seek=3 conv=fsync

Building & updating kernel/modules/DTB manually

Ensure the cross‑compile environment is sourced (see above).

Get kernel source (example)

# If you have a tarball in the shared folder:
sudo chown adv:adv imx6LBVD0014_2024-06-22_linux-imx.tgz
tar zxvf imx6LBVD0014_2024-06-22_linux-imx.tgz

# Or clone from GitHub:
# git clone <your-linux-imx-repo> -b <your-branch>

Configure kernel

cd linux-imx6
make distclean
make imx_v7_adv_defconfig
make menuconfig
# If you see errors around menuconfig, install ncurses:
# sudo apt-get install -y libncurses5-dev libncursesw5-dev

If you hit link errors later, try:

unset LDFLAGS

Build kernel

make -j$(nproc) zImage
# Output: arch/arm/boot/zImage

Build modules

make -j$(nproc) modules
make modules_install INSTALL_MOD_PATH=~/temp/rootfs

Build device tree blob(s)

make -j$(nproc) ${IMX6PROC}-${BOARD}-${BOARD_REV}.dtb
# Example:
# make -j$(nproc) imx6q-rsb4411-a1.dtb
# Output: arch/arm/boot/dts/

Replace kernel & DTS on target media

  • Copy zImage to the boot partition on SD/eMMC.
  • Copy the .dtb to the device tree location on SD/eMMC (path depends on your BSP/bootloader).

Reflash eMMC from Boot SD Card