Aim API-FDX-2 V2 Parts list manual

API-FDX
Linux
Getting Started
Manual
ARINC664 Interface Module
API-FDX-2 V2 (PCI Version)
April 2007
V14.3x Rev. A
AIM GmbH
Sasbacher Str. 2
79111 Freiburg, Germany
Tel: +49-761-45229-0
Fax: +49-761-45229-33
www.aim-online.com


GmbH
API-FDX
Linux Getting Started Manual
ARINC664 Interface Module
API-FDX-2 V2 (PCI Version)
V14.3x Rev. A
April 2007
60-15920-35-143X-A

ii
GmbH
www.aim-online.com
AIM
W
ORLDWIDE
AIM GmbH
Sasbacher Str. 2
79111 Freiburg, Germany
+49-761-45 22 90
sales@aim-online.com
Munich Sales Office
Terofalstrasse 23 a
80689 Muenchen
+49-89-70 92 92 92
salesgermany@aim-online.com
AIM-USA
3703 North 200
th
Street
Elkhorn, NE 68022
866-AIM-1553
866-AIM-A429
salesusa@aim-online.com
AIM UK
Lincoln Rd, Cressex Business Park
Bucks HP12 3RB, England
+44-1494-44 68 44
salesuk@aim-online.com
Notice: The information that is provided in this document is believed to be accurate. No
responsibility is assumed by AIM for its use. No license or rights are granted by implication in
connection therewith. Specifications are subject to change without notice.
©
Copyright 2006: AIM
www.aim-online.com

iii
GmbH
DOCUMENT HISTORY
The following table defines the history of this document. The description of
changes/enhancements made to each version is defined in general terms.
Version
Cover Date Created by Description
V14.33 April 2007 M. Melcher General Updates. Adaptations to Kernel Versions >
2.6.17
V13.11 May 2006 M. Pietrek Cross-compilation added
V13.10 April 2006 M. Pietrek Supporting linux kernels with 4kB stack
V13.00 January 2006 M. Pietrek Various Bugfixes and improvements added
V07.00 April 2005 M. Pietrek New BSP design.Linux 2.6 support added

iv
GmbH
THIS PAGE IS INTENTIONALLY LEFT BLANK

v
GmbH
TABLE OF CONTENTS
Section Title Page
1. INTRODUCTION.......................................................................................................1
1.1. General...................................................................................................................... 1
1.2. How This Manual Is Organized................................................................................2
1.3. Conventions Used.....................................................................................................3
1.4. Applicable Documents.............................................................................................. 4
2. REQUIREMENTS ...................................................................................................... 5
3. NEW BSP AND HARDWARE INSTALLATION PROCEDURE ........................7
3.1. Hardware Installation................................................................................................ 8
3.2. BSP Software Installation .........................................................................................9
3.3. Update the Onboard Flash Firmware......................................................................11
3.4. BSP Deinstallation..................................................................................................12
4. BSP UPGRADE PROCEDURE............................................................................... 13
5. COMPILING AND RUNNING THE SAMPLE PROJECT................................. 15
6. RUNNING THE BOARD TEST APPLICATIONS...............................................17
7. RECOMPILATION AND REINSTALLATION OF THE DRIVER .................. 19
8. PROGRAMMING THE API-FDX MODULE.......................................................21
8.1. Sample API-FDX-2/4 Source Code........................................................................21
8.1.1. Include the AyI-FDX Header File ......................................................................21
8.1.2. Basic Library Functions and AIM Resource Login............................................21
8.1.3. Initializing the AyI-FDX Board and IRIG Time source..................................... 24
8.1.4. Initializing the AyI-FDX Ports ...........................................................................25
8.1.5. Setting up a UDP Port oriented Transmitter ......................................................26
8.1.6. Setting up a Generic Transmitter Port ................................................................28
8.1.7. Setting up a VL oriented Receiver .....................................................................31
8.1.8. Setting up a Chronological Monitor Receiver.................................................... 32
8.1.9. Starting the Transmitter and the Receiver ..........................................................33
8.1.10. Stopping the Transmitter and the Receiver ........................................................33
8.1.11. Releasing the Ports and Logging Out .................................................................33
9. NOTES ....................................................................................................................... 35
9.1. Acronyms and Abbreviations ................................................................................. 35

vi
GmbH
A. DOWNLOADING THE BSP FROM AIM-ONLINE............................................ 37

API-FDX Linux Getting Started Manual 1
GmbH
Section 1 – Introduction
1. INTRODUCTION
1.1. General
This Getting Started Manual has been developed to assist first time users of the AIM API-FDX
boards with software installation, hardware setup, and starting a sample project
.
Step by step instructions cover board installation, driver configuration and Board Software
Package installation. The Board Software Package (BSP) provides users with current
documentation, board drivers, and sample development projects. The current version of all
BSPs is available from the DOWNLOAD AREA of the AIM website at http://www.aim-
online.com.
AIM is also a leading designer and manufacturer of other high performance test and simulation
modules, databus analyzer software and systems for MIL-STD-1553 A/B, ARINC429,
STANAG3910, MIL-STD-1760 Applications, PANAVIA Serial Link and Fibre Channel.
Supported hardware platforms include PC/AT, PCI, Compact PCI, VME, VXI, PMC and
PCMCIA. Information about all AIM products can be found at http://www.aim-online.com

