Integrator Resources

The official home for NAI Support

Not sure where to start? Try Quick Start Guide or ask a question below!

Toggle Components with Visual Button
JavaScript Form Processing

Software Development Guide 1.X

Using the NAI Software Support Kit 1.X

This guide will explain how to use the NAI Software Support Kit 1.X alongside other tools from NAI to develop your application.

NAI SSK 1.x is intended for use with boards such as: 75G5, 68G5, 64G5, 68ARM1, 64ARM1, 75INT2, 79G5.

If you have not already NAI recommends using the NAI Embedded Soft Panel to kickstart development. Via a GUI it allows users to quickly configure and operate NAI products. The API Logger tool within the NAI Embedded Soft Panel will allow you to kickstart writing your program as it will record the API calls made as you use the GUI to configure and operate your hardware.

If you do not yet have your hardware you can still use the NAI Embedded Soft Panel to kickstart your development via the Demo Panel.

If you do not yet know details about your hardware and have already started using the NAI Embedded Soft Panel you can skip to Starting Development. If you want help setting up the environment you can simply pick your preferred OS and follow the corresponding instructions before continuing to Starting Development. The code you write will be fully portable.

To download the NAI Software Support Kit click here.

Environment Setup

These sections will explain how to setup your environment to begin development for your chosen OS. If you do not know what OS you will use yet simply pick your preferred OS, all written .c files will are fully portable.

PetaLinux 2014.2 Target - Windows Host

Development Environment Setup

Host PC

The recommended development platform is a PC with minimum 2GB RAM and 30GB hard drive space, and with Windows 7 or later.

Cross-Compiler

The ARM Linux Cross-Compiler package is available on Xilinx’s website. Download the software as follows:

  1. If you have not done so already, create a Xilinx account and make sure you are signed into it for the duration of the installation (you will need to be signed in to complete some parts of the installation).

  2. Navigate to https://www.xilinx.com/support/download/index.html/content/xilinx/en/downloadNav/vivado-design-tools/archive.html.

  3. Locate release 2014.2 and download “Vivado 2014.2 Full Image for Windows with SDK”.

nai_arm_linux_windows_pics/media/image10

  1. On the “Download Center” page that comes up, fill out all of the required fields and then press “Next”.

nai_arm_linux_windows_pics/media/image12

  1. In the window that pops up, select “Save File” and then click “OK” to save the file to the “Downloads” directory on your PC.

nai_arm_linux_windows_pics/media/image13

  1. Unzip the “Xilinx_Vivado_SDK_Win_2014.2_0612_1.tar.gz” file, which should now be found in the “Downloads” directory on your PC.

  2. Run xsetup.exe from the unzipped file folder.

nai_arm_linux_windows_pics/media/image14

  1. Click “Yes” when the User Account Control window pops up.

NOTE: The Vivado 2014.2 Installation menu will prompt you to install a newer version of Vivado SDK. DO NOT upgrade to the newer version of the SDK.

  1. If a window pops up that says it is checking for the latest version, click “Ignore”. If a window labelled “A Newer Version Is Available” pops up, click “Continue”.

nai_arm_linux_windows_pics/media/image15

  1. In the “Vivado 2014.2 Installer – Welcome” window, click “Next >”.

nai_arm_linux_windows_pics/media/image16

  1. In the “Accept License Agreements” window that pops up, check all of the “I Agree” check boxes and then click “Next >”.

nai_arm_linux_windows_pics/media/image17

  1. Select “Software Development Kit (Standalone)” edition to install. This package includes the Cross-Compiler and debugger for application development. Then click “Next >”.

nai_arm_linux_windows_pics/media/image18

  1. In the 1st and 2nd window, click “Next >”. In the 3rd window, click “Install”.

nai_arm_linux_windows_pics/media/image19

nai_arm_linux_windows_pics/media/image20

nai_arm_linux_windows_pics/media/image21

  1. After the installation is complete, if you do not already have a license file for the SDK on your computer, select “Get Free Licenses – Vivado WebPACK, SDK, free IP and more”. Then, click “Connect Now”.

NOTE: You don’t need to purchase a license for the Software Development Kit (Standalone).

nai_arm_linux_windows_pics/media/image22

  1. When you click “Connect Now”, you will be taken to the Xilinx website. If you are not signed in to your Xilinx account, sign in. If the Xilinx website asks you to fill out some personal information, fill it out. Then, you will be taken to the “Product Licensing” page. Select “Vivado Design Suite: HL WebPACK 2015 and Earlier License”, and then click “Generate Node-Locked License”.

nai_arm_linux_windows_pics/media/image23

  1. Click “Next”.

nai_arm_linux_windows_pics/media/image24

  1. Click “Next” again. The license file will now be emailed to the email account you specified when creating your Xilinx account. Copy the license file to your PC so that it can be detected when you run the SDK.

nai_arm_linux_windows_pics/media/image25

  1. Open Xilinx. You will be prompted to choose a workspace location. This will be where all the projects you create will be placed. There is no certain place where the workspace needs to be made; in this case, the workspace, called “Workspace,” is made in the C drive.

nai_arm_linux_windows_pics/media/image26

  1. Exit the “Welcome” tab that shows up by default.

nai_arm_linux_windows_pics/media/image27

Petalinux 2014.2 Target - Linux Host

Host PC

  • The recommended development platform is a PC with minimum 2GB RAM and 30GB hard drive space, and with Linux CentOS 64-bit v6.5 installed.

  • We have tested the application development environment with the above version of CentOS. Other versions of Linux may work as well but are not guaranteed.

CentOS

There are additional packages required to be installed after CentOS is installed on host PC. Type the following:

$ sudo yum install update

$ sudo yum groupinstall “Development Tools”

$ sudo yum install texi2html texinfo glibc-devel chrpath

$ sudo yum install glibc.i686 libgcc.i686 libstdc++.i686 glibc-devel.i686 ncurses-libs.i686 zlib.i686

Cross-Compiler

The current ARM target board is running on an XILINX® XC7Z015 SoC. The ARM Linux Cross-Compiler package is available on Xilinx’s website. Download the software as follows:

  1. Navigate to: https://www.xilinx.com/support/download.htmlhttps://www.xilinx.com/support/download/index.html/content/xilinx/en/downloadNav/vivado-design-tools.htmlhttps://www.xilinx.com/support/download/index.html/content/xilinx/en/downloadNav/vivado-design-tools.html

  2. Click on the “Embedded Development” tab.

  3. Click on “Archive” under “Version”.

  4. Select version “2017.2” under 2017. Under “Software Development Kit Standalone WebInstall Client”, download “SDK 2017.2 WebInstall for Linux 64”.

  5. You will be taken to a sign in page. If you have an account, sign in, otherwise click “Create your account.”

nai arm linux7
  1. Enter all required details and click “Create Account.”

nai arm linux8
  1. You will be e-mailed an activation message to your entered email address. Follow its instructions to activate your Xilinx account.

  2. Once your Xilinx account is created and activated, sign in. If necessary, go back to the Software Development download page and click “SDK 2017.2 WebInstall for Linux 64” once again.

  3. On the “Download Center” page that comes up, fill out all of the required fields and then press “Next”. The file should begin downloading.

P:\EMulle\xilinx2018install\windowsXilinxWebsiteSignIn.jpg
  1. Based upon the Firefox revision used, security errors may be encountered. If an error occurs, update the Firefox version installed by entering the following in the terminal, restarting the host PC, and retrying to install the SDK.

# sudo yum update firefox
  1. Go to the location the SDK file is downloaded to. Use the terminal as follows to allow the file to be executed, or right click the file, go to properties, then permissions, and check the “Allow executing file as program” box.

# cd <Directory of downloaded SDK file>

# chmod 777_ Xilinx_SDK_2017.2_0616_1_Lin64.bin
  1. Run Xilinx_SDK_2017.2_0616_1_Lin64.bin from the location it is downloaded to.

# ./Xilinx_SDK_2017.2_0616_1_Lin64.bin
Note
The Vivado 2017.2 Installation menu may prompt you to install a newer version of Vivado SDK. DO NOT upgrade to the newer version of the SDK.
  1. Click on “Next.”

P:\EMulle\Documentation\petaLinux\SSK\2017.2\welcomeScreen.jpg
  1. Enter your credentials to login and click Next.

P:\EMulle\Documentation\petaLinux\SSK\2017.2\loginScreen.jpg
  1. Check all of the “I Agree” boxes and click Next.

