5. Porting

To build Connext TSS for a new platform or architecture, create or update files in the CMake resource directory (<RTITSSHOME>/resource/cmake).

The CMake resource directory contains Toolchains and Modules directories. Toolchains contains CMake toolchain files. Modules contains RTI-specific CMake scripts, including additional platform- and toolchain-specific files.

5.1. Build Connext TSS for a New CMake Platform

To port Connext TSS to a new CMake platform, a corresponding platform file may be required in the Toolchains directory (<RTITSSHOME>/resource/cmake/Toolchains/Platform). While a host platform likely will not need one, a cross-compiled platform likely will. Follow the CMake toolchain documentation to create a new platform file. Alternately, contact RTI Support and ask about the availability of new CMake platforms or toolchains.

To set RTI-specific compiler options, each platform must have a CMake platform file in the Modules directory (<RTITSSHOME>/resource/cmake/Modules/ProjectOptions/Platform). These compiler options depend on the platform defined by the CMAKE_SYSTEM_NAME variable in a corresponding toolchain file (or guessed by CMake). RTI includes these platform and toolchain files in the <RTITSSHOME> top-level CMakeList file, based on the RTI TSS architecture name. These files may enable or disable Connext TSS features and products depending on CMake variables defined by you or the toolchain file.

5.1.1. Cross-Compilation

A cross-compiled CMake platform must have another platform file in <RTITSSHOME>/resource/cmake/Modules/Platform to set the target platform. You must create a file named <CMAKE_SYSTEM_NAME>.cmake for this purpose; other configuration files are optional.

General rules for the cross-compiled platform file are as follows:

  • The file must start with the name of the platform to support, as defined by the CMAKE_SYSTEM_NAME variable.

  • These files must not contain any RTI-specific options; those options need to be defined in the ProjectOptions folder (<RTITSSHOME>/resource/cmake/Modules/ProjectOptions).

  • Hard-coded paths are not allowed; use relative paths to CMake variables or environment variables.

5.2. Build Connext TSS for a New CMake Architecture

While the Platform directories contain CMake files with shared settings between the toolchains of a platform family, the Architecture directory (<RTITSSHOME>/resource/cmake/Toolchains/Architecture) contains the toolchain file for a specific architecture. To port Connext TSS to a new CMake architecture, create a new toolchain file in this directory.

A basic toolchain file, for example, could include just the following:

# Toolchain file for Linux x64 with GCC 4.8.2

include("${CMAKE_CURRENT_LIST_DIR}/../Common.cmake")
platform_setup()

set(PLATFORM_C_COMPILER_EXPECTED_VERSION 4.8.2)
set(PLATFORM_CXX_COMPILER_EXPECTED_VERSION 4.8.2)

set(CMAKE_C_FLAGS "-m64 ${COMPILER_WARNING_FLAGS_C}")
set(CMAKE_CXX_FLAGS "${COMPILER_WARNING_FLAGS_CXX}")
set(CMAKE_EXE_LINKER_FLAGS "-static-libgcc ${CMAKE_EXE_LINKER_FLAGS}")

set(SYSLIBS_ARCH "-ldl -lnsl -lm -lpthread -lrt")

5.2.1. Variable Definitions

5.2.1.1. General

The following variables can be used with any CMake architecture:

  • CMAKE_<LANG>_COMPILER: Full path for the compiler.

  • CMAKE_AR: Full path for the archiving tool for static libraries.

  • CMAKE_RANLIB: Full path for the randomizing tool for static libraries.

  • CMAKE_LINKER: Full path for the linker. Note that for most platforms, CMake uses the compiler for linking. This can be changed in the platform files, overriding the linking rules.

  • CMAKE_<LANG>_FLAGS_INIT: Flags for the compiler.

  • CMAKE_SHARED_LINKER_FLAGS_INIT: Flags for the linker.

  • COMPILER_WARNING_FLAGS_C: Flags to enable warnings in the C compiler.

  • COMPILER_WARNING_FLAGS_CXX: Flags to enable warnings in the C++ compiler.

  • WARNING_AS_ERROR_FLAG: Flags to enable treat warnings as errors.

