Aim API-FDX-2 V2 Getting Started Manual

Arinc664 interface module

Advertisement

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

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the API-FDX-2 V2 and is the answer not in the manual?

Questions and answers

Summary of Contents for Aim API-FDX-2 V2

  • Page 1 API-FDX Linux Getting Started Manual ARINC664 Interface Module API-FDX-2 V2 (PCI Version) AIM GmbH Sasbacher Str. 2 79111 Freiburg, Germany Tel: +49-761-45229-0 Fax: +49-761-45229-33 sales@aim-online.com www.aim-online.com April 2007 V14.3x Rev. A...
  • Page 3 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...
  • Page 4 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.
  • Page 5 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...
  • Page 6 GmbH THIS PAGE IS INTENTIONALLY LEFT BLANK...
  • Page 7: Table Of Contents

    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.
  • Page 8 GmbH DOWNLOADING THE BSP FROM AIM-ONLINE..........37...
  • Page 9: 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.
  • Page 10: How This Manual Is Organized

    Section 1 – Introduction GmbH 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.
  • Page 11: Conventions Used

    Section 1 – Introduction GmbH 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: - keys that you press on the keyboard, like Ctrl and Enter.
  • Page 12: Applicable Documents

    Section 1 – Introduction GmbH 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:...
  • Page 13: Requirements

    Section 2 – Requirements GmbH 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 API-FDX Linux Getting Started Manual...
  • Page 14 Section 2 – Requirements GmbH THIS PAGE IS INTENTIONALLY LEFT BLANK API-FDX Linux Getting Started Manual...
  • Page 15: New Bsp And Hardware Installation Procedure

    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.
  • Page 16: Hardware Installation

    Section 3 – New BSP and Hardware Installation Procedure GmbH 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...
  • Page 17: Bsp Software Installation

    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 “ ” or the command your distribution recommends.
  • Page 18 Section 3 – New BSP and Hardware Installation Procedure GmbH 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.
  • Page 19: Update The Onboard Flash Firmware

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

    To deinstall the BSP, cd into “./apifdx-linux-bsp-13.00/” and run “ ”. This will remove all the files created during the installation. ./install.sh --uninstall /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 # API-FDX Linux Getting Started Manual...
  • Page 21: Bsp Upgrade Procedure

    PC driver software and the onboard target driver software. The BSP is available on CD from AIM or via a download from AIM-Online. Appendix A contains instructions for performing the download.
  • Page 22 Section 2 – Requirements GmbH THIS PAGE IS INTENTIONALLY LEFT BLANK API-FDX Linux Getting Started Manual...
  • Page 23: Compiling And Running The Sample Project

    ******************************************************************** Testprogramm for AFDX Target Software======================= Rolf Heitzmann / Michael Riedinger AIM, 22.06.2004 Date and Time of creation of sample:Apr 3 2007 13:30:20 If the application in the samples directory fails to load because "libaim_fdx.so" can't be found, then either “...
  • Page 24 Section 6 – Recompilation and Reinstallation of the driver GmbH THIS PAGE INTENTIONALLY LEFT BLANK API-FDX Linux Getting Started Manual...
  • Page 25: Running The Board Test Applications

    Section 6 – Recompilation and Reinstallation of the driver GmbH 6. RUNNING THE BOARD TEST APPLICATIONS The library features some small test applications, that are used to test the functionality of the library and the BSP. Most of them require that both ports of the FDX Board are connected by a crossover cable.
  • Page 26 Section 6 – Recompilation and Reinstallation of the driver GmbH THIS PAGE INTENTIONALLY LEFT BLANK API-FDX Linux Getting Started Manual...
  • Page 27: Recompilation And Reinstallation Of The Driver

    Section 7 – Recompilation and Reinstallation of the driver GmbH 7. RECOMPILATION AND REINSTALLATION OF THE DRIVER A recompilation of the module may be necessary if the kernel configuration has changed fundamentally, e.g. either a different kernel version is used or the kernel is switched from uniprocessor to SMP.
  • Page 28 Section 7 – Recompilation and Reinstallation of the driver GmbH THIS PAGE INTENTIONALLY LEFT BLANK API-FDX Linux Getting Started Manual...
  • Page 29: Programming The Api-Fdx Module

    ANDLE = 0; ANDLE = 0; ANDLE = 0; ANDLE 8.1.2. Basic Library Functions and AIM Resource Login Initialize the API, find available AyI-FDX resources, and login to local board and ports. bool MyFdxInit() DWORD dwTmp; bool bRetSuccess = false;...
  • Page 30 Section 8 – Programming the API-FDX Module GmbH // search the server-list for local server px_TmpServer = px_ServerNames; while ((px_TmpServer != NULL) && (!bFoundLocalServer)) if (stricmp(px_TmpServer->auc_ServerName, "local") == 0) bFoundLocalServer = true; else px_TmpServer = px_TmpServer->px_Next; //Query the local server configuration and login to the board and ports if (bFoundLocalServer) if (FdxQueryServerConfig("local", &pRLEHead) == FDX_OK) pRLE = pRLEHead;...
  • Page 31 Section 8 – Programming the API-FDX Module GmbH // free the resource-list if (pRLEHead != NULL) FdxCmdFreeMemory(pRLEHead, pRLEHead->ul_StructId); // free the server-list if (px_ServerNames != NULL) FdxCmdFreeMemory(px_ServerNames, px_ServerNames->ul_StructId); define success have valid handles global variables..bRetSuccess (g_ulBoardHandle && (g_ulPort1Handle 0) && (g_ulPort2Handle != 0);...
  • Page 32: Initializing The Ayi-Fdx Board And Irig Time Source

    Section 8 – Programming the API-FDX Module GmbH 8.1.3. Initializing the AyI-FDX Board and IRIG Time source void MyFdxResetBoard() int i; AiUInt32 ul_Mode; time_t loc_time; struct tm * ptm; TY_FDX_BOARD_CTRL_IN x_BoardCtrlIn; TY_FDX_BOARD_CTRL_OUT x_BoardCtrlOut; TY_FDX_IRIG_TIME x_IrigTime; if (g_ulBoardHandle > 0) //--- init input structure for (i=0;...
  • Page 33: Initializing The Ayi-Fdx Ports

    Section 8 – Programming the API-FDX Module GmbH 8.1.4. Initializing the AyI-FDX Ports void MyFdxResetPort() TY_FDX_PORT_INIT_IN x_PortInitIn; TY_FDX_PORT_INIT_OUT x_PortInitOut; if (g_ulPort1Handle > 0) x_PortInitIn.ul_PortMap = 1; FdxCmdTxPortInit(g_ulPort1Handle, &x_PortInitIn, &x_PortInitOut); if (g_ulPort2Handle > 0) x_PortInitIn.ul_PortMap = 2; FdxCmdRxPortInit(g_ulPort2Handle, &x_PortInitIn, &x_PortInitOut); API-FDX Linux Getting Started Manual...
  • Page 34: Setting Up A Udp Port Oriented Transmitter

    Section 8 – Programming the API-FDX Module GmbH 8.1.5. Setting up a UDP Port oriented Transmitter void MyFdxSetupTxPort() TY_FDX_TX_MODE_CTRL x_TxModeCtrl; TY_FDX_TRANSMIT_VL x_TxVL; TY_FDX_UDP_DESCRIPTION x_UdpDesc; AiUInt32 ul_BytesWritten; Char pBuf[50]; Int uiBufLen; //--- Set Port Transmitt mode to: individual/UDP-Port oriented x_TxModeCtrl.ul_TransmitMode = FDX_TX_INDIVIDUAL; FdxCmdTxModeControl(g_ulPort1Handle, &x_TxModeCtrl);...
  • Page 35 Section 8 – Programming the API-FDX Module GmbH //Write message to UDP Port on Sub VL 2 if (g_Udp2Port1Handle != NULL) sprintf(pBuf, “Testing UDP Port on Sub VL 60 -- Sub VL 2”); uiBufLen = strlen(pBuf); FdxCmdTxUDPWrite(g_ulPort1Handle, g_Udp2Port1Handle, uiBufLen, (const void *) pBuf, &ul_BytesWritten) API-FDX Linux Getting Started Manual...
  • Page 36: Setting Up A Generic Transmitter Port

    Section 8 – Programming the API-FDX Module GmbH 8.1.6. Setting up a Generic Transmitter Port void MyFdxSetupTxPort() TY_FDX_TX_MODE_CTRL x_TxModeCtrl; TY_FDX_TX_QUEUE_SETUP x_TxQueueCreate; TY_FDX_TX_QUEUE_INFO x_TxQueueInfo; AiUInt8 Dt[100]; struct my_Frame_tag TY_FDX_TX_FRAME_HEADER x_Frame; AiUInt8 uc_Data[1000]; } My_Frame; int i; //--- mode control -> Set TX port to Generic mode x_TxModeCtrl.ul_TransmitMode = FDX_TX_GENERIC;...
  • Page 37 Section 8 – Programming the API-FDX Module GmbH //---IP Header Dt[14]=0x45;Dt[15]=0x00;Dt[16]=0x00;Dt[17]=0x2d;Dt[18]=0x00;Dt[19]=0x00 ;Dt[20]=0x40;Dt[21]=0x00;Dt[22]=0x01;Dt[23]=0x11;Dt[24]=0x6d;Dt[25]=0x5 //---IP Source Address 10.129.33.1 Dt[26]=0x0a;Dt[27]=0x81;Dt[28]=0x21;Dt[29]=0x01; //---IP Destination Address 224.224.0.60 (VL 60) Dt[30]=0xe0;Dt[31]=0xe0;Dt[32]=0x00;Dt[33]=0x3c; //---UDP Source Port = 24 Dt[34]=0x00;Dt[35]=0x18; //---UDP Dest Port = 23 Dt[36]=0x00;Dt[37]=0x17; //---UDP Length = 25 Dt[38]=0x00;Dt[39]=0x19;...
  • Page 38 Section 8 – Programming the API-FDX Module GmbH //---IP Source Address 10.129.33.1 Dt[26]=0x0a;Dt[27]=0x81;Dt[28]=0x21;Dt[29]=0x01; //---IP Destination Address 224.224.0.60 (VL 60) Dt[30]=0xe0;Dt[31]=0xe0;Dt[32]=0x00;Dt[33]=0x3c; //---UDP Source Port = 34 Dt[34]=0x00;Dt[35]=0x22; //---UDP Dest Port = 33 Dt[36]=0x00;Dt[37]=0x21; //---UDP Length = 25 Dt[38]=0x00;Dt[39]=0x19; //---UDP Checksum Dt[40]=0x00;Dt[41]=0x00; //---Payload Dt[42]=0x41;Dt[43]=0x42;Dt[44]=0x43;Dt[45]=0x44;Dt[46]=0x45;...
  • Page 39: Setting Up A Vl Oriented Receiver

    Section 8 – Programming the API-FDX Module GmbH 8.1.7. Setting up a VL oriented Receiver void MyFdxSetupRxPort() TY_FDX_RX_MODE_CTRL_IN x_ModeCtrlIn; TY_FDX_RX_MODE_CTRL_OUT x_ModeCtrlOut; TY_FDX_RX_VL_CTRL x_VLControl; TY_FDX_RX_VL_DESCRIPTION x_VLDesc; TY_FDX_UDP_DESCRIPTION x_UdpDesc; //--- Set AyI-FDX Port to VL-oriented mode x_ModeCtrlIn.ul_ReceiveMode = FDX_RX_VL; FdxCmdRxModeControl(g_ulPort2Handle, &x_ModeCtrlIn, &x_ModeCtrlOut); //--- Enable capturing for the VL of interest (VL 60) x_VLControl.ul_VLId = DEF_VL;...
  • Page 40: Setting Up A Chronological Monitor Receiver

    Section 8 – Programming the API-FDX Module GmbH 8.1.8. Setting up a Chronological Monitor Receiver void MyFdxSetupRxPort() TY_FDX_RX_MODE_CTRL_IN x_ModeCtrlIn; TY_FDX_RX_MODE_CTRL_OUT x_ModeCtrlOut; TY_FDX_MON_CAP_MODE x_MonCapMode; TY_FDX_MON_QUEUE_CTRL_IN x_QueueCtrlIn; TY_FDX_MON_QUEUE_CTRL_OUT x_QueueCtrlOut; //--- mode control -> select Chrono Mode x_ModeCtrlIn.ul_ReceiveMode = FDX_RX_CHRONO; x_ModeCtrlIn.ul_DefaultPayloadMode = FDX_PAYLOAD_FULL; x_ModeCtrlIn.ul_DefaultCronoMode = FDX_RX_DEFAULT_MON_ENA_ALL;...
  • Page 41: Starting The Transmitter And The Receiver

    Section 8 – Programming the API-FDX Module GmbH 8.1.9. Starting the Transmitter and the Receiver void MyFdxStart() TY_FDX_TX_CTRL x_TxControl; TY_FDX_RX_CTRL x_RxControl; //---Start the Receiver x_RxControl.ul_StartMode = FDX_START; x_RxControl.ul_GlobalStatisticReset = FDX_RX_GS_RES_ALL_CNT; FdxCmdRxControl(g_ulPort2Handle, &x_RxControl); //---Start the Transmitter x_TxControl.ul_Count = 0; x_TxControl.ul_StartMode = FDX_START; FdxCmdTxControl(g_ulPort1Handle, &x_TxControl);...
  • Page 42 Section 8 – Programming the API-FDX Module GmbH FdxCmdRxUDPDestroyPort(g_ulPort2Handle, g_pUdp1Port2Handle); if (g_pUdp2Port2Handle != NULL) FdxCmdRxUDPDestroyPort(g_ulPort2Handle, g_pUdp2Port2Handle); FdxLogout(g_ulPort2Handle); API-FDX Linux Getting Started Manual...
  • Page 43: Notes

    Section 9 – Notes GmbH 9. NOTES 9.1. Acronyms and Abbreviations AIM PCI I-Architecture AIM PMC Architecture ARINC Aeronautical Radio, Incorporated BIOS Basic Input Output System Board Support Package Compact Disk CPCI Compact PCI C (Language) Virtual Instrument Dynamic Link Library...
  • Page 44 Section 9 – Notes GmbH THIS PAGE INTENTIONALLY LEFT BLANK API-FDX Linux Getting Started Manual...
  • Page 45 Appendix A – Downloading the BSP from AIM-Online GmbH APPENDIX A. DOWNLOADING THE BSP FROM AIM-ONLINE The AIM-Online DOWNLOAD AREA consists of current manuals, BSPs, and documentation categorized by product. To obtain the API-FDX BSP from AIM-Online Go to http:\\www.aim-online.com The aim-online.com main web page appears.
  • Page 46 Appendix A – Downloading the BSP from AIM-Online GmbH To download the BSP Select the BSP Software button (with or without manuals) This brings up a File Download dialog box. Select the Save this Program to Disk option Choose the destination location, and start the file transfer.
  • Page 47 Appendix B – Cross-Compilation GmbH B. CROSS-COMPILATION When the BSP is installed, it is compiled for the host’s environment. But module, library and example programs can be manually cross-compiled by setting these few environment variables. KERNEL_DIR=/targets/tmp/linux-2.4.21-ppc/ export KERNEL_INC_PATH=${KERNEL_DIR}/include/ export EXTRA_CFLAGS="-DDONT_USE_HIGH_PERF_COUNTER" export EXTRA_KERNEL_CFLAGS=-I${KERNEL_DIR}/arch/ppc export MAKEFLAGS=LOCAL_LIBRARY=y •...
  • Page 48 Appendix B – Cross-Compilation GmbH THIS PAGE INTENTIONALLY LEFT BLANK API-FDX Linux Getting Started Manual...

Table of Contents