P:\EMulle\Documentation\petaLinux\SSK\2017.2\licenseAgreements.jpg
  1. Select “Xilinx Software Development Kit (XSDK)”.

P:\EMulle\Documentation\petaLinux\SSK\2017.2\editionSelect.jpg
Note
You don’t need to purchase a license for the Software Development Kit (Standalone).
  1. Leave the defaults checked and click Next. DocNav can be unchecked if not needed or disk space needs to be conserved.

P:\EMulle\Documentation\petaLinux\SSK\2017.2\installerScreen.jpg
  1. Choose your desired installation directory and click Next.

P:\EMulle\Documentation\petaLinux\SSK\2017.2\directorySelect.jpg
  1. Make sure all options chosen are correct and click Install.

P:\EMulle\Documentation\petaLinux\SSK\2017.2\installSummary.jpg
  1. Once the installation is complete, click “OK.”

P:\EMulle\Documentation\petaLinux\SSK\2017.2\installationComplete.jpg
Linux Target

Linux Library SSK 1.63 can be used with Intel-based NAI boards (eg. 75INT2) or NAI boards that live in the PCI slot of a Linux-based PC (eg. 79C3, 79G5). In both cases, the NAI Linux SSK was tested with CentOS 6.5. Other Linux distributions and kernel versions may function, but support is not guaranteed.

Choose your favorite IDE to develop C programs with and open the Software Support Kit.

VxWorks 6.9 Target

Configure the Board Library

Due to the portable nature of the NAI Software Support Kit some configuration is necessary to specify information about your target. If the information changes simply reconfigure the project, the code you have developed will be reuseable.

The NAI Board Software Support Kit (SSK) libraries need to be added to the VxWorks project and built for the SBC that they will be run on. There are three files that need to be modified before the project is built. Two of the files are located in the naibrd/include/advanced directory and one in the naibrd/src directory.

The file naibrd_config.h (located in naibrd\src) is used to determine how the NAI Board libraries will be configured. The files nai_pci_vxworks_adv.h and nai_vme_vxworks_adv.h (located in naibrd\include\advanced) determine how NAI Board will interface with the SBC hardware.

The following table shows which definitions need to be included or excluded for each of the NAI Single Board Computers currently available.

21
22

NAI 64PPC1 SBC Example of naibrd_config.h

/* Define if running on ARM Processor and a Xilinx FPGA (i.e. 64ARM1, 99ARM1, NIU1A) */
/* #define ARM_XILINX */
/* Define if running on PPC Processor and a Xilinx FPGA (i.e. 75PPC1, 64PPC1) */
#define PPC_XILINX
/* Define if running on Intel Processor and a Xilinx FPGA (i.e. 75INT2) */
/* #define INTEL_XILINX */
/* Define if running on PPC Processor and a Altera FPGA (i.e. legacy 75PPC1) */
/* #define PPC_ALTERA */
/* Define for Gen 5 processors */
#define NAI_GEN5_GENUSE_SIZE 0x4000u
#if defined(__VXWORKS__)
 #if defined(ARM_XILINX)
 #define GEN5_ARM
 #elif defined(INTEL_XILINX)
 #define GEN5_INTEL
 #elif defined(PPC_XILINX) || defined(PPC_ALTERA)
 #define GEN5_PPC
 #endif
#endif
#if defined(LINUX)
 #if defined(LINUX_ARM)
 #define GEN5_ARM
 #else
 #define GEN5_INTEL
 #endif
#endif
#if defined (WIN32) || defined(LINUX) || defined(__VXWORKS__) || defined(__INTEGRITY)
 /* Enables Ethernet communication support */
 #define NAI_USE_INTF_ETHER
#endif
#if defined (WIN32) || defined(LINUX) || defined(PROC_U2) || defined(__VXWORKS__) || defined(__INTEGRITY)
 /* Enables PCI/CPCI/PCI Express support */
 #define NAI_USE_INTF_PCI /* 75PPC1, 75INT2, 64PPC1 (on board has PCIe) */
 /* Enables VME support */
 #define NAI_USE_INTF_VME /* 64ARM1, 64PPC1 */
#endif

NAI 64PPC1 SBC Example of nai_pci_vxworks_adv.h

/*******************************************************************************************/
/* This section must be defined for the particular SBC that the Library will be running on */
/*******************************************************************************************/
#define NAI_BSP_NAI64PPC1
/* Only ONE of these definitions should be define
#define NAI_BSP_NAI75PPC1
#define NAI_BSP_NAI64PPC1
#define NAI_BSP_GE_SBC610
#define USER_BSP_PCI // Search for this value and add appropriate code for PCI/PCIe SBC being used
*/
#ifdef NAI_BSP_NAI75PPC1 /* NAI 75PPC1 SBC */
/*
* The NAI 75PPC1 only supports vxBus
* The NAI 75SBC4 does not have a rear connector
* PCI Interface but requires PCI be defined,
* so the NAI 75PPC1 setting are used.
*/
#define NAI_BSP_CPCI75PPC1
#define NAI_ENDIAN_SWAP /* PPC is Big Endian */
#define VXB_PCI_ENABLE /* VxBus PCI supported */
#define VXB_DEVICE_NAME "QorIQPciEx" /* VxBus Driver Name (from vxBusShow) */
#define NAI_SBC_DEVID 0x7584 /* Card PCI Device ID */
#endif
#ifdef NAI_BSP_NAI64PPC1 /* NAI 64PPC1 SBC */
/*
* The NAI 64PPC1 is a VME SBC but it uses PCIe
* for onboard access, so it requires PCI be defined.
*/
#define NAI_BSP_VME64PPC1
#define NAI_ENDIAN_SWAP /* PPC is Big Endian */
#define VXB_PCI_ENABLE /* VxBus PCI supported */
#define VXB_DEVICE_NAME "QorIQPciEx" /* VxBus Driver Name (from vxBusShow) */
#define NAI_SBC_DEVID 0x6484 /* Card PCI Device ID */
#endif
/*
* GE VPX SBC610 SBC
*/
#ifdef NAI_BSP_GE_SBC610
#define GE_BSP_SBC610
#define NAI_ENDIAN_SWAP
#define VXB_PCI_ENABLE
#define VXB_DEVICE_NAME "m85xxPci" /* VxBus Driver Name (from vxBusShow) */
#endif
/*
* USER PCI SBC
*/
#ifdef USER_BSP_PCI
#define USER_BSP_PCI_SBC /* SBC type/name */
#define NAI_ENDIAN_SWAP /* PPC is Big Endian, Intel & ARM is Little Endian */
#define VXB_PCI_ENABLE /* VxBus PCI supported */
#define VXB_DEVICE_NAME "xxxxxPci" /* VxBus Driver Name (from vxBusShow) */
#endif

NAI 64PPC1 SBC Example of nai_vme_vxworks_adv.h

/*******************************************************************************************/
/* This section must be defined for the particular SBC that the Library will be running on */
/*******************************************************************************************/
#define NAI_BSP_NAI64PPC1
/* Only ONE of these definitions should be define
#define NAI_BSP_NAI64PPC1
#define NAI_BSP_NAI64ARM1
#define MOT_BSP_MV6100
#define USER_BSP_VME // Search for this value and add appropriate code for VME SBC being used
*/
#ifdef NAI_BSP_NAI64PPC1 /* NAI VME 64PPC1 SBC */
/*
* The NAI 64PPC1 uses PCIe for onboard
*/
#define NAI_BSP_VME64PPC1
#define NAI_ENDIAN_SWAP /* PPC is Big Endian */
#define VXB_VME_ENABLE /* VxBus VME supported */
#define NAI_SBC_DEVID 0x6484 /* Card Device ID */
#endif
/*
* NAI VME 64ARM1 SBC
*/
#ifdef NAI_BSP_NAI64ARM1
#define NAI_BSP_VME64ARM1
// #define NAI_ENDIAN_SWAP /* ARM is Little Endian */
#define VXB_VME_ENABLE /* VxBus VME supported */
#define NAI_SBC_DEVID 0x6481 /* Card Device ID */
#endif
/*
* Motorola MV6100 SBC
*/
#ifdef MOT_BSP_MV6100
#define MOT_BSP_VME_MV6100
#define NAI_ENDIAN_SWAP
// #define VXB_VME_ENABLE /* VxBus VME supported */
#endif
/*
* USER VME SBC
*/
#ifdef USER_BSP_VME
#define USER_BSP_VME_SBC /* SBC type/name */
#define NAI_ENDIAN_SWAP /* PPC is Big Endian, Intel & ARM is Little Endian */
#define VXB_VME_ENABLE /* VxBus VME supported */
#endif

