Install the SDK
The SDK includes a cross-compilation toolchain and sysroots directory for building your applications against, allowing your software that is built on your Ubuntu Host Machine to be executed on the phyCORE-iMX8X SOM. This guide walks through the installation of the SDK and how to use it to cross-compile a basic Hello World example for running on the phyCORE-i.MX8X’s Cortex-A35 cores.
Note
This guide will walkthrough the SDK installation using a the pre-built SDK installer, but head over to the :ref: BuildTheBSP-8X guide if you require building your own.
Requirements
The following system requirements are recommended to successfully install the SDK and to eventually build the BSP in its entirety. Deviations from these requirements may suffice if you don’t intend to use the same machine for building the BSP:
Ubuntu 18.04 LTS, 64-bit Host Machine with root permission
If using a virtual machine, VMWare Workstation, VMWare Player, and VirtualBox are all viable solutions.
200GB free disk space or greater (can be smaller if you don’t intend to build the BSP)
8GB of RAM or greater
4x processing cores available to the Ubuntu Host Machine or greater
SD card reader operational under Linux
Active Internet connection
Host Setup
To meet the general requirements for working with the pre-built SDK, as well as for building the BSP, install the following packages to the Ubuntu Host Machine:
sudo apt-get update
sudo apt-get install gawk wget git-core diffstat unzip texinfo gcc-multilib build-essential chrpath socat cpio python python3 python3-pip python3-pexpect xz-utils libsdl1.2-dev curl vim libyaml-dev repo
Download the Pre-Built SDK Installer
First, navigate to a directory that is dedicated to hold your downloaded files:
cd ~/Downloads
Use the following command to download the pre-built SDK installer to the current working directory:
wget https://artifactory.phytec.com/artifactory/imx8x-images-released-public/BSP-Yocto-FSL-i.MX8X-PD21.1.0/fsl-imx-xwayland-glibc-x86_64-imx-image-multimedia-aarch64-imx8x-phycore-kit-toolchain-5.4-zeus.sh
Note
Links for downloading the pre-built SDK installer, along with other pre-built binaries, can be found on the :ref: PreBuilts-8X page.
Change the permissions of the installer:
sudo chmod a+x fsl-imx-xwayland-glibc-x86_64-imx-image-multimedia-aarch64-imx8x-phycore-kit-toolchain-5.4-zeus.sh
Run the installer:
./fsl-imx-xwayland-glibc-x86_64-imx-image-multimedia-aarch64-imx8x-phycore-kit-toolchain-5.4-zeus.sh
When prompted, install the SDK to the default location at /opt/fsl-imx-xwayland/5.4-zeus or, optionally, create a custom install location. This and other guides in the phyCORE-i.MX8X wiki will assume you installed the SDK to the default location but just remember where if you choose somewhere else.
Source the Cross-Compilation Enviroment
This script will have to be sourced in every new terminal session you plan to use for cross-platform development:
. /opt/fsl-imx-xwayland/5.4-zeus/environment-setup-aarch64-poky-linux
# this command is equivalent
source /opt/fsl-imx-xwayland/5.4-zeus/environment-setup-aarch64-poky-linux
Tip
Remember the location of the environment-setup-aarch64-poky-linux script and the command you used to source it, you’ll need these handy throughout your development!
Now you can leverage the cross-compilation toolchain in your project:
user@ubuntu:~/temp$ which $CC
/opt/fsl-imx-xwayland/5.4-zeus/sysroots/x86_64-pokysdk-linux/usr/bin/aarch64-poky-linux/aarch64-poky-linux-gcc