2 API-FDX Linux Getting Started Manual
GmbH
Section 1 – Introduction
1.2. How This Manual Is Organized
This manual is organized as follows:
Section 1, INTRODUCTION, contains an overview of this manual.
Section 2, REQUIREMENTS, lists all the requirements the system must meet for the
BSP.
Section 3, NEW BSP INSTALLATION PROCEDURE, describes the procedure used to
install the BSP software and the AFDX hardware on a system that does not have a
previous API-FDX BSP installed.
Section 4, BSP UPGRADE PROCEDURE, describes the procedure used to upgrade the
BSP software and the API-FDX onboard flash firmware on a system that has a
previous API-FDX BSP installed.
Section 5, COMPILING AND RUNNING A SAMPLE PROJECT, contains the procedure
used to build, and run a sample project included in the BSP.
Section 6, RECOMPILATION AND REINSTALLATION OF THE DRIVER, contains the
procedure necessary when the system’s kernel is changed.
Section 7, PROGRAMMING THE API-AFDX MODULE, contains sample source code
and describes how to program applications which can be used to send and receive
frames using the FDX interface module

API-FDX Linux Getting Started Manual 3
GmbH
Section 1 – Introduction
1.3. Conventions Used
Within this document, a number of styles of text and layout will be used to help differentiate
between the different kinds of information. Here are examples of the styles used and an
explanation of what they mean:
Italics - keys that you press on the keyboard, like Ctrl and Enter. A plus sign between the
words indicates that you should enter the key simultaneously, for example,
Ctrl+Alt+Del
Bold text - a parameter, menu item, return value, function panel item or dialog box button or
option.
Bold Blue - will be used to show reference documentation
Bold italics - caution, warning or note.
|- an action delineator that will lead you through nested menu items and dialog box
options to a final action, for example, the File | Open ..
Font - font used to show paths, directories and filenames. For example:
/usr/local/lib/libaim_fdx.so
A smaller version of this font will be used to list software
code.

4 API-FDX Linux Getting Started Manual
GmbH
Section 1 – Introduction
1.4. Applicable Documents
AIM has developed several documents that may be used to aid the developer with other aspects
involving the use of the API-FDX interface module. These documents and a summary of their
contents are listed below:
Reference Manual AyI-FDX-2/4 AMC-FDX-2 Application Interface Library - provides the
AFDX application developer with the detailed API/ACI/AMC-FDX library function
calls. This guide is to be used in conjunction with the API/ACI/AMC-FDX
Programmer's Guide for Windows Applications. The Linux API is source compatible to
the Windows API, therefore the same document is being be used.
API-FDX Hardware Manual - provides the hardware user’s manual for the API-FDX PCI-Bus
modules. The document covers the hardware installation, the board connections, the
technical data and a general description of the hardware architecture.

API-FDX Linux Getting Started Manual 5
GmbH
Section 2 – Requirements
2. REQUIREMENTS
To install the BSP, your system must meet the following requirements.
A linux 2.4 or 2.6 kernel, configured to provide module support
make-3.80
gcc 3.x or gcc 4.x
a free PCI slot for the board if not already installed

6 API-FDX Linux Getting Started Manual
GmbH
Section 2 – Requirements
THIS PAGE IS INTENTIONALLY LEFT BLANK

API-FDX Linux Getting Started Manual 7
GmbH
Section 3 – New BSP and Hardware Installation Procedure
3. NEW BSP AND HARDWARE INSTALLATION PROCEDURE
This section contains the procedure used to install the BSP software and the API-FDX hardware
on a system that does not have a previous API-FDX BSP installed. If installing on a system that
has a previous version of the BSP installed, the BSP upgrade procedure described in Section 4
should be used.
The BSP for the AIM API-FDX contains reference documentation, board drivers, sample
development projects. These files are automatically loaded onto the system by installing the BSP
software package. The firmware upgrade utility files are not installed on the system
The software is available on CD from AIM or via a download from AIM-Online. Appendix A
contains instructions for obtaining the BSP via a download from AIM-Online.
To properly install the AIM API-FDX BSP and hardware:
a. Perform the procedure described in Section 3.1, Hardware Installation.
b. Complete the procedure described in Section 3.2, BSP Software Installation.
Note: While the BSP may be installed without having any hardware inserted, it is
recommended to do so in order to verify proper function of the driver.

8 API-FDX Linux Getting Started Manual
GmbH
Section 3 – New BSP and Hardware Installation Procedure
3.1. Hardware Installation
The API-FDX features full PCI Plug-and-Play capability. There are no jumpers or switches to
modify before installation.
The hardware installation is completed by performing the steps as described below:
To install the API1-FDX board
ESD Warning!!! The API-FDX boards are typical electronic devices that are sensitive
to electrostatic discharge. It is important to observe normal precautions when
handling the board to prevent damage.
1. Power off the PC
2. Insert the API-FDX board into the first available PCI slot
3. Reboot the PC