Non NAI Single Board Computer Software Modifications

PCI/CPCI/PCIe

If NAI Board is running on a non NAI SBC, there are a couple of files that will need to be modified for the libraries to work correctly. If the backplane interface is PCI, CPCI or PCIe, the files nai_pci_vxworks.h and nai_pci_vxworks.c will need to be modified.

At the top of the nai_pci_vxworks.h file the definition USER_BSP_PCI needs to be defined.

#define USER_BSP_PC1
/* Only ONE of these definitions should be define
#define NAI_BSP_NAI75PPC1
#define NAI_BSP_NAI64PPC1
#define NAI_BSP_GE_SBC610
#define USER_BSP_PCI // Search for this value and add appropriate code for PCI/PCIe SBC being used
*/

In the section where the USER_BSP_PCI definition are declared, the appropriate #defines will need to be included based on the SBC.

/*
* USER PCI SBC
*/
#ifdef USER_BSP_PCI
#define USER_BSP_PCI_SBC /* SBC type/name */
#define NAI_ENDIAN_SWAP /* PPC is Big Endian, Intel & ARM are Little Endian */
#define VXB_PCI_ENABLE /* VxBus PCI supported */
#define VXB_DEVICE_NAME "xxxxxPci" /* VxBus Driver Name (from vxBusShow) */
#endif

#define USER_BSP_PCI_SBC This can be left as is or can be renamed to better reflect the SBC type that the library is running on. If it is changed, a global search and replaced should be performed.

#define NAI_ENDIAN_SWAP This should be defined if the library is running on a Big Endian processor such as a PPC. If the library is running on a Little Endian processor such as an ARM or Intel, this should not be defined

#define VXB_PCI_ENABLE This should be defined if the library is running on a processor that has a vxBus driver for PCI/PCIe. If not, this should not be defined.

#define VXB_DEVICE_NAME " QorIQPciEx " If a vxBus driver is available, this should be updated to the appropriate driver name. The driver name can be obtained by running the vxBusShow command from the shell. Search the output for the PCI drive name.

-> vxBusShow
Registered Bus Types:
 USB-EHCI_Bus @ 0x0903b340
 USB-Host_Bus @ 0x003c74c4
 USB-HUB_Bus @ 0x003c74a8
 MII_Bus @ 0x003bfa64
 PCI_Bus @ 0x003bf6d4
 PLB_Bus @ 0x003bf6f0
Registered Device Drivers:
 vxbUsbBulkClass at 0x0903b480 on bus USB-HUB_Bus, funcs @ 0x003c748c
 vxbUsbHubClass at 0x003d36c0 on bus USB-HUB_Bus, funcs @ 0x003c748c
 :
 :
 QorIQQman at 0x003bebfc on bus PLB_Bus, funcs @ 0x003bebd8
 QorIQPciEx at 0x003be7d8 on bus PLB_Bus, funcs @ 0x003be75c
 QorIQBman at 0x003beac0 on bus PLB_Bus, funcs @ 0x003beaa4
 QorIQLaw at 0x003beb98 on bus PLB_Bus, funcs @ 0x003beb5c
 openPicTimer at 0x003bedf8 on bus PLB_Bus, funcs @ 0x003bedd4
 plbCtlr at 0x003bf718 on bus PLB_Bus, funcs @ 0x003bf70c
Busses and Devices Present:
 PLB_Bus @ 0x003db1b0 with bridge @ 0x003bf758
 Device Instances:
 ppcIntCtlr unit 0 on PLB_Bus @ 0x003dc170 with busInfo 0x00000000
 epic unit 0 on PLB_Bus @ 0x003dc270 with busInfo 0x00000000
 :
 :
 QorIQLaw unit 0 on PLB_Bus @ 0x003dcc70 with busInfo 0x0
 QorIQBman unit 0 on PLB_Bus @ 0x003dcd70 with busInfo 0x00000000
 QorIQQman unit 0 on PLB_Bus @ 0x003dce70 with busInfo 0x00000000
 QorIQFman unit 0 on PLB_Bus @ 0x003dcf70 with busInfo 0x00000000
 QorIQPciEx unit 0 on PLB_Bus @ 0x003dd070 with busInfo 0x00000000
 vxbPlbUsbEhci unit 1 on PLB_Bus @ 0x003ebc70 with busInfo 0x003ef270

nai_pci_vxworks.c Modifications In the file nai_pci_vxworks.c, there are two functions that will need to the modified. The first function is:

STATUS naiPciVxInstallISR(int32_t cardIndex, nai_isr_t isr, void* param)

This will need to be modified to install and enable an Interrupt Service Routine on your SBC. This can sometimes be very BSP specific and you may need to contact your SBC Vendor for help. You can use the code supplied for the NAI SBC as a starting point.

The second function is:

STATUS naiPciVxUninstallISR(int32_t cardIndex, nai_isr_t isr)

This will need to be modified to uninstall and disable an Interrupt Service Routine on your SBC. This can sometimes be very BSP specific and you may need to contact your SBC Vendor for help. You can use the code supplied for the NAI SBC as a starting point.

VME

If the backplane interface is VME, the files nai_vme_vxworks_adv.h and nai_vme_vxworks.c will need to be modified. At the top of the nai_vme_vxworks_adv.h file the definition USER_BSP_VME needs to be defined.

#define USER_BSP_VME
/* Only ONE of these definitions should be define
#define NAI_BSP_NAI64PPC1
#define NAI_BSP_NAI64ARM1
#define MOT_BSP_MV6100
#define USER_BSP_VME // Search for this value and add appropriate code for VME SBC being used
*/

In the section where the USER_BSP_VME definition are declared, the appropriate #defines will need to be included based on the SBC.

/*
* USER VME SBC
*/
#ifdef USER_BSP_VME
#define USER_BSP_VME_SBC /* SBC type/name */
#define NAI_ENDIAN_SWAP /* PPC is Big Endian, Intel & ARM are Little Endian */
#define VXB_VME_ENABLE /* VxBus VME supported */
#endif

#define USER_BSP_VME_SBC This can be left as is or can be renamed to better reflect the SBC type that the library is running on. If it is changed, a global search and replaced should be performed.

#define NAI_ENDIAN_SWAP This should be defined if the library is running on a Big Endian processor such as a PPC. If the library is running on a Little Endian processor such as an ARM or Intel, this should not be defined

#define VXB_VME_ENABLE This should be defined if the library is running on a processor that has a vxBus driver for VME. If not, this should not be defined.

nai_vme_vxworks.c Modifications

In the file nai_vme_vxworks.c, there are three functions that will need to the modified. The first function is:

STATUS naiVmeVxInstallISR(int32_t cardIndex, nai_isr_t isr, void* param)

This will need to be modified to install and enable an Interrupt Service Routine on your SBC. This can sometimes be very BSP specific and you may need to contact your SBC Vendor for help. You can use the code supplied for the NAI SBC as a starting point.

The second function is:

STATUS naiVmeVxUninstallISR(int32_t cardIndex, nai_isr_t isr)

This will need to be modified to uninstall and disable an Interrupt Service Routine on your SBC. This can sometimes be very BSP specific and you may need to contact your SBC Vendor for help. You can use the code supplied for the NAI SBC as a starting point.

The third function is:

nai_status_t naiVmeVxList(int32_t count, int32_t* numCardsFound, int32_t nSlot[],
 int8_t sCardName[][16], uint32_t unVmeStartAddr[], uint32_t unVmeEndAddr[],
 uint32_t unVmeAddrMod[])

This function is used to identify all of the cards on the VME bus. By default the information is read from the table naiSlvWindows[NAI_VME_MAX_SLOT] located at the top of the file. This table will need to be updated to reflect your system configuration.

A typical system configuration might look like the following:

/*
 * This table is used for non NAI SBCs to describe the system configuration
 * Enter information for each board in the chassis
 */
