Linux SPI driver installation

 

Installing NXDRV-SPI-Driver on a Raspberry Pi

This installing guide provides the installation requirements.

Requirements

  • cmake

  • ccmake (optional)

 

Installing requirements

Install cmake

$ apt-get install cmake

 

Install ccmake (optional)

$ apt-get install cmake-curses-gui

 

Installing libcifx

Extract the sources from the zip-file.

$ tar xf <driver_version>.tar.gz

 

Change to the libcifx directory.

 

(Optional) Create a build directory.

 

Configure CMake environment with ccmake (optional).

Enable SPM_PLUGIN and DISABLE_PCI.

 

Press "c" to configure cmake and then "g" to generate make file.

 

Configure CMake environment without ccmake.

 

Build and install libcifx.

 

Create the necessary links and cache to the most recent shared libraries found.

Compiling the example programs

Go to the examples folder.

 

Create a build directory.

 

Configure CMake environment

 

Build all source modules

 

Please do not forget to activate SPI interface on your Raspberry Pi!

Issues during build process

While compiling cifxtcpserver example, this error appears.

Error: multiple definition of 'g_ptMutex'

 

Quick solution: In TCPServer.c located under <driver_version>examples/cifXTCPServer/, line 56 replace pthread_mutex_t* g_ptMutex to e.g static pthread_mutex_t* s_ptMutex and replace g_ptMutex to s_ptMutex.

Connect a netX90 based device to the Raspberry Pi 

 

netSHIELD90 and Raspberry Pi pinout

 

Make sure to configure your netx90 based device via netX Studio.

 

Run cifxspisample. You should get a similar output

 

 

Run Python script example

If you do not want to compile the examples. You can run our python script to verify if the driver and the device work.

Download pycifx here.

Extract the sources from the zip-file and go in to pycifx folder.

 

run main.py and you should get a similar output 

Â