Typically, it’s enough to specify the compilers in your toolchain file. CMake internally searches for the tools ar and ranlib, as well as the linker, from the directory containing the compiler.

5.2.1.2. Cross-compiling

The following CMake variables can be used when cross-compiling:

  • CMAKE_SYSTEM_NAME: Target platform name, usually output from uname -s. Used by CMake to load the platform configuration files under Platform/$<CMAKE_SYSTEM_NAME>. Setting this variable means cross-compiling and CMake sets the CMAKE_CROSSCOMPILING variable.

  • CMAKE_SYSTEM_VERSION: Target platform version, usually output from uname -r. Not used by CMake.

  • CMAKE_SYSTEM_PROCESSOR: Target CPU name, usually output from uname -p. Used to load options for the compiler.

  • CMAKE_SYSROOT: Path to pass to the compiler in the –sysroot flag.

5.3. Port Connext TSS to VxWorks® 653 Systems

5.3.1. Build Connext TSS

This section explains how to build a Connext TSS library for a VxWorks 653 3.0.1.1 target platform using CMake.

  1. Make sure CMake is in the PATH environment variable.

  2. Set the following environment variables:

    RTIMEARCH=ppce6500Vx653-3.0.1.1gcc4.3.3
    RTIMEHOME=<path/to/connextmicro lib and include folder>
    RTITSSARCH=ppce6500Vx653-3.0.1.1gcc4.3.3
    RTITSSHOME=<path/to/face_tss>
    
  3. Set the environment for VxWorks 653 3.0.1.1:

    <Path to VxWorks 653 3.0.1.1 installation>/wrenv.sh -p vxworks653-3.0.1
    
  4. Change directory to <RTITSSHOME>.

  5. Create a build directory and change to it. For example:

    mkdir ${RTITSSHOME}/build
    cd ${RTITSSHOME}/build
    
  6. Execute the following command to configure CMake and generate the Makefile:

    cmake -DRTI_CONNEXT_TYPE=micro -DRTI_TSS_ENABLE_FACE_COMPLIANCE=SafetyBase -DCMAKE_BUILD_TYPE=<Debug|Release> ..
    
  7. Execute the following command to build the libraries:

    cmake --build .
    
  8. The Connext TSS libraries will be available at the following location:

    ${RTITSSHOME}/lib/${RTITSSARCH}/micro
    

5.3.2. Create and Set Up an Application Project

This section steps you through the process of creating Connext TSS VxWorks 653 application projects on Wind River® Workbench.

  1. Make sure the Connext Micro libraries are built.

  2. Open Wind River Workbench.

  3. Create a new Module Integration Project:

    • Go to File > New > Wind River Workbench Project.

    • Select the target operating system, “VxWorks 653 3.0.1.1.”

    • Select “Module Integration Project.”

    • Enter a project name.

    • Select the board support package, “fsl_t2080_qds.”

    • Recommended: Add partitions here by clicking Add and selecting Independent Cert OS.” The application configuration and operating system projects are created automatically, and steps 2 - 5 can be omitted.

    • Click Finish.

  4. Create a new Partition Application Project:

    • Go to File > New > Wind River Workbench Project.

    • Select the target operating system, VxWorks 653 3.0.1.1.

    • Select Partition Application.

    • Enter an application name; for example, “part1_app.”

    • Click Finish.

    • Drag the new application project into the Module Integration Project.

  5. Create a new Partition Configuration Project:

    • Same as the previous step, but select Partition Configuration and, for example, “part1_cfg” as an application name.

  6. Create a new Partition Operating System Project:

    • Go to File > New > Wind River Workbench Project.

    • Select the target operating system, VxWorks 653 3.0.1.1.

    • Select Partition Operating System.

    • Enter a name; for example, “part1_pos.”

    • Select Based on: “a board support package.”

    • Select BSP: “fsl_t2080_qds.”

    • Select Independent Cert OS.”

    • Click Finish.

    • Drag the new POS project into the Module Integration Project.

    • Right-click the application project, select Properties > Project References, check the box of the new POS project, then click OK.

  7. Repeat steps 4 - 6 for all applications as needed.

