\\newpage # Xenomai The system must be setup first the same way as for EC-Simulator for Linux, especially installation of the atemsys module and Real-time Ethernet Driver usage preparation. #### SEE ALSO Chapter [Linux](os_linux.html.md#linux) The binaries are built using the following versions: - x64: : - Xenomai 3.0.2, tested on Linux Kernel 3.18.20 (Cobalt) - EVL r0.44 (Xenomai 4), tested on Linux Kernel 5.15.106 - aarch64: : - EVL r0.44 (Xenomai 4), tested on Linux Kernel 5.15.106 - x86: : - Xenomai 2.6.2.1, tested on Linux Kernel 3.5.7 - Xenomai 3.0.2, tested on Linux Kernel 3.18.20 (Cobalt) and 3.10.32-rt31 (Mercury) ## Setting up and running EcSimulatorHilDemo 1. Prepare system : Prepare the system to run EcSimulatorHilDemo on Linux as described in chapter [Linux](os_linux.html.md#linux) 2. Compile EcSimulatorHilDemo : As a starting point there is the Eclipse project for EcSimulatorHilDemo, located at `Workspace/Xenomai/` for Xenomai 2 and 3 and at `Workspace/Xenomai4/` for Xenomai 4. Ensure `OPERATING_SYSTEM`, `ARCH`, `CFLAGS`, `LDFLAGS`, `LD_LIBRARY_PATH` are set accordingly (export ARCH=x86, …) when compiling using Eclipse! For Xenomai 4 the environment variable `EVL_PATH` must contain the path of the libevl installation and `EVL_LIBS` its multiarch library subdirectory (`x86_64-linux-gnu` for x64, `aarch64-linux-gnu` for aarch64), because the project refers to `$EVL_PATH/include` and `$EVL_PATH/lib/$EVL_LIBS`. Also ensure the following define is present: ```default EC_OS_VERSION=4 ``` 3. Run using GDB : Provide search path for Xenomai libraries and prevent GDB to stop execution on SIGXCPU: ```console $ export LD_LIBRARY_PATH=/usr/xenomai/lib $ gdb --args ./EcSimulatorHilDemo -intelgbe 2 1 -f eni.xml -v 3 $ [...] $ (gdb) handle SIGXCPU nostop noprint nopass $ (gdb) run ``` #### SEE ALSO [Running EcSimulatorHilDemo](architecture_os-configuration.html.md#running-ecdemo) ## OS compiler settings Besides the general settings from [OS Compiler settings](architecture_sdk.html.md#compile-ecdemo) the following settings are necessary to build the example application for Xenomai. Extra include paths : ```default /SDK/INC/Xenomai /Examples/Common/Xenomai ``` Extra source paths : ```default /Examples/Common/Xenomai /Sources/OsLayer/Xenomai ``` Extra library paths to the main EtherCAT® components : - Xenomai 2 and 3:
```default /SDK/LIB/Xenomai ```
- Xenomai 4:
```default /SDK/LIB/Xenomai4 ``` Extra libraries (in this order) : - Xenomai 2:
```default EcSimulatorRasServer EcSimulator pthread dl rt native xenomai ```
- Xenomai 3:
```default EcSimulatorRasServer EcSimulator pthread dl rt ``` `xeno-config --cflags` and `xeno-config --ldflags` of the Xenomai installation return the needed `CFLAGS` and `LDFLAGS`. If further information is needed, please refer to [http://xenomai.org/](http://xenomai.org/) . : - Xenomai 4:
```default EcSimulatorRasServer EcSimulator pthread evl dl ```