Skip to content

BSP Documentation

bkriegerwinsystems edited this page Jun 22, 2020 · 14 revisions

Yocto Build Guide

Development Machine Requirements

• 8GB of memory minimum

• 200GB of Disk Space available

• Needs to be running Ubuntu 16.04

Steps to build

  1. Pull in packages needed for build
    sudo apt install gawk wget git-core diffstat unzip texinfo gcc-multilib \
    build-essential chrpath socat libsdl1.2-dev
    sudo apt install libsdl1.2-dev xterm sed cvs subversion coreutils texi2html \
    docbook-utils python-pysqlite2 help2man make gcc g++ desktop-file-utils \
    libgl1-mesa-dev libglu1-mesa-dev mercurial autoconf automake groff curl lzop asciidoc
    sudo apt install u-boot-tools

  2. Make a directory for the sources and build to take place. Doesn’t have to be ~/winYocto.
    mkdir ~/winYocto

  3. Download the repo tool and add it to the path. Doesn’t have to be in ~/bin
    mkdir ~/bin curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
    chmod a+x ~/bin/repo
    export PATH=~/bin:$PATH

  4. Configure git
    git config --global user.name "Your Name"
    git config --global user.email "Your Email"
    git config --list

  5. Pull down the Yocto Project layers for building a 444 image.
    cd ~/winYocto repo init -u https://github.com/WinSystems/c444-manifest.git -b default
    repo sync

  6. Configure the build directory to target the C444
    DISTRO=fsl-imx-xwayland MACHINE=imx8mqpicoitx source winsys-setup-release.sh -b build

  7. Accept the EULA, and begin building the image. In this case the image will be the fsl-image-qt-imx version, but there are other target builds available.
    DISTRO=fsl-imx-xwayland MACHINE=imx8mqpicoitx bitbake --continue fsl-image-qt-imx

  8. Once the build has completed the image will be under tmp/deploy/images/imx8mqpicoitx

The files needed to flash the emmc are imx-boot-imx8mqpicoitx-sd.bin-flash_evk and fsl-image-validation-imx-imx8mqpicoitx-[date code here].rootfs.sdcard.bz2

Steps to Flash the eMMC

  1. Make a folder to work out of.
    mkdir ~/progemmc
    cd ~/progemmc

  2. Download and set up the uuu tool
    cd ~/yocto_setup git clone https://github.com/NXPmicro/mfgtools.git cd mfgtools
    sudo apt-get install libusb-1.0-0-dev libzip-dev libbz2-dev pkg-config
    cmake .
    make

  3. Set the switches on the C444 for programming. Set switch 1 to off and switch 2 to on.

  4. Copy the files needed to flash from the build directory, unzip the rootfs, and flash the eMMC
    cd ~/winYocto/build/tmp/deploy/images/imx8mqpicoitx/
    cp imx-boot-imx8mqpicoitx-sd.bin-flash_evk ~/progemmc/.
    cp fsl-image-validation-imx-imx8mqpicoitx-[date code].rootfs.sdcard.bz2 ~/progemmc/.
    cd ~/progemmc
    bunzip2 -dk -f ./fsl-image-validation-imx-imx8mqpicoitx-[date code].rootfs.sdcard.bz2
    cd ~/yocto_setup/mfgtools/uuu
    ./uuu -b emmc_all ~/progemmc/imx-boot-imx8mqpicoitx-sd.bin-flash_evk \
    ~/progemmc/fsl-image-validation-imx-imx8mqpicoitx-[date code].rootfs.sdcard

Image Usage

Accessing U-Boot

U-Boot's console by default is piped out over UART 1 at 115200 baud. Press any key over the console to stop it from running the default boot command. It has a three second delay by default before it runs the boot command.
Common u-boot commands:
?
Prints out help with all the commands it supports

printenv
Prints out a list of all the environment variables

setenv [variable to set] '[value to set it to]'
Sets the environment variable to desired value

saveenv
Preserves all of the current environment variables between resets.

env default -a
Sets all the environment variables back to defaults

Disabling Linux console

Doing the following will make debug without a display extremely difficult without reflashing the image. Proceed with caution.

  1. Stop at uboot and type the following commands
    setenv console 'null'
    setenv silent 1
    saveenv
    boot
  2. Login to linux and run the following from the command line
    sudo systemctl disable serial-getty@ttymxc0.service
    The step above assumes the console was coming out over UART 1

Adjusting U-Boot Delay

U-Boot has a delay before running the boot command. This can be adjusted by changing the bootdelay environment variable. It will be difficult to break into u-boot if this variable is set too small.
setenv bootdelay [desired delay time in seconds]

Using OPKG

OPKG can be used to pull in additional packages. Here are some commands for using it:

Pull in package manifest:
sudo opkg update

List available packages for install:
sudo opkg list

Install a package:
sudo opkg install [insert package name here]