nai_slv_window_t naiSlvWindows[NAI_VME_MAX_SLOT] = {
 /* Slot Num Slot Occupied Card name AM Begin VME addr End VME addr */
 { 1, TRUE, "MV6100", 0xD, 0x00000000, 0x00800000-1},
 { 2, TRUE, "64C3", 0xD, 0x08200000, 0x08300000-1},
 { 3, TRUE, "64ARM1", 0xD, 0x09000000, 0x09800000-1},
 { 4, FALSE, "", 0xD, 0xFFFFFFFF, 0xFFFFFFFF},
 { 5, FALSE, "", 0xD, 0xFFFFFFFF, 0xFFFFFFFF},
 { 6, FALSE, "", 0xD, 0xFFFFFFFF, 0xFFFFFFFF},
 { 7, FALSE, "", 0xD, 0xFFFFFFFF, 0xFFFFFFFF},
 { 8, FALSE, "", 0xD, 0xFFFFFFFF, 0xFFFFFFFF},
 { 9, FALSE, "", 0xD, 0xFFFFFFFF, 0xFFFFFFFF},
 { 10, FALSE, "", 0xD, 0xFFFFFFFF, 0xFFFFFFFF},
 { 11, FALSE, "", 0xD, 0xFFFFFFFF, 0xFFFFFFFF},
 { 12, FALSE, "", 0xD, 0xFFFFFFFF, 0xFFFFFFFF},
 { 13, FALSE, "", 0xD, 0xFFFFFFFF, 0xFFFFFFFF},
 { 14, FALSE, "", 0xD, 0xFFFFFFFF, 0xFFFFFFFF},
 { 15, FALSE, "", 0xD, 0xFFFFFFFF, 0xFFFFFFFF},
 { 16, FALSE, "", 0xD, 0xFFFFFFFF, 0xFFFFFFFF},
 { 17, FALSE, "", 0xD, 0xFFFFFFFF, 0xFFFFFFFF},
 { 18, FALSE, "", 0xD, 0xFFFFFFFF, 0xFFFFFFFF},
 { 19, FALSE, "", 0xD, 0xFFFFFFFF, 0xFFFFFFFF},
 { 20, FALSE, "", 0xD, 0xFFFFFFFF, 0xFFFFFFFF},
 { 21, FALSE, "", 0xD, 0xFFFFFFFF, 0xFFFFFFFF}
};

Dual Port Ethernet Module

The EM1 Dual Port Ethernet Module is installed in module position 1 on the NAI PPC SBC card (i.e. 75PPC1). The Ethernet driver needs to be added to VxWorks for proper operation.

Adding EM1 Driver to the VxWorks Image

In Workbench, open the VxWorks Image Project for the processor, then open the Kernel Configuration tool.

23

Search for INCLUDE_GEI825XX_VXB_END

24

Include “INCLUDE_GEI825XX_VXB_END” in the configuration, and then rebuild the VxWork Image.

25

Load the new VxWorks Image on the processor. The two Ethernet port will now be available as gei0 and gei1.

Enabling the EM1 Ethernet Ports

To enable the Ethernet ports, the VxWorks commands ipAttach and ifconfig are used.

ipAttach (X,"gei") X = device (0 or 1) ifconfig ("geiX AAA.AAA.AAA.AAA netmask MMM. MMM. MMM. MMM up") X = device (0 or 1) AAA = IP Address MMM = subnet mask

-> ipAttach (0,"gei")
value = 0 = 0x0
-> ifconfig ("gei0 192.168.2.16 netmask 255.255.255.0 up")
value = 0 = 0x0
-> ipAttach (1,"gei")
value = 0 = 0x0
-> ifconfig ("gei1 10.0.8.123 netmask 255.0.0.0 up")
value = 0 = 0x0
-> ifconfig
lo0 Link type:Local loopback Queue:none
 inet 127.0.0.1 mask 255.255.255.255
 inet6 unicast fe80::1%lo0 prefixlen 64 automatic
 inet6 unicast ::1 prefixlen 128
 UP RUNNING LOOPBACK MULTICAST NOARP ALLMULTI
 MTU:1500 metric:1 VR:0 ifindex:1
 RX packets:3 mcast:3 errors:0 dropped:0
 TX packets:3 mcast:3 errors:0
 collisions:0 unsupported proto:0
 RX bytes:168 TX bytes:168

dtsec3 Link type:Ethernet HWaddr 00:16:c6:fe:dd:20 Queue:none
 inet 192.168.1.116 mask 255.255.255.0 broadcast 192.168.1.255
 inet6 unicast fe80::216:c6ff:fefe:dd20%dtsec3 prefixlen 64 automatic
 UP RUNNING SIMPLEX BROADCAST MULTICAST
 MTU:1500 metric:1 VR:0 ifindex:2
 RX packets:423 mcast:0 errors:0 dropped:0
 TX packets:149 mcast:8 errors:0
 collisions:0 unsupported proto:0
 RX bytes:28k TX bytes:9090

gei0 Link type:Ethernet HWaddr 00:a0:c9:00:00:02 Queue:none
 capabilities: TXCSUM TX6CSUM
 inet 192.168.2.16 mask 255.255.255.0 broadcast 192.168.2.255
 inet6 unicast fe80::2a0:c9ff:fe00:2%gei0 prefixlen 64 automatic
 UP RUNNING SIMPLEX BROADCAST MULTICAST
 MTU:1500 metric:1 VR:0 ifindex:3
 RX packets:294 mcast:0 errors:0 dropped:0
 TX packets:103 mcast:8 errors:0
 collisions:0 unsupported proto:0
 RX bytes:20k TX bytes:6330

gei1 Link type:Ethernet HWaddr 00:a0:c9:00:00:03 Queue:none
 capabilities: TXCSUM TX6CSUM
 inet 10.0.8.123 mask 255.0.0.0 broadcast 10.255.255.255
 inet6 unicast fe80::2a0:c9ff:fe00:3%gei1 prefixlen 64 tentative automatic
 UP SIMPLEX BROADCAST MULTICAST
 MTU:1500 metric:1 VR:0 ifindex:4
 RX packets:0 mcast:0 errors:0 dropped:0
 TX packets:0 mcast:0 errors:0
 collisions:0 unsupported proto:0
 RX bytes:0 TX bytes:0
value = 0 = 0x0
Windows Target

The NAI Windows Library Software Support Kit is originally built and tested in Visual Studio 2010. However, the SSK is also compatible with the SDK and toolset versions in Visual Studio 2012 and Visual Studio 2022.

Starting Development

If you have not already NAI recommends using the NAI Embedded Soft Panel to kickstart development. Via a GUI it allows users to quickly configure and operate NAI products. The API Logger tool within the NAI Embedded Soft Panel will allow you to kickstart writing your program as it will generate and save the API calls you make via the GUI as you configure and operate your hardware.

Now that your enviroment is set up and your project has been configured according to your hardware you can begin development. If you do not know yet what hardware you will be using you can begin development now and go through configuration later. The development process is universal for all configurations.

For development we will be using the NAI Software Support Kit.

NAI recommends that you begin with our selection of sample applications. The full collection can be found here.

First select a sample application from the family that you wish to develop for. For the sake of example we will use the discrete I/O family. The particular file we are using is DT_BasicOps.c

While the precise functionality is specific to the discrete I/O family, most sample applications use a similar structure.

For more generic board level functionality NAI offers guides on interrupts, watchdog timers, NAI ethernet protocols, BIT, multicore applications, and backplane reset.

Setup Menu

While reading this section please read along in the source code here at the same time to best understand how to then develop your own application.

Once you run the sample application you will be presented with a configuration menu. The first question will ask what your system is.

  • Nano

A Nano unit is a small, rugged multifunction I/O system.

nano NIU2A NIU1A

  • SIU

An SIU is a large rugged system containing multiple open backplane boards.

siu SIU34 SIU32S

  • Board

A board is a single board computer.

image1

In this example we are using a board so we input B. We then selected the board we were using, a 75G5.

image2

To connect you then must enter what ethernet protocol you are using, your type of ethernet port, and the IP address of the board.

image3

If all of the above information was correct you will then connect to the board and see the following configuration menu.

Please then select which module you would like to configure.

image4

We then selected which channel we would like configure and the following configuration menu opened, containing all of the settings to configure the module’s channel.

image5

As an example we then selected DT Set Lower Threshold Voltage and made our configuration change.

image6

With this sample application as the basis please refer to other sample applications for more information.

While this sample application was a configuration app there are also specific examples of how to use features of a given module.

For example if you want to implement ethernet IDR with discrete I/O NAI offers a corresponding sample application.

