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Â
Â