Yocto On The Digi ConnectCore 6UL SBC Pro

From Wiki
Jump to: navigation, search

Overview

Assorted notes and hints for getting Yocto running on the Digi ConnectCore 6UL SBC Pro. Much of this information comes from the ConnectCore 6UL SBC Pro | DEY-2.2 page.

Toolchain Installation

Install the 'repo' utility

$ sudo curl -o /usr/local/bin/repo http://commondatastorage.googleapis.com/git-repo-downloads/repo
$ sudo chmod a+x /usr/local/bin/repo

Create the directory for the Yocto sources

$ sudo install -o <your-user> -g <your-group> -d /usr/local/dey-2.2
$ cd /usr/local/dey-2.2

Install the latest release

There are two choices for which release to use. The latest, which is updated frequently, or stable, which Digi spends more time testing (but may not contain desired packages or recipes).

$ repo init -u https://github.com/digi-embedded/dey-manifest.git -b morty
$ repo sync -j4 --no-repo-verify

Install the stable release

$ repo init -u https://github.com/digi-embedded/dey-manifest.git -b refs/tags/2.2-r1
$ repo sync -j4 --no-repo-verify

Manually Installing Sources

Using 'meta-iot-cloud' as an example:

$ cd /usr/local/dey-2.2/sources
$ git clone https://github.com/intel-iot-devkit/meta-iot-cloud.git

Updating Sources

Updating DEY

Updating is the same for whether it's latest or stable

$ cd /usr/local/dey-2.2
$ repo sync -j4 --no-repo-verify

Updating manually installed sources

$ cd /usr/local/dey-2.2/sources/<package-name>
$ git pull origin

Creating A Workspace

In this case, the target processor is the 'ccimx6ulsbc' (ConnectCore 6UL SBC Pro). The working directory ('${HOME}/workspace/ccimx6ulsbc') could be anything, but the target in the third line must be 'ccimx6ulsbc'.

$ mkdir -p ${HOME}/workspace/ccimx6ulsbc
$ cd ${HOME}/workspace/ccimx6ulsbc
$ source /usr/local/dey-2.2/mkproject.sh -p ccimx6ulsbc

Building A Project

This would build a basic console image (no QT5 or X11 support). The fourth line builds the software update image, and is not generally necessary. This presumes the 'conf/local.conf' and 'conf/bblayers.conf' files have already been modified as necessary.

$ cd ~/workspace/ccim6ulsbc
$ source dey-setup-environment
$ bitbake core-image-base
$ bitbake core-image-base-swu

Building And Installing The SDK

$ cd ~/workspace/ccim6ulsbc
$ source dey-setup-environment
$ bitbake core-image-base -c populate_sdk_ext
$ cd tmp/deploy/sdk
$ ./dey-glibc-x86_64-core-image-base-cortexa7hf-neon-toolchain-ext-2.2-r2.sh
  < Install tools to ~/dey_sdk >

Adding Layers

Suppose a project wants to talk to an Azure server using AMQP from a C application. The azure-iot-sdk-c recipe is needed for this, and it is owned by the 'meta-iot-cloud' layer.

Installing 'meta-iot-cloud'

$ cd /usr/local/dey-2.2/sources
$ git clone https://github.com/intel-iot-devkit/meta-iot-cloud.git

Update conf/bblayers.conf

Add the following line near the end, before the closing double-quote:

  /usr/local/dey-2.2/sources/meta-iot-cloud \

Update conf/local.conf

Add the following lines above the '# Machine Selection' section. Note the space between the double-quote and 'azure-iot-sdk'!

IMAGE_INSTALL_append = " azure-iot-sdk"
PACKAGECONFIG_pn-azure-iot-sdk = ""

'azure-iot-sdk' has one package config option, 'python'. The python crap (yes, *CRAP*) needs boost-python.

If you absolutely, positively want to use that miserable excuse for a programming "language", include the following PACKAGECONFIG line. Otherwise, keep your sanity and avoid python like you'd avoid herpes, AIDS, and the plague.

PACKAGECONFIG_pn-boost = "python"

Building Something

Setting up the environment

$ source dey_sdk/environment-setup-cortexa7hf-neon-dey-linux-gnueabi

Building azure-uamqp-c

$ git clone --recursive https://github.com/Azure/azure-uamqp-c.git
$ cd azure-uamqp-c
$ mkdir cmake
$ cd cmake
$ cmake -DOPENSSL_SSL_LIBRARY=$SDKTARGETSYSROOT/usr/lib/libssl.so -DOPENSSL_CRYPTO_LIBRARY=$SDKTARGETSYSROOT/usr/lib/libcrypto.so ..
$ cmake --build .

This doesn't work. Why?

Next code block goes into cmake/toolchain-ccimx6ulsbc.cmake

INCLUDE(CMakeForceCompiler)

SET(CMAKE_SYSTEM_NAME Linux) # this one is important
SET(CMAKE_SYSTEM_VERSION 1) # this one not so much

# this is the file system root of the target
SET(CMAKE_FIND_ROOT_PATH ${SDKTARGETSYSROOT})

# search for programs in the build host directories
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)

# for libraries and headers in the target directories
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
$ cmake .. -DCMAKE_TOOLCHAIN_FILE=toolchain-ccimx6ulsbc.cmake -DcompileOption_C:STRING="--sysroot=$SDKTARGETSYSROOT"

Adding Support For XBee LTE Cat 1 Modem

Add the following lines above the '# Machine Selection' section.

CELLULAR_INTERFACE = "ppp0"
CELLULAR_APN = "wyleslte.gw7.vzwentp"
CELLULAR_AUTO = "1"
CELLULAR_PORT = "ttymxc1"

Programming The 6UL SBC Pro Board

To update the firmware on the i.MX6:

$ shutdown -r now
  -- Press any key to entery u-boot --
> update linux tftp linux
> update rootfs tftp rootfs
  -- The next two are not generally necessary --
> update recovery tftp recovery
> update uboot tftp uboot
> boot