For more generic board level functionality NAI offers guides on interrupts, watchdog timers, NAI ethernet protocols, BIT, multicore applications, and backplane reset.

Once you have completed your application and want to test it it is time to build and export your program.

Connecting to the System

To learn how to get connected via the Software Support Kit please click here.

To set up a remote serial and ethernet connection please follow the following steps.

Remote Connection

The serial connection and Ethernet port are accessed through the HDMI connector on ARM target boards. For ruggedized ARM enclosures, both ports are routed to a MIL connector. You may need an external adapter board (see below) to convert the HDMI connector to a serial and Ethernet port.

CAUTION

Ensure that target board is powered off, until directed to power it on.

extracted-media/media/image1
extracted-media/media/image2
HDMI Connector MIL Connector
Note
The USB-A connector on the adapter board is not supported by the ARM target board.
extracted-media/media/image3

Adapter Board

Serial Port

  1. 1. Install minicom through the terminal:

$ sudo yum install minicom

2. Check for all available serial ports:

$ dmesg | grep tty

3. Run minicom with the desired serial port.

$ sudo minicom -s /dev/<Serial Port>

4. Select 'Serial port setup'

M:\untitled folder 2\figure1.png

5. Set Serial Device to the serial port name found by using the dmesg | grep tty command. Leave Calling Program and Callout Program empty. Set Bps/Par/Bits to 115200 8N1. Set Hardware Flow Control to 'No'. Set 'Software Flow Control to 'No'. Next to 'Change which setting?' type in the letter of the setting that will be altered. Press 'Enter' to exit 'Serial port settings'

6. Select 'Save setup as _dev_ttyUSB0' in the main configuration menu.

M:\untitled folder 2\figure2.png

7. Select 'Modem and dialing' in the main configuration menu.

8. Every setting from A to H should be empty.

M:\untitled folder 2\figure3.png

9. Select 'Exit' and then Power Cycle the board.

Ethernet Port

  1. Connect the Ethernet port from target board and Host PC to a local network.

  2. Open shell terminal on Host PC and type the following command:

ssh root@<IP address of the target board>
Note
The default IP address of the target board is available on the label or it can be obtained by running the ifconfig command from shell terminal.

Changing the Ethernet IP Addresses

The target board contains 2 Ethernet Interfaces. Each Ethernet Interface is assigned a unique MAC address and static IP address. The MAC addresses and static IP addresses are stored on the motherboard EEPROM. The static IP address can be changed using an EEPROM update utility provided with the unit. The MAC addresses should not be changed.

To access the EEPROM utility from the Linux shell terminal, proceed as follows:

  1. Log in as a root user to the target board. The default password is root.

  2. Display the contents of the motherboard EEPROM by typing:

mbeeprom_util display

  1. The following or something similar (your model may vary) displays:

root@nai-niu1a:~# mbeeprom_util display

NAI ARM-SOC Motherboard EEPROM Utility (mbeeprom_util)

Target Processor: Xilinx ARM

Target OS: PetaLinux

Build Revision: 3.32.3

Build Date: Oct 29 2014 08:26:22 UTC


Displaying Motherboard EEPROM - Start

00000000: 4E 4F 4E 45 :NONE:

00000004: 32 33 31 34 :2314:

00000008: 42 4F 4F 31 :BOO1:

0000000C: 00 00 00 00 ::

00000010: 04 00 00 00 ::

00000014: 00 00 00 00 ::

00000018: 4E 49 55 00 :NIU:

0000001C: 31 41 00 00 :1A:

00000020: 01 00 02 00 ::

00000024: 01 00 02 00 ::

00000028: AA BB CC DD :ª»ÌÝ:

0000002C: EE FF 00 00 :îÿ:

00000030: 65 74 68 30 :eth0:

00000034: 00 00 00 00 ::

00000038: C0 A8 01 10 :ˬ:

0000003C: FF FF FF 00 :ÿÿÿ:

00000040: C0 A8 01 01 :ˬ:

00000044: 20 02 C0 A8 : ˬ:

00000048: 01 01 00 00 ::

0000004C: 7C 99 D1 18 :\|Ñ:

00000050: 90 58 12 35 :X5:

00000054: 40 00 00 00 :@:

00000058: 11 22 33 44 :"3D:

0000005C: 55 66 00 00 :Uf:

00000060: 65 74 68 31 :eth1:

00000064: 00 00 00 00 ::

00000068: C0 A8 02 10 :ˬ:

0000006C: FF FF FF 00 :ÿÿÿ:

00000070: C0 A8 02 01 :ˬ:

00000074: 20 02 C0 A8 : ˬ:

00000078: 01 02 00 00 ::

0000007C: 7C 99 D1 18 :\|Ñ:

00000080: 90 58 12 35 :X5:

00000084: 30 00 00 00 :0:

00000088: 00 0F 00 00 ::

0000008C: 00 00 00 00 ::

00000090: 00 00 00 00 ::

00000094: 41 CE 42 CE :AÎBÎ:

00000098: 41 CE 42 CE :AÎBÎ:

0000009C: E6 CD E7 CD :æÍçÍ:

000000A0: F0 CD F1 CD :ðÍñÍ:

000000A4: 00 00 00 00 ::

000000A8: 00 00 00 00 ::

000000AC: 00 00 00 00 ::

000000B0: 00 00 00 00 ::

000000B4: 00 00 00 00 ::

000000B8: 00 00 00 00 ::

000000BC: 00 00 00 00 ::

000000C0: 00 00 00 00 ::

000000C4: 00 00 00 00 ::

000000C8: 00 00 00 00 ::

000000CC: 00 00 00 00 ::

000000D0: 00 00 00 00 ::

000000D4: 00 00 00 00 ::

000000D8: 00 00 00 00 ::

000000DC: 00 00 00 00 ::

000000E0: 00 00 00 00 ::

000000E4: 00 00 00 00 ::

000000E8: 00 00 00 00 ::

000000EC: 00 00 00 00 ::

000000F0: 00 00 00 00 ::

000000F4: 00 00 00 00 ::

000000F8: 00 00 00 00 ::

000000FC: 00 00 00 00 ::

Displaying Motherboard EEPROM – Start

The Eth-0 IP Address is stored at EEPROM address 00000038: C0 A8 01 10 (192.168.1.16)

The Eth-1 IP Address is stored at EEPROM address 00000068: C0 A8 02 10 (192.168.2.16)

To update the static IP addresses, enter the following commands (substitute your desired IP addresses):

root@nai-niu1a:~/NAII# mbeeprom_util set EthA_IPv4Address 192.168.1.16

root@nai-niu1a:~/NAII# mbeeprom_util set EthA_IPv4SubnetMask 255.255.255.0

root@nai-niu1a:~/NAII# mbeeprom_util set EthB_IPv4Address 192.168.2.16

root@nai-niu1a:~/NAII# mbeeprom_util set EthB_IPv4SubnetMask 255.255.255.0

The updated IP addresses will take effect on the next system reset.

CAUTION

The mbeeprom_util program will allow you to erase the entire contents of the EEPROM. DO NOT do this as it will erase important system parameters including the Ether Interface MAC addresses. The ARM board will not function without these settings.

DO NOT alter any of the other EEPROM fields as the ARM board will not function without the correct settings.

Building and Running a Project

Linux

Building NAI_SSK_LINUX ARM Library

NAI provides a pre-built library and source code. You can also rebuild the library on your Host PC.

Note
The Cross-Compiler and PATH must be configured on Host PC as detailed previously.
  1. Copy NAI SSK Library and Sample Application package to Host PC.

  2. Build NAI SSK Library on Host PC to generate a (libnaibrd.so) file as follows:

$ cd <directory of NAI SSK on host PC>/Libraries/naibrd

$ make clean NAI_TARGET_BOARD_TYPE=arm

$ make all NAI_TARGET_BOARD_TYPE=arm
  1. Verify the library ELF binary is an ARM version:

$ file libnaibrd.so

libnaibrd.so: ELF 32-bit LSB shared object, ARM, version 1 (SYSV), dynamically linked, not stripped
  1. Copy NAI library (.so) to <directory of NAI SSK on host PC >/Lib/Linux_ARM. NAI sample application MakeFile will link with the library (.so) file in /Lib/Linux_ARM folder.

Building an NAI Sample Application

NAI provides prebuilt sample application and source code. You can also rebuild the sample application on your host PC.

