Personal tools

VisionSOM imx-meta-somlabs-mickledore

From SomLabs Wiki

Jump to: navigation, search

VisionSOM imx-meta-somlabs layer for iMX Yocto Mickledore


This tutorial explains how to build the Yocto Mickledore system for the SoMLabs modules. The Yocto system uses the following kernel and u-boot repositories:

Introduction

Meta-somlabs is a layer providing the SoMLabs modules and carrier boards hardware support for Yocto-based NXP Linux system. It may be used on top of the meta-imx layer provided by NXP or directly with meta-freescale maintained by the community.

Host system prerequisites

This tutorial was prepared for the Ubuntu 20.04 host operating system. All of the files required for system image compilation may require up to 120 GB of the disk space.

The following packages need to be installed before the building process:

sudo apt-get install gawk wget git diffstat unzip texinfo gcc build-essential chrpath socat cpio python3 python3-pip python3-pexpect xz-utils debianutils iputils-ping python3-git python3-jinja2 libegl1-mesa libsdl1.2-dev python3-subunit mesa-common-dev zstd liblz4-tool file locales

The source code will be obtained using git, so it needs to be configured by setting the user name and email with correctly set values:

git config --global user.email "you@example.com"
git config --global user.name "Your Name"

A new repo tool version is also required. It may be downloaded directly from the project site. The repo binary needs to be available in the system PATH variable and have the execution privilege:

wget https://storage.googleapis.com/git-repo-downloads/repo
sudo mv repo /usr/bin/repo
sudo chmod a+x /usr/bin/repo

System image

This layer should be used in order to build the system image. It adds a new example image called somlabs-image and two distros: somlabs-fb and somlabs-xwayland. It also includes the SoMLabs demo application using the GTK and GStreamer libraries.

Building the system image

The general description of the building process is described in the iMX Yocto Project User's Guide document for version 6.1.36_2.1.0:

https://www.nxp.com/design/software/embedded-software/i-mx-software/embedded-linux-for-i-mx-applications-processors:IMXLINUX

The summary of required steps including the meta-somlabs layer is shown below:

  • with meta-imx usage
mkdir imx-yocto-bsp
cd imx-yocto-bsp
repo init -u https://github.com/SoMLabs/imx-meta-somlabs -b mickledore -m imx-somlabs-6.1.36-2.1.0.xml
repo sync
  • with meta-freescale (without meta-imx support)
mkdir imx-yocto-bsp
cd imx-yocto-bsp
repo init -u https://github.com/SoMLabs/imx-meta-somlabs -b mickledore -m fsl-somlabs-6.1.36-2.1.0.xml
repo sync

System building may be configured for one of the available machine configurations:

  • visioncb-6ull-std - VisionCB-6ULL-STD board with VisionSOM-6ULL modules
  • visionsom-8mm-cb - VisionCB-8M board family with VisionSOM-8Mmini modules
  • titansbc-8mmini - TitanSBC-8Mmini board
  • starsom-cb-6ull - StarCB-6ULL board with StarSOM-6ULL modules
  • starsbc-6ull - StarSBC-6ULL board with or without the COMM shield
  • spacesom-8mplus-cb - SpaceCB-8Mplus board with SpaceSOM-8Mplus module


The following system distributions were tested on SoMLabs modules:

  • somlabs-fb - distribution without graphical environment
  • somlabs-xwayland - distribution with wayland and x11 enabled

NOTE: Since 6.1.x kernel uptade the GPU drivers on iMX8MPlus require modules with at least 2GB RAM available. For 1GB RAM spacesom-8mplus-cb machine use somlabs-fb distro only.


System building may be started by the following commands:

  • with meta-imx usage
DISTRO=<SELECTED_DISTRIBUTION> MACHINE=<SELECTED_MACHINE> source imx-somlabs-setup-release.sh -b <BUILD_DIRECTORY>
bitbake somlabs-image
  • with meta-freescale (without meta-imx support)
DISTRO=<SELECTED_DISTRIBUTION> MACHINE=<SELECTED_MACHINE> source fsl-somlabs-setup-environment.sh <BUILD_DIRECTORY>
bitbake somlabs-image

The system image is located in the somlabs-image-<SELECTED_MACHINE>.wic.zst or somlabs-image-<SELECTED_MACHINE>.wic.gz file in the tmp/deploy/images/<SELECTED_MACHINE> directory. It should be extracted with one of the commands:

unzstd somlabs-image-<SELECTED_MACHINE>.wic.zst 
gunzip somlabs-image-<SELECTED_MACHINE>.wic.gz

The instruction for the eMMC memory image installation may be found on the wiki page for corresponding module:

Weston configuration on VisionSOM-8MM boards

Weston graphical environment is configured by /etc/xdg/weston/weston.ini file. On VisionSOM-8MM boards this file is a link created by systemd service somlabs-weston-init.service during system boot. This service uses somlabs-weston-init.sh script to check which display is in use and to create weston.ini link to normal or rotated display configuration. This script removes the existing link during each boot bo verify currently connected display.

#!/bin/sh

WESON_INI_FILE="/etc/xdg/weston/weston.ini"

if [ -L "$WESON_INI_FILE" ]; then
  rm $WESON_INI_FILE
elif [ -f "$WESON_INI_FILE" ]; then
  exit 0
fi

CMDLINE="`cat /proc/device-tree/model`"

case "$CMDLINE" in
  *MIPI7-POWERTIP*)
    ln -s /etc/xdg/weston/weston_8m_rotated.ini $WESON_INI_FILE
    ;;
  *)
    ln -s /etc/xdg/weston/weston_8m.ini $WESON_INI_FILE
    ;;
esac

exit 0

In order to disable this functionality the service may be disabled using systemd:

systemctl disable somlabs-weston-init.service
NXP Partner ST Partner Renesas Partner