5.3.3. Create Partitions, Ports, and Channels

  1. Add partitions. (If all partitions were created during the creation of the Module Integration Project, this step can be omitted.)

    • Open Module Configuration, click the Partitions tab and select Add > Partition.

    • Select a partition name.

    • In Payloads, add the application, configuration, and operating system projects created above. This can be done directly when creating the partition or in the module configuration, as shown below:

      _images/image2.png
    • Repeat for as many partitions as needed.

  2. Create ports.

    • In the Partitions tab, click on Ports for one of the new partitions.

    • Click the + button to add ports.

      _images/image3.png

      Queueing ports are used for inter- or intra-partition communication. Serial ports are used to log output to the AMIO console. For the partition that is used for communication, two intra send and receive serial ports are needed, as well as one send and receive serial port for channels to the other partitions. The following example shows two partitions:

      _images/image4.png
    • Go to the Module tab and set the Memory configuration for the ports:

      _images/image5.png
  3. Create channels.

    • In the Module tab, click Channels, select Add, then select the source and destination partition and ports:

      _images/image6.png
    • Create channels between the serial ports used to view output with the AMIO console.

  4. Configure the kernel.

    • Open the Kernel configuration of the POS project.

    • Right-click Certified Network Components, then select Include > Next > Finish.

      _images/image7.png
    • For one of the partitions, set AMIO_SERVER_POLL_FREQUENCY to a non-zero value, and add the serial device in Module Configuration > Partitions > Devices. In the following example, the value is “10” and the serial device is “uart0”:

      _images/image8.png
    • In the Module Configuration, set Periodic processing start to true.

      _images/image9.png

Note

We recommended testing the configuration at this point (before adding any application code and dependencies). To do so, add a print command in the function _653AppEntry (653Application.c) and check the output on the AMIO console.

5.3.4. Add Dependencies and Defines

  1. Add Include Paths to Build Properties:

    • Right-click the Connext_TSS project and select Properties > Build Properties > Paths.

    • Add -I<Absolute path to TSS installation directory>/include, then click OK.

    _images/properties-paths.png
    • Repeat the previous two steps for the following paths:

      • -I<Absolute path to TSS installation directory>/include/micro

      • -I<Absolute path to TSS installation directory>/include/micro/FACE

      • -I<Absolute path to Micro installation directory>/include/rti_me

  2. Add Defines to Build Properties:

    • Right-click the Connext_TSS project and select Properties > Build Properties > Defines.

    • Add -DRTI_ARINC653=1, then click OK.

    _images/properties-defines.png
    • Repeat the previous two steps for the following Defines:

      • -DRTI_VXWORKS

      • -DRTI_VX653=3011

      • -DRTI_ENDIAN_BIG

      • -DRTI_DPSE

      • -DRTI_APP_ENABLE_UDP=1

      • -DRTIME_TARGET_NAME='"ARINC653"'

      • -DRTI_CERT

      • -DOSAPI_INCLUDE_ARINC653=1

      • -DENABLE_FACE_COMPLIANCE=FACE_COMPLIANCE_LEVEL_SAFETY_BASE

      • -DLOG_FILE_TYPE=LOG_FILE_STDOUT

      • -DRTI_CONNEXT_MICRO

      • -DRTI_STATIC_BUILD

  3. Add Micro library to Build Properties:

    • Right-click the Connext_TSS project, then select Properties > Build Properties > Libraries.

    • Select Add fully qualified library file, input the path to the Connext Micro library (<absolute path to Micro installation directory>/lib/ppce6500Vx653-3.0.1.1gcc4.3.3/librti_mez[d].a), then click OK.

    _images/properties-libraries.png
    • Repeat the previous step for the Connext TSS library (<absolute path to TSS installation directory>/lib/ppce6500Vx653-3.0.1.1gcc4.3.3/micro/librti_tsscppz[d].a).