Prerequisite: Pre-built NAI SSK Library including the following:

  • <directory of NAI SSK on host PC>/Lib/Linux_ARM

  • <directory of NAI SSK on host PC>/include

Build the sample application as follows:

  1. Copy NAI SSK Library and Sample Application package to Host PC

  2. Build NAI SSK sample application on Host PC, the MakeFile will build all the sample applications in /AppSrc

$ cd <directory of NAI SSK on host PC>/AppSrc

$ make clean NAI_TARGET_BOARD_TYPE=arm

$ make all NAI_TARGET_BOARD_TYPE=arm

Running NAI Sample Application and NAI Library on the ARM Board

  1. Upload the NAI Library to /usr/lib in the target board from Host PC.

$ cd <directory of NAI SSK on host PC>/Lib/Linux_ARM

$ scp libnaibrd.so root@<IP address of target board>:/usr/lib
  1. To run NAI Sample Application on the target board, choose an executable ELF from <directory of NAI SSK on host PC>/App and upload to the target board as follows, then run it.

$ scp <directory of NAI SSK on host PC>/App/Linux_ARM/<sample app> root@<IP address of target board>:/var/ftp

$ ssh root@<IP address of target board>

# cd <directory of the sample app>

# ./<sample app>
PetaLinux 2014.2

Building the “Hello World” Application

Create simple HelloWorld.c file on the Host PC as follows:

  1. Navigate to File→New→Project→C/C++.

nai_arm_linux_windows_pics/media/image36

nai_arm_linux_windows_pics/media/image37

  1. Select “C Project” and click “Next >”.

nai_arm_linux_windows_pics/media/image38

  1. Select “Xilinx ARM Linux Executable” under “Project type:” and make sure “Xilinx ARM GNU/Linux Toolchain” is selected under “Toolchains:”. Also, set “Project name:” to “HelloWorld”. Then, click “Next >”.

nai_arm_linux_windows_pics/media/image39

  1. You will be asked to select project configurations. Selecting Debug means debugging and symbolic information is included. Selecting Release means the compiler will optimize the executable and strip it of debugging information. By default, both Debug and Release configurations are selected. You can leave the defaults and select <Finish>.

nai_arm_linux_windows_pics/media/image40

  1. Add the HelloWorld src file by right clicking on the HelloWorld project in the project explorer and then selecting New→File. This will cause the “New File” window to come up.

nai_arm_linux_windows_pics/media/image41

  1. Make sure that HelloWorld is selected as the parent folder. Then, enter HelloWorld.c as the File Name and click the “Finish” button.

nai_arm_linux_windows_pics/media/image42

  1. Type some code to execute in the HelloWorld.c file. Then, save the project and build it by clicking the hammer icon.

nai_arm_linux_windows_pics/media/image43

Running “Hello World” on the Target Board

