Install The Yocto SDK
The SDK built using BSP-Yocto-Ampliphy-AM64x-PD23.2.1 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-AM64x 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-AM64x‘s Cortex-A cores.
Note
This guide will walkthrough the SDK installation using a the pre-built SDK installer, but head over to the Build the BSP 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 20.04 LTS, 64-bit Host Machine with root permission
If using a virtual machine, VMWare Workstation, VMWare Player, and VirtualBox are all viable solutions.
100GB 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
Download the Pre-Built SDK Installer or Build it Yourself
First, navigate to a directory containing the SDK installer. If you built it yourself, it will be found at $BUILDDIR/deploy/sdk/, but the following steps will help you download a pre-built SDK:
host:~$ cd ~/Downloads
Use the following command to download the pre-built SDK installer to the current working directory:
host:~$ wget https://download.phytec.de/Software/Linux/BSP-Yocto-AM64x/BSP-Yocto-Ampliphy-AM64x-PD23.2.1/sdk/ampliphy/phytec-ampliphy-glibc-x86_64-phytec-headless-image-aarch64-toolchain-BSP-Yocto-Ampliphy-AM64x-PD23.2.1.sh
Change the permissions of the installer:
host:~$ sudo chmod a+x phytec-ampliphy-glibc-x86_64-phytec-headless-image-aarch64-toolchain-BSP-Yocto-Ampliphy-AM64x-PD23.2.1.sh
Run the installer:
host:~$ ./phytec-ampliphy-glibc-x86_64-phytec-headless-image-aarch64-toolchain-BSP-Yocto-Ampliphy-AM64x-PD23.2.1.sh
When prompted, install the SDK to the default location at /opt/ampliphy/BSP-Yocto-Ampliphy-AM64x-PD23.2.1 or, optionally, create a custom install location. This and other guides in the phyCORE-AM64x wiki will assume you installed the SDK to the default location but just remember where if you choose somewhere else.
Source the Cross-Compilation Environment
Note
Sourcing both the Yocto BSP environment and the Yocto SDK environment within the same terminal session can cause problems, it is advised to use separate terminal sessions for the two development efforts.
This script will have to be sourced in every new terminal session you plan to use for cross-platform development:
host:~$ . /opt/ampliphy/BSP-Yocto-Ampliphy-AM64x-PD23.2.1/environment-setup-aarch64-linux
# this command is equivalent
host:~$ source /opt/ampliphy/BSP-Yocto-Ampliphy-AM64x-PD23.2.1/environment-setup-aarch64-linux
Note
Remember the location of /opt/ampliphy/BSP-Yocto-Ampliphy-AM64x-PD23.2.1/environment-setup-aarch64-linux and the command you used to source it, you’ll need this handy throughout your application development!
Now you can leverage the cross-compilation toolchain in your project:
which $CC
/opt/ampliphy/BSP-Yocto-Ampliphy-AM64x-PD23.2.1/sysroots/x86_64-phytecsdk-linux/usr/bin/aarch64-phytec-linux/aarch64-phytec-linux-gcc