Demand Peripherals
Robotic and Industrial Controls for Linux

Pin Peripherals Quick Start

This guide shows how to install and use Pin Peripherals in a Linux system. It shows how to build and install the kernel components for the drivers, how to build and run the user-space device driver daemon, and how to load DPCore into a BaseBoard. It also gives a simple test to demonstrate that the whole system is working.

Contents:
    - Overview
    - Requirements
    - Procedure
    - At Boot Time
    - Test
    - Troubleshooting

 

Overview: The BaseBoard4 supports up to ten different peripherals all of which share a single USB link to a host computer. A program, dpdaemon, on the host computer handles communication with the BaseBoard and performs the multiplexing and demultiplexing needed to give each peripheral its own set of device nodes for data and configuration.

When dpdaemon starts it gets a list of peripherals built into the DPCore by interrogating the BaseBoard. Dpdaemon uses this list to create the directories and device nodes for each peripheral. All peripheral device nodes are either a fanout device or a proxy device and these two drivers must be loaded before running dpdaemon.

Installing Pin Peripherals requires building and installing the two drivers, building and installing the daemon, and getting a copy of DPCore that has the peripherals you want. At each boot you need to load fanout and proxy into the kernel, load DPCore onto the BaseBoard, and start dpdaemon.

 

Requirements: Both the drivers and dpdaemon are written in C so the GCC tool chain is needed. Building and installing the drivers requires the kernel headers as well.

You also need your copy of DPCore.bin that contains the peripherals you want. Get your copy of DPCore.bin by visiting the Demand Peripherals web site and selecting "Support" and "Build Your FPGA Image". Complete the web form to specify which peripherals you want and enter the email address where the completed DPCore.bin file should be sent. Go here to get your version of DPCore.

 

Procedure: Download, build, and install the drivers with the following commands:

        wget http://www.demandperipherals.com/downloads/proxy-1.2.tar.gz
        tar xvf proxy-1.2.tar.gz
        cd proxy-1.2
        make
        sudo make install

Download, build, and install dpdaemon with the following commands:

        wget http://www.demandperipherals.com/downloads/dpdaemon-0.9.0.tar.gz
        tar xvf dpdaemon-0.9.0.tar.gz
        cd dpdaemon-0.9.0
        make
        sudo make install
The default location for the dpdaemon binary and libraries is /usr/local/bin and /usr/local/lib. Be sure to edit the makefile to change these default values to locations on your binary and library search paths.

 

At Boot Time: Before running dpdaemon you need to load the two kernel drivers and load DPCore onto the FPGA. The following commands would normally be placed in rc.local but, using sudo, can also be run any time you want to start dpdaemon after a reboot.

        modprobe fanout
        modprobe proxy
        stty --file=/dev/ttyUSB0 -opost
        cat DPCore.bin > /dev/ttyUSB0   # BB4 green LED comes on
        dpdaemon /dev/ttyUSB0

 

Test: Peripheral #1, the buttons and LEDs on the BaseBoard, is included in all versions of DPCore so it can always be used for a simple system test. The following commands should set the LEDs to a hex value of 0x55 and should give the digits 0 to 7 depending on the combination of buttons being pressed.

        echo 55 >/dev/dp0/s01_bb4io/leds
        cat /dev/dp0/s01_bb4io/buttons &

 

Troubleshooting: Here are a few common problems to watch for when building and installing dpdaemon.

Make fails when building the kernel drivers: Be sure the kernel headers are loaded on your system. Depending on your system you may need additional tools or packages to build kernel modules. In general, if you can build the Linux kernel you should be able to build fanout and proxy without any problems.

Dpdaemon can not find one of its .so files: Be sure to install the dpdaemon libraries in a directory that is in your library search path. Look at /etc/ld.so.conf to find these directories. Depending on your system you may also have to run the ldconfig command after installation. If all else fails you should be able to set LD_LIBRARY_PATH to the dpdaemon library directory before starting dpdaemon.

No /dev/dp0 directories are created: Be sure to run the stty command or you find that the download turns on the green LED on the BaseBoard4 and that dpdaemon seems to start OK, but the /dev/dp0 directories are not created. You may want to test the BaseBoard4 by following the directions in the BaseBoard4 Hardware Reference Manual.

 

Support

Contact Us

User Forums
     General
     Hardware
     Software

Downloads