API-FDX Linux Getting Started Manual 9
GmbH
Section 3 – New BSP and Hardware Installation Procedure
3.2. BSP Software Installation
The API-FDX Board Support Package includes the following resources which will be installed
on your computer upon completion of the steps described in this section:
API-FDX drivers and helper scripts
API-FDX library and header files
Example applications
To install the BSP software from the AIM provided CD or a download from AIM-
Online
1. If using the AIM provided CD, insert the CD into the CD ROM drive and mount it
with “
mount /cdrom
” or the command your distribution recommends.
2. Change into the directory where you want the BSP and examples to be installed, e.g.
your home directory. Then unpack the file
“
tar xfz /cdrom/APIFDX/Linux/apifdx-linux-bsp.tar.gz
”.
3. Change into the subdirectory “./apifdx-linux-bsp-13.00/” and become
superuser with “
su
”
4. Run “
sh ./install.sh
” to install the BSP and then compile and install the kernel
driver.
5. The script will ask you for your default Runlevel. The AFDX kernel module will be
automatically started in this Runlevel.
6. The script will detect whether your board needs a flash update. This may be necessary
if you have downloaded the BSP separately. In case an update is necessary, it will ask
you for permission before flashing the firmware. When the flash update is complete,
the system must be powered-off and restarted. Resetting isn’t sufficient. Then the
BSP can be used.
NOTE THAT ANY INTERRUPTION OF THE FLASH UPDATE WILL
RENDER THE BOARD USELESS.
melcher:~$ mount /cdrom
melcher:~$ tar xfz /cdrom/apifdx-linux-bsp.tgz
melcher:~$ cd apifdx-linux-bsp-14.33/
melcher:~/apifdx-linux-bsp-14.33$ su
Password:
/home/melcher/apifdx-linux-bsp-14.33 # sh ./install.sh
testrechner:/home/melcher/tmp/apifdx-linux-bsp-13.00# sh
install.sh
Please enter your default Runlevel number:
Module aim_fdx will be automatically loaded in this Runlevel
2
Previous version exists, removing it

10 API-FDX Linux Getting Started Manual
GmbH
Section 3 – New BSP and Hardware Installation Procedure
Removing aim files
Stopping module aim_fdx
Uninstalling successful
Compiling module for kernel linux-2.6.x
Installing aim module to /lib/modules/2.6.17/extra//aim_fdx.ko
Installing scripts /etc/init.d/aim_fdx,
/etc//rc2.d/S99aim_fdx,
/etc//rc2.d/K01aim_fdx
Compiling library
Installing library
Installing includes
Installing firmware
Loading minimal driver for firmware update
Device /dev/aim_fdx created on major no. 253
Running depmod (e.g. to locate for firmware_class)
Trying to load module.
Depending on your system/kernel SMP capabilities, system may be
blocked for about 10s
Reloading module aim_fdx
Loading /lib/modules/2.6.17/extra/aim_fdx.ko
Device /dev/aim_fdx created on major no. 253
Driver loaded successfully, examples may be used
Installation successful, have fun :-)
/home/melcher/apifdx-linux-bsp-14.33 #
The installation will create these files on your system.
/etc/init.d/aim_fdx The startup script that loads the driver and
sets system parameters.
/etc/rc.d/rc2.d/XXXaim_fdx A symlink to the startup script, the actual path
depends on your Runlevel selection at
beginning of install script.
/dev/aim_fdx Device node for kernel configuration
/lib/modules/<kernel>/extra/
aim_fdx.{o,ko}
The kernel module compiled for your kernel
configuration
/lib/modules/<kernel>/extra/
firmware_emulation.o
On kernels without firmware_class support
(<2.4.23), this module emulates the
behaviour. For 2.6 this module is not present
/usr/local/lib/libaim_fdx.* The API-FDX library
/usr/local/include/aim_fdx* The API-FDX header files
/lib/firmware/*.sre Downloadable firmware files
The script will also check if your system meets all requirements and will print some suggestions
if not. Among others these are
•not supported kernel versions
•not supported kernel configurations
•out-of-date firmware on the board

API-FDX Linux Getting Started Manual 11
GmbH
Section 3 – New BSP and Hardware Installation Procedure
3.3. Update the Onboard Flash Firmware
The installation script updates all boards to the correct firmware version. A manual update is not
necessary.

12 API-FDX Linux Getting Started Manual
GmbH
Section 3 – New BSP and Hardware Installation Procedure
3.4. BSP Deinstallation
To deinstall the BSP, cd into “./apifdx-linux-bsp-13.00/” and run “
sh
./install.sh --uninstall
”. This will remove all the files created during the installation.
/home/melcher/apifdx-linux-bsp-14.33 # sh ./install.sh -–uninstall
Removing aim files
Stopping module aim_fdx
Uninstalling successful
/home/melcher/apifdx-linux-bsp-14.33 #
Table of contents
Other Aim Computer Hardware manuals