An executable .elf file may be run from the board using either a Serial Console (Tera Term) or the Xilinx SDK.

  1. Copy the HelloWorld.elf executable file from your PC to the /home/root directory of the target board.

    1. In the Xilinx SDK, in the “Remote Systems” tab in the “Remote System Explorer” perspective, right-click “root” (<IP Address of target board>/Sftp Files/Root///home/root) and click “Export From Project…​”

nai_arm_linux_windows_pics/media/image44

  1. In the “Remote file system” window, in the left box, navigate to and select HelloWorld/Debug (but do not check either the “HelloWorld” or “Debug” folders, as this will copy over the entire folder). In the box on the right, select and check the check box next to “HelloWorld.elf”. Then, click “Finish”.

nai_arm_linux_windows_pics/media/image45

  1. Run HelloWorld.elf using either the Serial Console or the Xilinx SDK.

Running “Hello World” Via the Serial Console (Tera Term used in this example)

  1. Navigate to the /home/root directory of the target board using the serial console (Tera Term).

nai_arm_linux_windows_pics/media/image46

  1. While in this directory, type chmod 777 HelloWorld.elf to change the permission mode of HelloWorld.elf to executable.

  2. Stay in the /home/root directory and type ./HelloWorld.elf to run the program via the serial console.

nai_arm_linux_windows_pics/media/image47

Running “Hello World” via the Xilinx SDK

  1. In the Xilinx SDK, with “HelloWorld” selected in the Project Explorer, go to Run→Run Configurations…​

nai_arm_linux_windows_pics/media/image48

  1. In the “Run Configurations” window, double-click “Target Communication Framework”. This will create a new TCF run configuration for the HelloWorld project, called “HelloWorld Debug” by default.

nai_arm_linux_windows_pics/media/image49

  1. With the “HelloWorld Debug” configuration selected, under the “Target” tab, uncheck the check box labelled “Use local host as the target”. Then, in the “Available Targets:” list view, select the row saying “TCF Agent” in the “Name” column and lists the target board’s IP Address in the “Host” column. Then, verify that it says “TCP:<IP Address of target board>:<port number>” in the “Target ID:” text box. In this case, the IP Address is 192.168.1.16, and the port is 1534.

nai_arm_linux_windows_pics/media/image50

  1. Click the “Apply” button.

nai_arm_linux_windows_pics/media/image51

  1. Navigate to the “Application” tab.

nai_arm_linux_windows_pics/media/image52

  1. Fill in the text boxes highlighted in the picture. For the “Project Name:” text box, you can click the “Browse…​” button and select “HelloWorld” from the list of projects. Then, in the “Application” group box, next to the “Local File Path:” text box, you can click the “Search…​” button and select “HelloWorld.elf” from the pop up menu. Then, type “/home/root/HelloWorld.elf” into the “Remote File Path:” field.

nai_arm_linux_windows_pics/media/image53

  1. Click “Apply” to save all the changes you just made, and then click “Run” to run “HelloWorld” using the “HelloWorld Debug” run configuration.

nai_arm_linux_windows_pics/media/image54

Debugging “Hello World” via the Xilinx SDK

The process of Debugging a program via the Xilinx SDK is very similar to the process of Running a program via the Xilinx SDK.

  1. If it has not been done already, copy the HelloWorld.elf executable file from your PC to the /home/root directory of the target board. This can be done via the Xilinx SDK. See step 1 of “file:///C:\Users\apexlab\AppData\Local\Microsoft\Windows\Temporary%20Internet%20Files\Content.IE5\BG0WV69L\Hello_World#Running[Running “Hello World” on the Target Board]” for more details.

  2. If you have not done so already, create a run configuration for the HelloWorld project (see “file:///C:\Users\apexlab\AppData\Local\Microsoft\Windows\Temporary%20Internet%20Files\Content.IE5\BG0WV69L\Hello_World#Running[Running “Hello World” via the Xilinx SDK]”).

Note
The run configuration you just made for the HelloWorld project can also be used as a debug configuration.
  1. Navigate to Run→Debug Configurations…​

nai_arm_linux_windows_pics/media/image55

  1. In the “Debug Configurations” window, under “Target Communication Framework”, select “HelloWorld Debug” (the run configuration we created). The configuration properties you set up in Running “Hello World” via the Xilinx SDK should still be there.

nai_arm_linux_windows_pics/media/image56

nai_arm_linux_windows_pics/media/image57

  1. Click “Debug” to start debugging the HelloWorld project.

nai_arm_linux_windows_pics/media/image58

Building naibrd_SSK_Linux_ARM_Rev1.63 Library

NAI provides a pre-built library and source code. You can also rebuild the library on your Host PC.

Note
Cross-Compiler and PATH must be configured on Host PC. Refer to Step 18 of subsection Cross-Compiler of section Development Environment Setup for details.
Note
The latest version of Linux Library for ARM Processor SSK can be found at: http://www.naii.com/Downloads.
  1. Copy NAI SSK Library and Sample Application package to Host PC.

  2. Build NAI SSK Library on Host PC to generate a (libnaibrd.so) file as follows:

    1. Import <directory of naibrd_SSK_Linux_ARM_Rev1.63 on host PC>\Libraries\naibrd as a project.

  1. Click File→Import…​

nai_arm_linux_windows_pics/media/image59

  1. On the Import pop-up page, select the option “Existing Code as Makefile Project” under “C/C++” and then click the “Next >” button.

nai_arm_linux_windows_pics/media/image60

  1. Click “Browse…​” and navigate to <directory of naibrd_SSK_Linux_ARM_Rev1.63>\Libraries\naibrd. Once you navigate to this folder and click OK, the text box labelled “Project Name” will fill itself out with the name of the naibrd folder (which is “naibrd”).

  2. Select “Xilinx ARM GNU/Linux Toolchain” under “Toolchain for Indexer Settings”, and then click “Finish”.

nai_arm_linux_windows_pics/media/image61

  1. With naibrd Project selected in the Project Explorer, select Project→Properties→C/C++ Build→Environment, and click the “Add…​” button.

nai_arm_linux_windows_pics/media/image62

nai_arm_linux_windows_pics/media/image63

  1. Enter a new environment variable with Name = NAI_TARGET_BOARD_TYPE and Value = arm, and click “OK” button.

nai_arm_linux_windows_pics/media/image64

  1. Click Apply Button

nai_arm_linux_windows_pics/media/image65

  1. To Clean and Build the naibrd project, right-click on “naibrd” in the Project Explorer and click “Clean Project”. Then, with “naibrd” selected in the Project Explorer, either click the hammer icon at the top of the page or right-click on “naibrd” in the Project Explorer and click “Build Project”.

nai_arm_linux_windows_pics/media/image66

  1. Copy NAI library (libnaibrd.so) from <directory of naibrd_SSK_Linux_ARM_Rev1.63 on host PC>/Libraries/naibrd to <directory of naibrd_SSK_Linux_ARM_Rev1.63 on host PC >/Lib/Linux_ARM.

Copy from here

nai_arm_linux_windows_pics/media/image68

Copy to here

nai_arm_linux_windows_pics/media/image70

Note
NAI sample application MakeFile will link with the library (.so) file in /Lib/Linux_ARM folder. Ensure the latest library file is in that folder.
  1. Build NAI SSK Library on Host PC to generate a (libnaiapp_common.so) file as follows:

    1. Import <directory of naibrd_SSK_Linux_ARM_Rev1.63 on host PC>\AppSrc\naiapp_common as a project.

  1. Click File→Import…​

nai_arm_linux_windows_pics/media/image59

  1. On the Import pop-up page, select the option “Existing Code as Makefile Project” under “C/C++” and then click the “Next >” button.

nai_arm_linux_windows_pics/media/image60

  1. Click “Browse…​” and navigate to <directory of naibrd_SSK_Linux_ARM_Rev1.63>\AppSrc\ naiapp_common. Once you navigate to this folder and click OK, the text box labelled “Project Name” will fill itself out with the name of the naiapp_common folder (which is “naiapp_common”).

  2. Select “Xilinx ARM GNU/Linux Toolchain” under “Toolchain for Indexer Settings”, and then click “Finish”.

nai_arm_linux_windows_pics/media/image71

  1. With naiapp_common Project selected in the Project Explorer, select Project→Properties→C/C++ Build→Environment, and click the “Add…​” button.

nai_arm_linux_windows_pics/media/image72

nai_arm_linux_windows_pics/media/image73

  1. Enter a new environment variable with Name = NAI_TARGET_BOARD_TYPE and Value = arm, and click “OK” button.

nai_arm_linux_windows_pics/media/image74

  1. Click Apply Button

nai_arm_linux_windows_pics/media/image75

  1. To Clean and Build the naiapp_common project, right-click on “naiapp_common” in the Project Explorer and click “Clean Project”. Then, with “naiapp_common” selected in the Project Explorer, either click the hammer icon at the top of the page or right-click on “naiapp_common” in the Project Explorer and click “Build Project”.

nai_arm_linux_windows_pics/media/image76

  1. Copy NAI library (libnaiapp_common.so) from <directory of naibrd_SSK_Linux_ARM_Rev1.63 on host PC>/AppSrc/naiapp_common to <directory of naibrd_SSK_Linux_ARM_Rev1.63 on host PC >/Lib/Linux_ARM.

Copy from here

nai_arm_linux_windows_pics/media/image77

Copy to here

nai_arm_linux_windows_pics/media/image78

Building an NAI Sample Application

NAI provides prebuilt sample applications and source code. You can also rebuild the sample applications on your host PC.

Note
Cross-Compiler and PATH must be configured on Host PC. Refer to Step 18 of subsection Cross-Compiler of section Development Environment Setup for details.

Prerequisite: Pre-built naibrd_SSK_Linux_ARM_Rev1.63 Library including the following:

  • <directory of naibrd_SSK_Linux_ARM_Rev1.63 on host PC>\Lib\Linux_ARM

  • <directory of naibrd_SSK_Linux_ARM_Rev1.63 on host PC>\include

  1. Copy naibrd_SSK_Linux_ARM_Rev1.63 Library and Sample Application package to Host PC.

  2. Import <directory of naibrd_SSK_Linux_ARM_Rev1.63 on host PC>\AppSrc into the Xilinx SDK.

    1. Click File→Import…​

nai_arm_linux_windows_pics/media/image79

  1. On the Import pop-up page, select the option “Existing Code as Makefile Project” under “C/C++” and then click the “Next >” button.

nai_arm_linux_windows_pics/media/image80

  1. Click “Browse…​” and navigate to <directory of naibrd_SSK_Linux_ARM_Rev1.63>\AppSrc. Once you navigate to this folder and click OK, the text box labelled “Project Name” will fill itself out with the name of the AppSrc folder (which is “AppSrc”).

  2. Select “Xilinx ARM GNU/Linux Toolchain” under “Toolchain for Indexer Settings”, and then click “Finish”.

nai_arm_linux_windows_pics/media/image81

  1. With AppSrc Project selected in the Project Explorer, select Project→Properties→C/C++ Build→Environment, and click the “Add…​” button.

nai_arm_linux_windows_pics/media/image82

nai_arm_linux_windows_pics/media/image83

  1. Enter a new environment variable with Name = NAI_TARGET_BOARD_TYPE and Value = arm, and then click “OK”.

nai_arm_linux_windows_pics/media/image84

  1. Hit “Apply” button

nai_arm_linux_windows_pics/media/image85

  1. To Clean and Build the “AppSrc” project, right-click on “AppSrc” in the Project Explorer and click “Clean Project”. Then, with the “AppSrc” project selected in the Project Explorer, either click the hammer icon at the top of the page or right-click on “AppSrc” in the Project Explorer and click “Build Project”.

nai_arm_linux_windows_pics/media/image86

Running NAI Sample Application on Target Board

  1. Copy naibrd_SSK_Linux_ARM_Rev1.63 to host pc if you have not done so already.

  2. Upload the NAI Library (libnaibrd.so) to /usr/lib on the target board from Host PC.

Note
You can do this in the Xilinx SDK. The libnaibrd.so file should be in <directory of naibrd_SSK_Linux_ARM_Rev1.63 on host PC>\Lib\Linux_ARM, and also in <directory of naibrd_SSK_Linux_ARM_Rev1.63 on host PC>\Libraries\naibrd.
  1. Go to the “Remote Systems” tab in the “Remote System Explorer” perspective, right-click “lib” (<IP Address of target board>/Sftp Files/Root///usr/lib), and click “Export From Project…​”.

nai_arm_linux_windows_pics/media/image88

  1. In the “Remote file system” tab, select the “naibrd” folder (but do not check it). Then, within that folder, select “libnaibrd.so” and check the check box next to it. Then, click “Finish".

nai_arm_linux_windows_pics/media/image89

  1. Upload the NAI Common Library (libnaiapp_common.so) to /usr/lib on the target board from Host PC.

Note
You can do this in the Xilinx SDK. The libnaiapp_common.so file should be in <directory of naibrd_SSK_Linux_ARM_Rev1.63 on host PC>\Lib\Linux_ARM, and also in <directory of naibrd_SSK_Linux_ARM_Rev1.63 on host PC>\AppSrc\naiapp_common.
  1. Go to the “Remote Systems” tab in the “Remote System Explorer” perspective, right-click “lib” (<IP Address of target board>/Sftp Files/Root///usr/lib), and click “Export From Project…​”.

nai_arm_linux_windows_pics/media/image88

  1. In the “Remote file system” tab, select the “naiapp_common” folder (but do not check it). Then, within that folder, select “libnaiapp_common.so” and check the check box next to it. Then, click “Finish”.

nai_arm_linux_windows_pics/media/image91

  1. Choose an executable ELF from <directory of naibrd_SSK_Linux_ARM_Rev1.63 on host PC>\AppSrc and upload it to /home/root/ on the target board.

  1. In the “Remote Systems” tab, right-click “root” (<IP Address of target board>/Sftp Files/Root///home/root) and click “Export From Project…​”

nai_arm_linux_windows_pics/media/image93

  1. In the “Remote file system” window, select “AppSrc” in the left box (but do not check it), and then select and check the check box next to the project you want to run from the board (in this case, “TTL_BasicOps”). Then, click “Finish”.

nai_arm_linux_windows_pics/media/image95

  1. Run the sample application executable ELF file using either the Serial Console or the Xilinx SDK.

Running NAI Sample Application on Target Board Using Serial Console (Tera Term)

  1. Navigate to /home/root/ on the Linux shell terminal. (See picture below Step 3)

# cd /home/root/

  1. Give Execute permission to application: (See picture below Step 3)

# chmod 777 <Sample Application> (e.g. chmod 777 TTL_BasicOps)

  1. Execute program from Linux shell terminal (See picture)

# ./<Sample Application> (e.g. # ./TTL_BasicOps )

nai_arm_linux_windows_pics/media/image96

Running NAI Sample Application on Target Board Using Xilinx SDK

  1. We must create a Run Configuration for the sample program we just copied to the board. With the AppSrc project selected in the Project Explorer, go to Run→Run Configurations…​

nai_arm_linux_windows_pics/media/image97

  1. In the “Run Configurations” window, double-click “Target Communication Framework”. This will create a new Run Configuration for the AppSrc project, called “AppSrc Default” by default.

nai_arm_linux_windows_pics/media/image98

  1. With the “AppSrc Default” configuration selected, under the “Target” tab, uncheck the check box labelled “Use local host as the target”. Then, in the “Available Targets:” list view, select the selection that says “TCF Agent” in the “Name” column and lists the target board’s IP Address in the “Host” column. Then, verify that it says “TCP:<IP Address of target board>:<port number>” in the “Target ID:” text box. In this case, the IP Address is 192.168.1.16, and the port is 1534.

nai_arm_linux_windows_pics/media/image99

  1. Click the “Apply” button.

nai_arm_linux_windows_pics/media/image100

  1. Navigate to the “Application” tab.

nai_arm_linux_windows_pics/media/image101

  1. Fill in the text boxes highlighted in the picture. For the “Project Name:” text box, you can click the “Browse…​” button and select “AppSrc” from the list of projects. Then, in the “Application” group box, next to the “Local File Path:” text box, you can click the “Search…​” button and select the sample application you want to run from the pop up menu (in this case, TTL_BasicOps). Then, type “/home/root/<name of sample application you want to run>” into the “Remote File Path:” field.

nai_arm_linux_windows_pics/media/image102

  1. In the Serial Console (Tera Term), navigate to the /home/root directory of the target board and type “chmod 777 <name of sample application in /home/root to run>” (ex. chmod 777 TTL_BasicOps) to give the sample application permission to run.

nai_arm_linux_windows_pics/media/image103

  1. Click “Apply” to save all the changes you just made, and then click “Run” to run the program on the target board using the SDK.

nai_arm_linux_windows_pics/media/image104

Debugging NAI Sample Application on Target Board Using Xilinx SDK

The process of Debugging a program via the Xilinx SDK is very similar to the process of Running a program via the Xilinx SDK.

  1. If it has not been done already, copy the naibrd library and naiapp library .so files (libnaibrd.so & libnaiapp_common.so) from your PC to the /usr/lib directory of the target board. This can be done via the Xilinx SDK. See step 2 of “Running NAI Sample Application on Target Board” for more details.

  2. If it has not been done already, copy the sample program executable ELF file you want to run on the board from your PC to the /home/root directory of the target board. This can be done via the Xilinx SDK. See step 3 of “Running NAI Sample Application on Target Board” for more details.

  3. If you have not done so already, create a run configuration for the sample application you want to run on the board, and use the serial console to get permission to run the sample application executable file you copied from your PC to the /home/root directory of the target board (see ”Running NAI Sample Application on Target Board Using Xilinx SDK”).

Note
The run configuration you just made for the HelloWorld project can also be used as a debug configuration.
  1. With “AppSrc” selected in the Project Explorer, navigate to Run→Debug Configurations…​

nai_arm_linux_windows_pics/media/image105

  1. In the “Debug Configurations” window, under “Target Communication Framework”, select “AppSrc Default” (the run configuration we created). The configuration properties you set for “AppSrc Default” in “Running NAI Sample Application on Target Board Using Xilinx SDK” should still be there.

nai_arm_linux_windows_pics/media/image106

nai_arm_linux_windows_pics/media/image107

  1. Click “Debug” to start debugging the sample application.

nai_arm_linux_windows_pics/media/image108

Windows

The NAI Windows SSK contains a Visual Studio Solution file in the \AppSrc directory named naibrd_AppSrc.sln. Open this file in Visual Studio, and the project window will be occupied by all NAI sample applications and libraries. Right-click on an application folder of your choice and select Build. The sample is now ready to be run by targeting your NAI board over ethernet.

VxWorks 6.9

Creating a Project in Workbench

  • This sample project is being built for a NAI 64PPC1 SBC, it will also work for other NAI PPC based SBCs. To build the project for an ARM processor SBC such as the NAI 64ARM1, some of the build parameters will be different and they will be noted where applicable.

  1. Once Workbench has started, create a new project by selecting the menu option “File”, “New”, “Project”. In the New Project window, expand the VxWorks6.x line by clicking the arrow (►) and select “VxWorks Downloadable Kernel Module Project”. Click the Next button.

1
  1. Enter a name for the project, for this sample we will use NAI_Board_Sample_Project.

2
  1. Click the “Next” button until you get to the “Build Specs” window. Click “Deselect All”, then scroll down the list of available build specs and select “PPC32diab” (“ARMARCH7diab” for an ARM processor) for single core. To build for SMP select “PPC32diab_SMP” (“ARMARCH7diab_SMP” for an ARM processor). Click “Finish”.

3
  • The project will now appear in the Project Explorer window of Workbench.

4

Importing NAI Board SSK Files into a Project

  1. To import the SSK files into the project, right click on the NAI_Board_Sample_Program entry in the Project Explorer window, and then select “Import”. In the Import Window, select “General”, “File System”, then click “Next”.

5
  1. Navigate to NAI Board SSK directory (CDROM). From the base directory, select the naibrd and AppSrc sub directories. This will include the Library and sample programs in the project. Click the “Finish” button.

6
  • The NAI Board library and Sample Source files are now included in the project.

7
  1. You will need to configure the NAI Board Library for the Single Board Computer that it will be running on. To do this, refer to Configure the Board Library in the VxWorks Target tab of Environment Setup.

Building a Project

  1. To build the project, select on the menu, “Project”, “Build Project”. The first time the project is built, the include paths will need to be generated. Workbench will automatically add the paths for you, click the “Generate Includes…​” button.

8
  1. When the “Analyses Include directives” windows appears, click “Next”

9
  1. When the “Resolve include directives” window appears, click “Resolve All”.

10
  1. If the “Resolve Ambiguous Include Directives” appears, click “OK”.

11
  1. The include paths will be added to the project.

12
  1. Click the “Next” button.

13
  1. Verify that the “PPC32diab” (“ARMARCH7diab” for an ARM processor) build spec is selected and click “Finish”. The project is now ready to be built. From the menu select “Project”, Build Project”, the project will be built and a NAI_Board_SampleProject.out file will be created.

14
15

Creating a Target Remote Server

  • A target server connection is needed to download and debug your application program.

  1. From the menu select “Target”, “New Connection. Highlight “Wind River VxWorks 6.x Target Server Connection”, and then click Next.

16
  1. Enter the IP address of the SBC and the location of the VxWorks Image that was downloaded to the SBC.

17
  1. Click the next button until you get to the Connection Summary window. Enter a Connection name for your target server and click finished.

18
  1. Your new Target Server connection will appear in the Remote System tab in your Workbench project. Highlight the server, right click and select “Connect”

19

Downloading Application to the Single Board Computer (SBC)

  • The Sample application file can now be downloaded and run on the processor.

  1. From the Menu select “Run”,”Download”,”Download”,”VxWorks Kernal Task”

20
  1. Select “NAI_Board_Sample_Sample_Project.out”, the appropriate target processor, and click “Download”. You can now run any of the provided sample applications from the Shell.

Running from the System

If you do not want to use your host pc terminal and would like to run an application you have loaded onto your single board computer, NAI SIU, or NAI NIU follow this guide.

Help Bot

X