Developing Standalone Royale Client Application Print

 

Development of Royale client applications for Linux relies on the ARM GCC toolchain and Royale API libraries, included in the Yocto SDK. The SDK is built as part of the Yocto Linux build procedure, and is packaged into a self-installing archive with the following name:
fsl-imx-wayland-glibc-x86_64-image-pmd-debug-aarch64-toolchain-5.4-zeus.sh.

A archive with prebuilt Yocto SDK can be downloaded from the following link: Yocto SDK.

Being on your Linux cross-development host, go through the steps described below to install the C/C++ SDK and develop Royale client Linux applications (those built outside of the Yocto build).


Installing C/C++ SDK

The Yocto SDK is installed on the Linux development host using the following command:

[[email protected] ~]$ chmod 755 fsl-imx-wayland-glibc-x86_64-image-pmd-debug-aarch64-toolchain-5.4-zeus.sh
[[email protected] ~]$ sudo /bin/bash fsl-imx-wayland-glibc-x86_64-image-pmd-debug-aarch64-toolchain-5.4-zeus.sh
NXP i.MX Release Distro SDK installer version 5.4-zeus
Enter target directory for SDK (default:/opt/fsl-imx-wayland/5.4-zeus):
You are about to install the SDK to "/opt/fsl-imx-wayland/5.4-zeus". Proceed[Y/n]?
Extracting SDK..................

Activating SDK

After installation, the Yocto SDK environment needs to be activated. The activation process configures paths to the SDK tools and sets up various environment variables, required by the SDK. The environment activation can be done using the following command (which needs to be performed every time a new instance of shell is opened):

[[email protected] ~]$ source /opt/fsl-imx-wayland/5.4-zeus/environment-setup-aarch64-poky-linux


Building Royale Samples

Along with Royale libraries and headers, the Yocto SDK includes several Royale client sample applications. The applications are located at the following path:
/opt/fsl-imx-wayland/5.4-zeus/sysroots/aarch64-poky-linux/usr/share/royale/samples/

Royale sample applications use CMake build system for compiling binaries. And it is recommended to use CMake configuration files from these applications as a base for developing a custom Royale client application.

Follow the below steps for compiling Royale sample applications from console:

  1. Create a build directory.
  2. [[email protected] ~]$ mkdir build
    [[email protected] ~]$ cd build/

  3. Run CMake makefile generation.
  4. [[email protected]localhost ~]$ cmake /opt/fsl-imx-wayland/5.4-zeus/sysroots/aarch64-poky-linux/usr/share/royale/samples/

  5. Run make
  6. [[email protected] ~]$ make


Using Eclipse IDE for Development of a Royale Client Application

The instructions below describe how to setup the Eclipse IDE for compiling the sampleCameraInfo application using the Eclipse internal builder:

  1. Open Eclipse and create an empty C++ project with the sampleCameraInfo name, select Cross GCC as a toolchain.
  2. When the Cross GCC Command dialog appears, set the Cross compile prefix field to aarch64-poky-linux-, and Cross compiler path to
    /opt/fsl-imx-wayland/5.4-zeus/sysroots/x86_64-pokysdk-linux/usr/bin/aarch64-poky-linux.
  3. Copy sampleCameraInfo files from the Yocto SDK to the new project location:
  4. cp /opt/fsl-imx-wayland/5.4-zeus/sysroots/aarch64-poky-linux/usr/share/royale/samples/cpp/sampleCameraInfo/sampleCameraInfo.cpp ~/workspace/sampleCameraInfo
    cp -r /opt/fsl-imx-wayland/5.4-zeus/sysroots/aarch64-poky-linux/usr/share/royale/samples/inc/sample_utils/ ~/workspace/sampleCameraInfo/

  5. Open the project properties dialog, then switch to the C/C++ Build -> Settings tab.
  6. Switch to the Cross G++ Compiler -> Include tab and add project root directory as the include path.
  7. Switch to the Cross G++ Compiler -> Miscellaneous tab and add the following parameter to the end of the Other flags field:
    --sysroot=/opt/fsl-imx-wayland/5.4-zeus/sysroots/aarch64-poky-linux
  8. Switch to the Cross G++ Linker -> Libraries tab and add royale to the Libraries list.
  9. Switch to the Cross G++ Linker -> Miscellaneous tab and add the following parameter to the end of the Other flags field:
    --sysroot=/opt/fsl-imx-wayland/5.4-zeus/sysroots/aarch64-poky-linux

When the above steps are completed, the sampleCameraInfo project is ready for build. Press the Build button and verify that the build process finishes without errors.