Installing CIFX driver under linux Ubuntu [EN]

Installing NXDRV-Driver on Linux Ubuntu

This installing guide provides the installation requirements.

Overview

 Support for Linux kernel >= 5.6

The cifX Linux driver runs as a library in userspace and accesses the card via a UIO kernel module (userspace I/O).

Figure 1: Linux cifX driver architecture (Linux DRV 13.EN)

Requirements

  • cmake (min 2.8.9)

  • libthread, librt

  • libapciaccess-dev (tested with V0.10.2 / V0.13.1-2) 
    - always needed for cifx PCI cards

Installing NXDRV-Driver

Install cmake.

 

Install libpciaccess-dev.

$ apt-get install libpciaccess-dev

Extract the sources from the zip-file.

$ tar xf <driver_version>.tar.gz

Change to the driver directory.

$ cd <driver_version>/driver/

Run the installation script.

Then follow the installation instructions

Deactivate the SPI interface if you do not use it. 

In case of successful installation, the driver is ready to use.

 In case of a system reboot, the kernel driver needs to be reloaded

Compiling the example programs

Go to the examples folder.

(Optional) Create a build directory.

Run cmake.

Build all source modules

Configuration file storage

For a cifX device (especially CIFX 50 and CIFX 90), firmware and configuration files that are not stored on the hardware, must be loaded into the hardware each time the card is powered-up.

This part describes where and how these files have to be stored.

To allow device-specific configuration, the card needs to be identified, and the firmware must be stored on the host in a specific folder structure to create a unique relation between card and configuration.

These folders locate under a global base-folder. By default, it is '/opt/cifx' (can be changed during driver initialization).

There are four different types of configuration of a card, each with its specific folder structure. For more information, please see our Linux driver manual.

This guide describes the folder structure single directory.

Go to the scripts directory.

Run the installation firmware script.

This script will create a basic directory, it locates by default under /opt/cifx/deviceconfig/FW/channel0

Installing driver module for the CIFX/M.2 netx90 based devices.

Building ax99100-pci-spi module

For using the CIFX/M.2 the ax99100-pci-spi module must be compiled and loaded to the kernel.

First, enable the SPM_PLUGIN option during compiling the driver. See Configuration file storage.

If you are using linux driver version V2.1.1.0 or lower, the kernel module ax99100-pci-spi does not compile out of the box.

If you get the following compiler error: -Werror=incompatible pointer-types located in moduleparam.h, please change in ax99100-pci-spi.c the following calls of module_param_named from ushort to uint. 

Go to cifx_m2 folder.

Change in ax99100-pci-spi.c (with e.g nano) the parameter in line 497, 501 and 505 from ushort to uint.

 

Then, in Makefile uncomment line 5

#obj-m += ax99100-pci-gpio.o

You cannot use Interrupt for now!

Build source module

Install driver modules. This will copy the driver modules into the desired kernel library folder, which are compiled for.

Update the module dependencies in the modules.dep file.

Configure the SPI interface (at chip-select 0) for accessing the netX90 based cifX/M.2 card with mode 3 and a maximum speed of 25Mhz.

(Optional) You can verify with dmesg if the ax99100-pci-spi module is successfully added to the kernel.

Run:

You should see something similar to the following:

(Optional) Check if spi device is created.

Terminal output:

Test

Then run a simple cifx example for the initial sanity check:

Go to the example folder and build the example programs. Please see Compiling the example programs.

Then run the cifxtcpserver with -a as parameter to detect the installed CIFX/M.2 card.

An example:

If a firmware (e.g. PROFINET) was downloaded to the device, you should get a similar output:

Recommended content