Software Development Guide 2.X
Edit this on GitLab
Using the NAI Software Support Kit 2.X
This guide will explain how to use the NAI Software Support Kit 2.X alongside other tools from NAI to develop your application.
NAI SSK 2.x is intended for use with boards such as: 68G6, 68ARM2, 68ARM4, 68INT6, NIU3A.
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 2018.2 Target
Required Tools
-
For UltraScale: Xilinx SDK 2018.2
-
For Zynq: Xilinx SDK 2017.2
-
NAI Library Package
-
Terminal Program (Teraterm)
Downloading Xilinx
-
Head to the Xilinx website archive section.
-
Click the 2018.2 tab to expand it (2017.2 for Zynq).
-
Select the All OS installer to begin download, then run the installer. The tool that will be used for development is Xilinx SDK 2018.2 (2017.2 for Zynq), which is included in the Vivado Design Suite installation.
PetaLinux 2023.2 Target
Required Tools
-
Vitis Classic 2023.2
-
NAI Library Package
-
Terminal Program (Teraterm)
Downloading Xilinx
-
Head to the Xilinx website archive section.
-
Click the 2023.2 tab to expand it.
-
Select the Windows Self Extracting Web Installer to begin download, then run the installer. The tool that will be used for development is Vitis Classic 2023.2, which is included in the Xilinx unified installation.
Linux Target
CMake
Using any web browser, navigate to https://cmake.org/files/v3.22 and download the “cmake-3.22.1-linux-x86_64.tar.gz” package.
VxWorks 7 Target
The NAI Software Support Kit currently supports the following versions of VxWorks 7:
-
SR660
-
22.09
-
23.03
-
23.09
-
24.03
The SSK is intended for use with the Wind River Workbench development environment. Please contact Wind River with any questions about obtaining a VxWorks license or installing Wind River Workbench.
Deos Target
Choose your favorite IDE to develop C programs with and open the Software Support Kit.
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.

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

-
Board
A board is a single board computer.
In this example we are using a board so we input B. We then selected the board we were using, a 75G5.
To connect you then must enter what ethernet protocol you are using, your type of ethernet port, and the IP address of the board.
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.
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.
As an example we then selected DT Set Lower Threshold Voltage and made our configuration change.
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.
![]()
![]()
| HDMI Connector | MIL Connector |
|---|
Note
The USB-A connector on the adapter board is not supported by the ARM target board.
Adapter Board
Serial Port
-
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'
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.
7. Select 'Modem and dialing' in the main configuration menu.
8. Every setting from A to H should be empty.
9. Select 'Exit' and then Power Cycle the board.
Ethernet Port
-
Connect the Ethernet port from target board and Host PC to a local network.
-
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:
-
Log in as a root user to the target board. The default password is root.
-
Display the MBCore version by typing:
naiMBEEPROMUtil version
-
The following information will display:
root@68arm2-bsp:~# naiMBEEPROMUtil version ===================== MBCore =================================================== ExecutionContext: Platform ARM-P0 ULTRASCALE+ Master Linux Application Built For Target: 68ARM2 Application Name: naiMBEEPROMUtil Application Revision: 1.0 Application Build DateTime: May 22 2025 10:26:58 MBCore-Lib Build Revision: 00004.00197 MBCore-Lib Build Date: May 22 2025 10:26:55 NAIBSP Lib Version: 2.23 --------------------------------------------------------------------------------
-
Then, display the contents of the motherboard EEPROM by typing:
naiMBEEPROMUtil formatteddisplay
-
The following or something similar (your model may vary) displays:
root@68arm2-bsp:~# naiMBEEPROMUtil formatteddisplay Displaying Motherboard EEPROM - Formatted - Start naibsp_dev_eeprom_Read() 128 bytes succeeded on A-cycle attempt# 1 naibsp_dev_eeprom_Read() 128 bytes succeeded on B-cycle attempt# 1 Displaying Motherboard EEPROM Data - Formatted 0000: MB Special Option Code :NONE: 000c: MBStartupInitOnlyFlag :0: 000e: ARM Processor Count :1: 0010: Product Serial No :0: 0014: Platform :68: 0018: Model :ARM: 001c: Generation :2: 0020: Processor Count :1: 0022: Ether Interface Count :2: 0024: Module Slot Count :3: 0026: ARMPlatform :Xilinx2: 0028: Eth-A MAC :aa:bb:cc:dd:ee:ff: 002e: Eth-A Misc Settings :StaticIP:enabled, AutoNeg:On, Speed:autoneg, Duplex:autoneg 0030: Eth-A Name :eth0: 0038: Eth-A IPv4Address :192.168.1.16: 003c: Eth-A IPv4SubnetMask :255.255.255.0: 0040: Eth-A IPv4Gateway :192.168.1.1: 0044: Eth-A IPv6Address :2002:c0a8:0101:0000:7c99:d118:9058:1235: 0054: Eth-A IPv6Prefix :64: 0058: Eth-B MAC :11:22:33:44:55:66: 005e: Eth-B Misc Settings :StaticIP:enabled, AutoNeg:Off, Speed:1000 Mbps, Duplex:?? 0060: Eth-B Name :eth1: 0068: Eth-B IPv4Address :192.168.2.16: 006c: Eth-B IPv4SubnetMask :255.255.255.0: 0070: Eth-B IPv4Gateway :192.168.2.1: 0074: Eth-B IPv6Address :2002:c0a8:0102:0000:7c99:d118:9058:1235: 0084: Eth-B IPv6Prefix :64: 0089: OpMode Listeners at Startup :0x0f: (TCP1-Yes, TCP2-Yes, UDP1-Yes, UDP2-Yes) 0094: OpMode TCP1 Port :52801: 0096: OpMode TCP2 Port :52802: 0098: OpMode UDP1 Port :52801: 009a: OpMode UDP2 Port :52802: 009c: ConfigMode TCP1 Command Port :52710: 009e: ConfigMode TCP1 File Port :52711: 00a0: ConfigMode TCP2 Command Port :52720: 00a2: ConfigMode TCP2 File Port :52721: 00a6: EthAEthB IPv4 Address Assignment Alg :0000: (EthA-00 - NONE) (EthB-00 - NONE) 00ac: MB EEPROM Schema Revision Major :4: 00ae: MB EEPROM Schema Revision Minor :4: 00c0: LabelSerialNo :N4315170005: 00d0: LabelPartNo :68ARM2-IO-C-B003: 00e8: LabellRevision :C6: 00ec: LabelDateCode :2425: 00fc: MB EEPROM CRC-32 :e8bb75be: Displaying Motherboard EEPROM - Formatted - End
As you can see, the current Eth-A IPv4Address prints as 192.168.1.16.
As you can see, the current Eth-B IPv4Address prints as 192.168.2.16.
To update the static IP addresses, enter the following commands (substitute your desired IP addresses):
root@68arm2-bsp:~# naiMBEEPROMUtil set EthA_IPv4Address 192.168.1.16 root@68arm2-bsp:~# naiMBEEPROMUtil set EthA_IPv4SubnetMask 255.255.255.0 root@68arm2-bsp:~# naiMBEEPROMUtil set EthB_IPv4Address 192.168.2.16 root@68arm2-bsp:~# naiMBEEPROMUtil set EthB_IPv4SubnetMask 255.255.255.0
The updated IP addresses will take effect on the next system reset.
CAUTION
The naiMBEEPROMUtil 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
PACKAGE LAYOUT
The NAI SSK contains NAI libraries and code to access all onboard and offboard modules. Inside, you’ll find a “base” folder, a “cmake” folder, and the root CMakeLists.txt file that’s used as the entry point for CMake to configure a build folder.
“base” Folder
The base folder contains the all the “C” source code for the SSK.
Project Name |
Description (Listed in order of recommended build order) |
nai_bsp |
Handles OS and processor specific routines, implements interface driver code. |
nai_libs |
Library routines used by user applications. |
nai_sample_apps |
Sample applications to demonstrate module functionality. |
“cmake” Folder
The “cmake” folder contains the toolchain file that will be used when generating the build folder with CMake.
CONFIGURING AND BUILDING THE SSK
Instructions
-
Open the root folder of the SSK in the terminal.
-
Run the following command with the necessary flags to generate the build folder in the specified location:
cmake [flags] -B [build_folder] --toolchain ./cmake/linux-x86-64.cmake
a. To generate a Release or Debug build, add the flag:
-DCMAKE_BUILD_TYPE=[Release|Debug]
b. To generate shared object (.so) or archive (.a) libraries, add the flag:
-DBUILD_SHARED_LIBS=[ON|OFF] -
Run the following command to compile the build:
cmake --build [build_folder] -j -
All compiled binaries and libraries will be found in [build_folder]/bin and [build_folder]/lib, respectively.
|
Note
|
In order to change any of the configured flags (switching between .so and .a or Release and Debug), you cannot reuse the same build folder. You must either delete the previously generated build folder or direct CMake to generate a new build folder in a different location. Only then should you rerun the CMake commands with the updated flags. |
Example
In this example, the SSK is extracted to “~/nai/ssk/” and the goal is to generate a static, debug build in the folder “build_debug_a”.
-
Run cd ~/nai/ssk/ to navigate to the root folder of the SSK.
-
To generate the build folder “build_debug_a” for a static, debug build, use the command:
cmake -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=Debug -B build_debug_a --toolchain ./cmake/linux-x86-64.cmake -
To compile this configuration, run the command:
cmake --build build_debug_a -j -
All compiled binaries and libraries will be found in build_debug_a/bin and build_debug_a/lib, respectively.
a. Truncated outputs of ls -l build_debug_a/bin and ls -l build_debug_a/lib
PetaLinux 2018.2
Importing and Building Sample Applications
-
Run Xilinx SDK 2018.2 and select the following folder from the NAI library package as your workspace:
-
PACKAGE_LOCATION\petalinux-2018-2\petalinux-appsrc
-
-
If there are already projects when you load the workspace, select them all, right click, and Delete them. Do NOT select "Delete project contents on disk".
-
Import NAI projects by selecting File→Import→Existing Projects into Workspace from the Xilinx SDK toolbar:
-
Select Next and then select the workspace directory as the root directory:
-
PACKAGE_LOCATION\petalinux-2018-2\petalinux-appsrc
-
-
Select finish to add NAI libraries and sample code projects to the workspace.
-
If you get this error, simply X it out and X out the Import window.
-
-
Your Project Explorer should now look similar to this:
-
Navigate to Project at the top of Xilinx and make sure Build automatically is unchecked.
-
Select Window→Preferences from the Xilinx toolbar and set the Indexer to "Use active build configuration" and select OK.
-
Select all of the projects, right click, click Build Configurations, Set Active, Debug-UltraScale/Zynq- (pick the configuration (Zynq/UltraScale) and the board you have, ex. NIU3A).
-
Select all of the library projects (nai_bsp projects, nai_libs projects, naiapp_common) and right click Clean Project then right click Build Project.
-
Select a module sample project to Clean then Build which will generate an elf executable that can be run on the processor board.
Creating a New Hello World Application
-
Navigate to File→New→Application Project to get to the New Project wizard and select Xilinx→Application Project.
-
Provide a name for the project, select linux as the OS Platform and select psu_cortexa53 as the processor type. Language should default to C and Compiler should default to 64-bit. Press next when complete.
-
Select the type of application template you’d like to start with and click Finish when complete.
-
A project with the name entered will appear in the project explorer, right click the project and build to generate the executable ELF file.
-
If your projects appear to successfully build but the Project Explorer still shows a red X on them, trying clicking Project→C/C++ Index→Rebuild to rebuild your projects.
Creating Projects from Scratch
-
Projects can be created with their source code and library includes manually created/linked. This can be hgelpful if a sample app is having issues and you want to go step by step to make sure nothing is wrong.
-
If you wish to create projects from scratch (starting from a blank slate, creating projects, and linking the source code manually) then navigate to File→Switch Workpsace and set the path to 'SSK_Template_FromScratch/Template-petalinux-2018-2/petalinux-appsrc'.
-
This directory is included with the package and has the same folder structure as the normal petalinux-2018-2 folder but the folders contain nothing so that projects can be made from a blank slate with nothing being detected by Xilinx.
|
Note
|
For Zynq, the workspace path would instead be "SSK_Template_FromScratch/Template-petalinux" and all subsequent path locations would follow this path rather than the aforementioned UltraScale one. |
Creating an NAI Library Project from Scratch
-
Navigate to File→New…→Project. Select Library Project under the Xilinx dropdown.
-
Create a project named nai_bsp-naibsp. Uncheck 'Use default location' and change the location to 'SSK_Template_FromScratch/Template-petalinux-2018-2\petalinux-appsrc\nai_bsp\naibsp'. Select the settings as shown in the screenshot and click Finish when done.
|
Note
|
If you use the Brose button to Brose to the location of 'SSK_Template_FromScratch' but can’t get to it because the C: drive doesn’t show up as an option to browse to, type 'C:\' into the Location text box and then press Brose again, and you should be able to Brose into the C: drive. |
-
Your workspace in the IDE should now have an 'nai_bsp-naibsp' project.
-
Click the arrow to expand the project, then right click on the src folder and click Delete. Press OK after it asks to confirm the deletion.
-
Right click the project and click Build Configurations→Manage…
-
Click New…
-
Add Debug-UltraScale-68ARM2 as the Name with the Existing configuration based on Debug then press OK.
|
Note
|
Replace UltraScale with Zynq if your board is Zynq, and replace 68ARM2 with the board you have, ex. NIU3A, 64ARM1. |
-
Click on this new configuration and click Set Active.
-
Right click on the project and select 'Properties'. Now, select 'Path and Symbols' and select the 'Includes' page. Click Add… and add the following directories. Press OK when done. If the program asks to rebuild then say no.
-
${workspace_loc}/../../base/
-
${workspace_loc}/../../base/nai_bsp
-
${workspace_loc}/../../base/nai_bsp/naibsp_config_68arm2_petalinux
-
|
Note
|
Replace the 68arm2 in the config folder with your board, ex. NIU3A, 64ARM1. |
-
Right-click on the project and select New→Folder.
-
Click Advanced to show more options then click 'Link to alternate location (Linked Folder)'. Write WORKSPACE_LOC\..\..\base\nai_bsp\naibsp as the folder location. Click Finish.
-
Add another folder with New→Folder. For the path write WORKSPACE_LOC\..\..\base\nai_bsp\naibsp_config_68arm2_petalinux as the folder location. Click Finish.
|
Note
|
Replace the 68arm2 in the config file with your board. |
-
Right click the project to Clean Project and then Build Project. The project should build and the progress will be displayed in the 'Console' tab. When finished, there will be a newly created 'Debug-Zynq/UltraScale-XXXXXX' folder with an archive file (static library) named 'libnai_bsp-naibsp.a'.
Adding Additional Library Projects
-
If other libraries are needed, then the steps are the same except for differences in names and paths. The following is a list of the different library paths, debug configurations, and folder paths.
|
Note
|
Replace UltraScale with Zynq if your configuration requires Zynq instead, and replace the 68ARM2 in the Debug Configuration with your board, ex. NIU3A, 64ARM1. |
-
nai_bsp
-
nai_bsp-naibsp (explained in the above tutorial)
-
nai_bsp-naibsp_sys
-
New→Project step
-
Name:nai_bsp-naibsp_sys
-
Path: 'PACKAGE_LOC\Template-petalinux-2018-2\petalinux-appsrc\nai_bsp\naibsp_sys'
-
-
Debug Configuration Name
-
Debug-UltraScale-68ARM2
-
-
New→Folder step
-
WORKSPACE_LOC\..\..\base\nai_bsp\naibsp_sys
-
-
-
nai_bsp-naibsp_sbit
-
New→Project
-
Name:nai_bsp-naibsp_sbit
-
Path: 'PACKAGE_LOC\Template-petalinux-2018-2\petalinux-appsrc\nai_bsp\naibsp_sbit'
-
-
Debug Configuration Name
-
Debug-UltraScale-68ARM2
-
-
New→Folder step
-
WORKSPACE_LOC\..\..\base\nai_bsp\naibsp_sbit
-
-
-
nai_bsp-naibsp_dev
-
New→Project
-
Name:nai_bsp-naibsp_dev
-
Path: 'PACKAGE_LOC\Template-petalinux-2018-2\petalinux-appsrc\nai_bsp\naibsp_dev'
-
-
Debug Configuration Name
-
Debug-UltraScale-68ARM2
-
-
New→Folder step
-
WORKSPACE_LOC\..\..\base\nai_bsp\naibsp_dev
-
-
-
-
nai_libs
-
nai_libs-naibrd
-
New→Project
-
Name:nai_libs-naibrd
-
Path: 'PACKAGE_LOC\Template-petalinux-2018-2\petalinux-appsrc\nai_libs\nai_libs-naibrd'
-
-
Debug Configuration Name
-
Debug-UltraScale-68ARM2
-
-
New→Folder step
-
WORKSPACE_LOC\..\..\base\nai_libs\naibrd\src
-
WORKSPACE_LOC\..\..\base\nai_libs\naibrd\include
-
-
-
nai_libs-naiether
-
New→Project
-
Name:nai_libs-naiether
-
Path: 'PACKAGE_LOC\Template-petalinux-2018-2\petalinux-appsrc\nai_libs\nai_libs-naiether'
-
-
Debug Configuration Name
-
Debug-UltraScale-68ARM2
-
-
New→Folder step
-
WORKSPACE_LOC\..\..\base\nai_libs\naiether\src
-
WORKSPACE_LOC\..\..\base\nai_libs\naiether\include
-
-
-
nai_libs-naiif
-
New→Project
-
Name:nai_libs-naiif
-
Path: 'PACKAGE_LOC\Template-petalinux-2018-2\petalinux-appsrc\nai_libs\nai_libs-naiif'
-
-
Debug Configuration Name
-
Debug-UltraScale-68ARM2
-
-
New→Folder step
-
WORKSPACE_LOC\..\..\base\nai_libs\naiif\src
-
WORKSPACE_LOC\..\..\base\nai_libs\naiif\include
-
-
-
nai_libs-nailib
-
New→Project
-
Name:nai_libs-nailib
-
Path: 'PACKAGE_LOC\Template-petalinux-2018-2\petalinux-appsrc\nai_libs\nai_libs-nailib'
-
-
Debug Configuration Name
-
Debug-UltraScale-68ARM2
-
-
New→Folder step
-
WORKSPACE_LOC\..\..\base\nai_libs\nailib\src
-
WORKSPACE_LOC\..\..\base\nai_libs\nailib\include
-
-
-
naiapp_common
-
New→Project
-
Name:naiapp_common
-
Path: 'PACKAGE_LOC\Template-petalinux-2018-2\petalinux-appsrc\nai_sample_apps\naiapp_common'
-
-
Debug Configuration Name
-
Debug-UltraScale-68ARM2
-
-
New→Folder step
-
WORKSPACE_LOC\..\..\base\nai_sample_apps\naiapp_common\src
-
WORKSPACE_LOC\..\..\base\nai_sample_apps\naiapp_common\include
-
-
-
Creating an NAI Sample Project from Scratch
-
All library projects must be created or imported as described previously in order for the sample apps to build.
-
Navigate to File→New→Application Project to get to the New Project wizard and select Xilinx→Application Project, then click Next.
-
Set the project name; in this example, we use naiapp_mod_ad_basic_ops.
-
Uncheck the use default location check box, and set the location to C:\SSK_Template_FromScratch\Template-petalinux-2018-2\petalinux-appsrc\nai_sample_apps\naiapp_src\board_modules\ad\ad_basic_ops
|
Note
|
For Zynq, the workspace path would instead be "SSK_Template_FromScratch/Template-petalinux", and all subsequent path locations would follow this path rather than the aforementioned UltraScale one. |
-
Change the OS Platform to linux and select psu_cortexa53 as the processor type. Language should default to C and Compiler should default to 64-bit. Press Next when complete.
-
Under "Available Templates", select the Linux Empty Application and click the Finish button.
-
The project "naiapp_mod_ad_basic_ops" should now be added to the Workspace and listed under the Project Explorer. Expand the "naiapp_mod_ad_basic_ops" project and "src" folder and right click the readme.txt file. Select Delete to remove the readme.txt file from the project. Press OK on the confirmation prompt.
-
Right click on the "naiapp_mod_ad_basic_ops" folder and select properties. Select C/C++ General Paths and Symbols and click the Manage Configurations button.
-
Click the New button to create a new Configuration.
-
Enter the name as "Debug-UltraScale-68ARM2" or "Debug-Zynq-68ARM2" with the Existing configuration set to Debug and click the OK button. Replace 68ARM2 with the board you want to use.
-
Select Debug-Zynq/UltraScale-XXXXX and click on the Set Active button to make it the active configuration and click OK to close the window.
-
In the Configuration drop down box, select the Debug-Zynq/UltraScale-XXXXX configuration if it’s not already selected.
-
If not already in the Properties window, right click the project and click Properties→C/C++ General→Paths and Symbols. Under the includes tab, add the following paths:
-
${workspace_loc}/../../base
-
${workspace_loc}/../../base/nai_bsp
-
${workspace_loc}/../../base/nai_bsp/naibsp_config_68arm2_petalinux
-
|
Note
|
Replace the 68arm2 in the config file with the board that you have. |
-
Under the Libraries tab click Add… and add the following (ORDER MATTERS):
-
m
-
pthread
-
naiapp_common
-
nai_libs-naibrd
-
nai_bsp-naibsp_sys
-
nai_libs-naiif
-
nai_libs-naiether
-
nai_libs-nailib
-
nai_bsp-naibsp
-
-
Under the Library Paths tab click Add…, add the following and check "Is a workspace path" (ORDER MATTERS):
|
Note
|
Replace UltraScale with Zynq if your configuration requires Zynq and 68ARM2 with your board, ex. NIU3A, 64ARM1 |
-
/nai_bsp-naibsp/Debug-UltraScale-68ARM2
-
/nai_bsp-naibsp_sys/Debug-UltraScale-68ARM2
-
/naiapp_common/Debug-UltraScale-68ARM2
-
/nai_libs-naibrd/Debug-UltraScale-68ARM2
-
/nai_libs-naiether/Debug-UltraScale-68ARM2
-
/nai_libs-naiif/Debug-UltraScale-68ARM2
-
/nai_libs-nailib/Debug-UltraScale-68ARM2
-
Click OK on the Properties window to save the settings.
-
In the Project Explorer, right click on the "naiapp_mod_ad_basic_ops" project and select Build Configurations→Set Active→Debug-Zynq/UltraScale-XXXXX.
-
To add the source file to the project, right click on the "src" folder inside the "naiapp_mod_ad_basic_ops" project folder, and select New File. Click the Advanced button followed by the Link to file in the file system check box.
-
Click the browse button and add the file path SSK_Template_FromScratch\base\nai_sample_apps\naiapp_src\board_modules\ad\ad_basic_ops\src\ad_basic_ops.c. Change the path to WORKSPACE_LOC\..\..\base\nai_sample_apps\naiapp_src\board_modules\ad\ad_basic_ops\src\ad_basic_ops.c if you want the path to be relative to the workspace location. Click the finish button to add the file to the project.
-
The project is now ready to build by right clicking the project and clicking Clean Project then right clicking and clicking Build Project. Once the build completes, an naiapp_mod_ad_basic_ops.elf file will be created in the Debug-UltraScale folder.
Adding Additional NAI Sample App Projects
-
The steps for adding new sample app projects from scratch are the same steps as stated above but the folder paths depend on the sample app.
-
The project will be created in a path that starts as SSK_Template_FromScratch\Template-petalinux-2018-2\petalinux-appsrc\nai_sample_apps-naiapp_src\board_modules. The next folder is the module family, followed by the name of the sample app (ex. ad for ad_basic_ops, dt for dt_basic_ops).
-
Some sample apps include a utils folder which will be seen within the module’s folder. To add these, you right click the project, click New→Folder→Advanced→Link to alternate location (Linked folder) and Browse… for it.
-
The source code will be in a path that starts as SSK_Template_FromScratch\base\nai_sample_apps\naiapp_src\board_modules, again followed by the module family, then a folder with the name of the sample app which contains the necessary .c file.
PetaLinux 2023.2
Importing and Building Sample Applications
-
Run Vitis Classic 2023.2 and select the following folder from the NAI library package as your workspace:
-
PACKAGE_LOCATION\petalinux-2023-2\petalinux-appsrc
-
-
If there are already projects when you load the workspace, select them all, right click, and select "Delete". Do NOT select "Delete project contents on disk".
-
Navigate to “Window”→”Preferences”. In the Preferences window, navigate to the “Additional”→”C/C++”→"Build"→“Environment” tab.
-
Create an environment variable named “BOARD” and set the value to the name of the board configuration you wish to build for (e.g. “CIU3”, “NIU3C”, etc.). Then select “Apply and Close”.
-
Import NAI projects by selecting “File” → “Import” → “Eclipse workspace or zip file” from the toolbar:
-
Select "Next" and then select the workspace directory as the root directory:
-
PACKAGE_LOCATION\petalinux-2023-2\petalinux-appsrc
-
-
Select "Finish" to add NAI libraries and sample code projects to the workspace.
-
Your Project Explorer should now look similar to this:
-
-
Select "Window"→"Preferences" from the Vitis toolbar and set the Indexer to "Use active build configuration" and select "OK".
-
Select "Window"→"Open Perspective" in the Vitis toolbar, and select "C/C++".
-
Select the projects that you wish to build, right click, click "Build Configurations"→"Set Active"→"Debug/Release" depending on the desired build type.
-
Select all the library projects (nai_bsp projects, nai_libs projects, naiapp_common), right click, and select "Clean Project". Then right click and select "Build Project".
-
Select a module sample project to Clean then Build which will generate an elf executable that can be run on the processor board.
Creating a New Hello World Application
-
Navigate to "File"→"New"→"Other" to get to the New Project wizard and select "C/C++"→"C Project".
-
Provide a name for the project, select "Vitis ARM v8 Linux Executable" under "Project type:" and "Vitis ARM v8 GNU/Linux/Toolchain" under "Toolchains". Then click "Finish" when complete.
-
A project with the name entered will appear in the project explorer, right click the project and select New→New Folder. Create a folder named "src" in the resulting window.
-
Right click the newly created folder, which should appear under the "helloworld" project. Select New→Source File. In the resulting window, select "Default C source template" and name the file "main.c".
-
Open the newly created source file from the project explorer. Inside the source file, add the following lines of code:
-
Right click the project and select build to generate the executable ELF file.
Creating Projects from Scratch
-
Projects can be created with their source code and library includes manually create/linked. This can be helpful if a sample app is having issues and you want to go step by step to make sure nothing is wrong.
-
If you wish to create projects from scratch (starting from a blank slate, creating projects, and linking the source code manually) then navigate to File→Switch Workspace and set the path to 'SSK_Template_FromScratch/Template-petalinux-2023-2/petalinux-appsrc'. This directory is included with the package and has the same folder structure as the normal petalinux-202302 folder, but the folders contain nothing so that projects can be made from a blank slate with nothing being detected by Vitis.
Creating an NAI Library Project from Scratch
-
If not done already, set an environment variable named BOARD to the name of the desired board configuration. Navigate to “Window”→”Preferences”. In the Preferences window, navigate to the “Additional”→”C/C++”→"Build"→“Environment” tab.
-
Create an environment variable named “BOARD” and set the value to the name of the board configuration you wish to build for (e.g. “CIU3”, “NIU3C”, etc.). Then select “Apply and Close”.
-
Navigate to File→New…→Other. Select C Project under the C/C++ dropdown.
-
Select Vitis ARM v8 Linux Executable under Project type. Name the project "nai_bsp-naibsp". Uncheck 'Use default location' and change the location to 'SSK_Template_FromScratch/Template-petalinux-2023-2\petalinux-appsrc\nai_bsp\naibsp'. Select the settings as shown in the screenshot and click Finish.
|
Note
|
If you use the Browse button to Browse to the location of 'SSK_Template_FromScratch' but can’t get to it because the C: drive doesn’t show up as an option to browse to, type 'C:\' into the Location text box and then press Browse again, and you should be able to Browse into the C: drive. |
-
Your workspace in the IDE should now have a project named "nai_bsp-naibsp".
-
Right click on the project and select 'Properties'. Now, select 'Paths and Symbols' and select the 'Includes' page. Click Add… and add the following directories. Press OK when done. If the program asks to rebuild then say no.
-
${workspace_loc}/../../base
-
${workspace_loc}/../../base/nai_bsp
-
${workspace_loc}/../../base/nai_bsp/naibsp_config_${BOARD}_petalinux
-
-
Right click on the project and select New→Folder.
-
Click Advanced to show more options then click "Link to alternate location (Linked Folder)". Write "WORKSPACE_LOC\..\..\base\nai_bsp\naibsp" as the folder location. Click Finish.
-
Right click the project to Clean Project and then Build Project. The project should build, and the progress will be displayed in the 'Console' tab. When finished, there will be a newly created 'Debug' folder with an archive (static library) named 'libnai_bsp-naibsp.a'.
Adding Additional Library Projects
-
If other libraries are needed, then the steps are the same except for differences in names and paths. The following is a list of the different library paths, debug configurations, and folder paths.
-
nai_bsp
-
nai_bsp-naibsp (explained in the above tutorial)
-
nai_bsp-naibsp_sys
-
New→Project step
-
Name:nai_bsp-naibsp_sys
-
Path: 'PACKAGE_LOC\Template-petalinux-2023-2\petalinux-appsrc\nai_bsp\naibsp_sys'
-
-
New→Folder step
-
WORKSPACE_LOC\..\..\base\nai_bsp\naibsp_sys
-
-
-
nai_bsp-naibsp_sbit
-
New→Project
-
Name:nai_bsp-naibsp_sbit
-
Path: 'PACKAGE_LOC\Template-petalinux-2023-2\petalinux-appsrc\nai_bsp\naibsp_sbit'
-
-
New→Folder step
-
WORKSPACE_LOC\..\..\base\nai_bsp\naibsp_sbit
-
-
-
nai_bsp-naibsp_dev
-
New→Project
-
Name:nai_bsp-naibsp_dev
-
Path: 'PACKAGE_LOC\Template-petalinux-2023-2\petalinux-appsrc\nai_bsp\naibsp_dev'
-
-
New→Folder step
-
WORKSPACE_LOC\..\..\base\nai_bsp\naibsp_dev
-
-
-
-
nai_libs
-
nai_libs-naibrd
-
New→Project
-
Name:nai_libs-naibrd
-
Path: 'PACKAGE_LOC\Template-petalinux-2023-2\petalinux-appsrc\nai_libs\nai_libs-naibrd'
-
-
New→Folder step
-
WORKSPACE_LOC\..\..\base\nai_libs\naibrd
-
-
-
nai_libs-naiether
-
New→Project
-
Name:nai_libs-naiether
-
Path: 'PACKAGE_LOC\Template-petalinux-2023-2\petalinux-appsrc\nai_libs\nai_libs-naiether'
-
-
New→Folder step
-
WORKSPACE_LOC\..\..\base\nai_libs\naiether
-
-
-
nai_libs-naiif
-
New→Project
-
Name:nai_libs-naiif
-
Path: 'PACKAGE_LOC\Template-petalinux-2023-2\petalinux-appsrc\nai_libs\nai_libs-naiif'
-
-
New→Folder step
-
WORKSPACE_LOC\..\..\base\nai_libs\naiif
-
-
-
nai_libs-nailib
-
New→Project
-
Name:nai_libs-nailib
-
Path: 'PACKAGE_LOC\Template-petalinux-2023-2\petalinux-appsrc\nai_libs\nai_libs-nailib'
-
-
New→Folder step
-
WORKSPACE_LOC\..\..\base\nai_libs\nailib
-
-
-
naiapp_common
-
New→Project
-
Name:naiapp_common
-
Path: 'PACKAGE_LOC\Template-petalinux-2023-2\petalinux-appsrc\nai_sample_apps\naiapp_common'
-
-
New→Folder step
-
WORKSPACE_LOC\..\..\base\nai_sample_apps\naiapp_common
-
-
-
Creating an NAI Sample Project from Scratch
-
All library projects must be created or imported as described previously for the sample apps to build.
-
Navigate to File→New→Other to get to the New Project wizard and select C/C++→C Project, then click Next.
-
Set the project name. In this example we use "naiapp_mod_ad_basic_ops".
-
Uncheck the "use default location" check box, and set the location to C:\SSK_Template_FromScratch\Template-petalinux-2023-2\petalinux-appsrc\nai_sample_apps\naiapp_src\board_modules\ad\ad_basic_ops.
-
Under "Project type", select "Vitis ARM v8 Linux Executable" and under "Toolchains", select "Vitis ARM v8 GNU/Linux Toolchain". Press "Finish" when complete.
-
Right click the project and click "Properties"→"C/C++ General"→"Paths and Symbols". Under the "Includes" tab, add the following paths:
-
${workspace_loc}/../../base
-
${workspace_loc}/../../base/nai_bsp
-
${workspace_loc}/../../base/nai_bsp/nai_bsp_config_${BOARD}_petalinux
-
-
Under the "Libraries" tab click "Add…" and add the following (ORDER MATTERS):
-
pthread
-
m
-
naiapp_common
-
nai_libs-naibrd
-
nai_bsp-naibsp_sys
-
nai_libs-naiif
-
nai_libs-naiether
-
nai_libs-nailib
-
nai_bsp-naibsp
-
-
Under the "Library Paths" tab click "Add…", then check "Is a workspace path", and add the following (ORDER MATTERS):
-
/nai_bsp-naibsp/${config_name:${ProjName}}
-
/nai_bsp-naibsp_sys/${config_name:${ProjName}}
-
/naiapp_common/${config_name:${ProjName}}
-
/nai_libs-naibrd/${config_name:${ProjName}}
-
/nai_libs-naiether/${config_name:${ProjName}}
-
/nai_libs-naiif/${config_name:${ProjName}}
-
/nai_libs-nailib/${config_name:${ProjName}}
-
-
Click "Apply" on the "Properties" window to save the settings.
-
In the Project Explorer, right click on the "naiapp_mod_ad_basic_ops" project and select "Build Configurations"→"Set Active"→"Debug".
-
To add the source files to the project, right click on the "naiapp_mod_ad_basic_ops" project folder and select "New"→"Folder". Click the "Advanced" button followed by the "Link to alternate location (Linked Folder)" check box.
-
Click the browse button and add the following folder path:
-
SSK_Template_FromScratch\base\nai_sample_apps\naiapp_src\board_modules\ad\ad_basic_ops
-
|
Note
|
Alternatively, enter "WORKSPACE_LOC\..\..\base\nai_sample_apps\naiapp_src\board_modules\ad\ad_basic_ops" if you want the path to be relative to the workspace location. |
-
Click the "Finish" button to add the file to the project.
-
Select "New Folder" again, and once again select "Advanced", followed by "Link to alternate location (Linked Folder)", and add the following foler path:
-
SSK_Template_FromScratch\base\nai_sample_apps\naiapp_src\board_modules\ad\ad_common_utils
-
|
Note
|
"WORKSPACE_LOC\..\..\base\nai_sample_apps\naiapp_src\board_modules\ad_ad_common_utils" if you want the path to be relative to the workspace location. |
-
Click the "Finish" button to add the file to the project.
-
The project is now ready to build. Right click the project and click Clean Project. Then right click the project again and select Build Project. Once the build is complete, a file named "naiapp_mod_ad_basic_ops.elf" will be created under the Debug folder.
Adding Additional NAI Sample Projects
-
The steps for adding new sample app projects from scratch are the same steps as stated above but the folder paths depend on the sample app.
-
The project will be created in a path that starts with 'SSK_Template_FromScratch\Template-petalinux-2023-2\petalinux-appsrc\nai_sample_apps\naiapp_src\board_modules'. The next folder is the module family followed by the name of the sample app (ex. ad\ad_basic_ops, dt\dt_basic_ops).
-
Some sample apps include a utils folder which will be seen within the module’s folder. To add these, you right click the project, click New→Folder→Advance>>→Link to alternate location (Linked folder) and Browse… for it.
-
The source code will be in a path that starts as 'SSK_Template_FromScratch\base\nai_sample_apps\naiapp_src\board_modules' with the next folder being the module family followed again by the name of the sample app, which contains the necessary .c file.
Debugging a Sample App on Vitis
-
We will be copying one of the built .elf sample apps to the target board’s home/root folder. You can do this in any preferred way, but the following steps shouw how to do it using Vitis.
-
Go to the "Remote System Explorer" perspective in the top right. If you don’t have this then in the top tab click "Window"→"Perspective"→"Open Perspective"→"Other" and double click "Remote System Explorer".
-
Right click the blank area and click "New"→"Connection…". There are several modes of connection. In this case, "SSH Only" with the IP address of the board is being used.
-
Navigate to Root/home/root. Enter the username "root" and the password "root". Right click the root and click "Export from Project".
-
In the "Remote file system" page, navigate to the sample app you want. On the left side click the dropdown arrow to expand it, then click the "Debug" folder. Then on the right, check the .elf file. When you are done, click Finish.
-
Run the sample app on Teraterm to make sure the app is working and to give execute permissions to it. You can also just use Teraterm as a simple way to use the program.
-
Navigate to /home/root/ on the terminal:
# cd /home/root/
-
Give Execute permission to the application:
# chmod 777 <Sample Application>
-
Execute program from Linux shell terminal:
# ./<Sample Application>
-
In Vitis with the sample app selected in the "Project Explorer", navigate to "Debug As"→"Debug Configurations…".
|
Note
|
The same steps work for "Run As"→"Run Configurations…" if you prefer to use Vitis to run the program. |
-
In the "Debug Configurations" window, double click "Target Communication Framework", select the new configuration, uncheck "Use local host as the target", click on the TCF Agent and click Apply.
-
Navigate to the "Application" tab. The local file path should be entered as "Debug/<sample_app>.elf". The remote file path should be filled in as "home/root/<sample_app.elf>". Click Debug when finished.
-
Vitis should ask to open the Debugger perspective.
VxWorks 7
|
Note
|
The following guide uses the NIU3A as an example. Replace NIU3A in the instructions with the name of your board where applicable, eg. 68ARM2. If you are using an Intel-based board, eg. 68INT6, please check your software package or contact NAI for alternative instructions. |
NIU3A BSP
This section will cover the installation of the NIU3A BSP and the creation of a VxWorks Source Build project.
Install NIU3A BSP
The first step in configuring the NAI VxWorks 7 BSP is to copy the BSP files to the appropriate directory. The supplied BSP folder is named naiNIU3A:
The base folder contains the NAI Library and its BSP files, along with the source of the samples for the NIU3A and its functions modules. The documentation folder contains the NAI Library documentation for each function call in the SSK.
Once the naiNIU3A BSP has been located, copy the folder in the following directory:
For VxWorks 7 SR660:
$(WIND_BASE)/pkgs_v2/os/board/xilinx/
For VxWorks 7 (22.09 - 24.03):
$(WIND_BASE)/source/os/arch/arm/board/Xilinx/
Create Source Code Build
Now with the NIU3A BSP source copied into the appropriate directory a VSB project can be created. Open Workbench and select File → New → Wind River Workbench Project. Under Built Type select VxWorks Source Build and click the Next> button.
|
Note
|
Screenshots may differ based on version of VxWorks/Workbench being used. |
Give the VxWorks Source Build project a name and click the Next> button.
In the next window, base the VSB on a VxWorks 7 board support package, and the BSP as naiNIU3A_1_0_0_0 as the fill in options. Click Link in sources to project check box if you want all VxWorks kernel source copied to your project. Click the Finish button to complete the project creation.
|
Note
|
Screenshots may differ based on version of VxWorks/Workbench being used. |
Once the Project Setup Window finishes creating the project (window closes), right click on VSB project and select Build Project.
Once the VSB has been built, projects for NAI BSP / NAI BRD, and VIP can be created.
PROJECT CREATION
In this section we will cover the creation of the VxWorks image project, and a downloadable kernel module project for the NAIBRD, NAI BSP and the sample applications. NAI BSP is a collection of drivers to interface to NAI hardware and VxWorks 7. In the BSP that was installed earlier is an archive of NAI BSP object code.
Create a VxWorks Image Project
Create new VxWorks image project by selecting File → New → Wind River Workbench Project. Under Build Type select VxWorks image project and click Next>.
|
Note
|
Screenshots may differ based on version of VxWorks/Workbench being used. |
Give VxWorks Image Project at name and click Next>.
Base the VxWorks Image Project on source build project you built earlier. Make sure BSP and source project name is correct, then click Next>.
|
Note
|
Screenshots may differ based on version of VxWorks/Workbench being used. |
It is recommended to use PROFILE_DEVELOPMENT when creating a project in a development phase. Click Finish to complete the project creation process.
|
Note
|
Screenshots may differ based on version of VxWorks/Workbench being used. |
VIP Kernel Configuration
After Workbench creates the VIP, double click Kernel Configuration in the project. For convenience under the Bundles tab there is NAI BSP default components.
Add the NAI BSP default components bundle to include the NAI BSP in entirety. Standalone kernel shell adds useful components for development as well.
|
Note
|
Screenshots may differ based on version of VxWorks/Workbench being used. |
At this point we need to create a DKM of NAIBRD and the NAI_BSP before continuing onto building the niu3aVip.
DKM For NAIBSP and NAIBRD
Create a Downloadable Kernel Module project by clicking on File → New → Wind River Workbench Project then click Next>.
Give project at name, then click Next>.
|
Note
|
Screenshots may differ based on version of VxWorks/Workbench being used. |
Base project on VxWorks image project (niu3aVip), click Finish.
Delete dkm.c that was automatically created and add the nai_bsp, nai_libs and nai_sample_apps folders (located in the base folder) into DKM project.
Right click on DKM project and select Rebuild Project. If this is the first time this project is built you will be prompted to Generate the include paths. Generate the includes by clicking the Generate Includes… button, followed by the Next> button.
To resolve include paths, add the following paths to the DKM project:
$(PRJ_ROOT_DIR)
$(PRJ_ROOT_DIR)/nai_bsp
$(PRJ_ROOT_DIR)/nai_bsp/naibsp_config_niu3a_vxworks7
|
Note
|
Screenshots may differ based on version of VxWorks/Workbench being used. |
Click Finish and build NAI BSP, NAI Library and samples (NAIBRD) DKM project.
Add NAI BSP Project to VIP
Now that the niu3a_bsp_brd project has been completed we will need to switch back to the niu3aVip project. Add the niu3a_bsp_brd project as a project reference to the niu3aVip by right clicking on niu3aVip project and selecting Properties. Next, select Project Reference and click on the check box for the niu3a_naibsp project. Click on Apply and Close.
|
Note
|
Screenshots may differ based on version of VxWorks/Workbench being used. |
Configure VIP Paths
In niu3aVip VxWorks Image Project right click on project, click Properties followed by Build Properties then select the Paths tab. Add the three paths below referencing the niu3a_bsp_brd project:
<PATH_TO_NIU3A_BSP_BRD_PROJECT >/nai_bsp/naibsp_config_niu3a_vxworks7
<PATH_TO_NIU3A_BSP_BRD_PROJECT>/nai_bsp
<PATH_TO_NIU3A_BSP_BRD_PROJECT>
|
Note
|
*replace <PATH_TO_NIU3A_BSP_BRD_PROJECT> with actual path to project. |
Click the Apply and Close button.
Right click on niu3aVip project and select Rebuild Project to build the kernel image. At this point the kernel image should be built successfully and is ready to be loaded onto the NIU3A.
BOOTING VXWORKS 7 KERNEL WITH UBOOT
This section will cover booting the newly created VxWorks image file over uboot. There are sections for loading the image via tftp, and from SATA on the NIU3A.
TFTP Booting VxWorks
Start a tftp server on host PC. For windows $(WIND_BASE)/host/x86-win32/bin/ tftpd32.exe and browse to directory that contains uVxWorks and naiNIU3A.dtb files.
|
Note
|
Screenshots may differ based on version of VxWorks/Workbench being used. |
Stop Uboot on the NIU3A by pressing the esc key. Once at the uboot prompt, modify the uboot environment variables to reflect your environment. The VxWorks kernel during boot up will read bootargs variable to get host, target, network mask, as well as username and password for FTP server running on host.
Uboot Environment variables:
ZynqMP> setenv ipaddr 192.168.1.16 ZynqMP> setenv netmask 255.255.255.0
ZynqMP> setenv serverip 192.168.1.5
ZynqMP> setenv vxargs setenv bootargs gem(0,0)host:vxWorks h=192.168.1.5 e=192.168.1.16:ffffff00 u=winner pw=winner f=0x00
ZynqMP> saveenv
To boot VxWorks kernel over network:
ZynqMP> tftpboot 0x05000000 uVxWorks
ZynqMP> tftpboot 0x04000000 naiNIU3A.dtb
ZynqMP> run R5fw && run load_cal && run bmargs && run vxargs
ZynqMP> bootm 0x05000000 - 0x04000000
To automate booting over the network:
ZynqMP> setenv vxBootTftp tftpboot 0x05000000 uVxWorks;tftpboot 0x04000000 naiNIU3A.dtb;bootm 0x05000000 - 0x04000000
ZynqMP> setenv load_fw_vx_tftp echo Loading VxWorks from TFTP… && run R5fw && run load_cal && run vxargs && run vxBootTftp
ZynqMP> setenv bootcmd run load_fw_vx_tftp
ZynqMP> saveenv
On next power cycle of target VxWorks should boot over network automatically.
Booting VxWorks from SATA
The NIU3A supports booting the VxWorks image directly from SATA. Uboot requires a tftp connection to the NIU3A in order to configure the NIU3A to boot a VxWorks image from SATA. Once a tftp connection has been established load the uVxWorks and nai68arm2.dtb file and boot VxWorks on the NIU3A. For more information on booting over tftp, see section “Error! Reference source not found.”.
Write a VxWorks image to SATA and boot image in UBoot
UBoot will need a FAT32 filesystem to boot a VxWorks kernel. After booting VxWorks over a network, retrieve the name of SATA device on the NIU3A, by entering the command 'devs'. In the example below, the SATA name is “/ata0a”.
→ devs
drv refs name
3 [ 3] /ata0a
9 [ 3] /host.host
0 [ 5] /null
1 [ 5] /ttyS0
2 [ 3] /vxbus
To write to the SATA on NIU3A, the SATA write protection must be disabled. Enter the following at the VxWorks command line: → naiSetSataWriteProtect 0
Then to format for FAT32:
→ dosFsVolFormat "/ata0a",0x20
Formatting /ata0a for DOSFS
Instantiating /ata0a as rawFs, device = 0x20001
Formatting…Retrieved old volume params with %100 confidence:
Volume Parameters: FAT type: FAT32, sectors per cluster 64
2 FAT copies, 0 clusters, 10069 sectors per FAT
Sectors reserved 32, hidden 63, FAT sectors 20138
Root dir entries 0, sysId (null), serial number c500000
Label:" " …
Disk with 82477647 sectors of 512 bytes will be formatted with:
Volume Parameters: FAT type: FAT32, sectors per cluster 64
2 FAT copies, 1288398 clusters, 10069 sectors per FAT
Sectors reserved 32, hidden 63, FAT sectors 20138
Root dir entries 0, sysId VX5DOS32, serial number c500000
Label:" " …
OK.
Once the SATA has been formatted copy your naiNIU3A.dtb and uVxWorks to the SATA drive
→ cp "naiNIU3A.dtb","/ata0a"
copying file naiNIU3A.dtb → /ata0a/ naiNIU#A.dtb
value = 0 = 0x0
→ cp "uVxWorks","/ata0a"
copying file uVxWorks → /ata0a/uVxWorks
Once the naiNIU3A.dtb and uVxWorks have been copied to SATA, the NIU3A can be power cycled to configure Uboot.
Stop Uboot on the NIU3A by pressing the Esc key. Once at the uboot prompt, modify the uboot environment variables to reflect your environment.
Uboot Environment variables:
U-Boot-PetaLinux> setenv ipaddr 192.168.1.16
U-Boot-PetaLinux> setenv netmask 255.255.255.0
U-Boot-PetaLinux> setenv serverip 192.168.1.5
U-Boot-PetaLinux> setenv vxargs “setenv bootargs gem(0,0)host:vxWorks h=192.168.1.5 e=192.168.1.16:ffffff00 u=winner pw=winner f=0x00”
U-Boot-PetaLinux> setenv bootcmd run vxBootCmdSata
U-Boot-PetaLinux> setenv dtbvipbootstart 4000000
U-Boot-PetaLinux> setenv vipbootstart 5000000
ZynqMP> setenv load_fw_vx_qspi “echo Loading VxWorks from SATA… && run R5fw && run load_cal && run vxargs && run vxBootSata”
U-Boot-PetaLinux> setenv vxBootSata “scsi scan && load scsi 0 $vipbootstart} uVxWorks && load scsi 0 ${dtbvipbootstart} naiNIU3A.dtb;bootm $vipbootstart} - ${dtbvipbootstart}”
U-Boot-PetaLinux> saveenv
On next power cycle of target VxWorks should boot from SATA automatically.
Deos
Building Deos BSP Package in OpenArbor
-
Launch OpenArbor
-
Select the deos/deos_kismet/nai-ultrascale directory in the location of the SSK
-
Once the workspace has been selected, the following projects should be made available to build in the DDCI-Project Window. (Projects may vary depending on system configuration)
-
Building the nai-ultrascale platform project will generate a composite.darc file which contains the kernel, configuration files and application code that will be loaded onto the target system
-
Refer to the file uboot_env_vars.md for U-Boot environment variables that need to be set to net-boot Deos on a given platform
Running Other Sample Applications in OpenArbor
-
By default, the only dependency that the nai-ultrascale platform project has is the Deos standard-apps which enable network connection to run tools like the Video Stream and Status Monitor. To run any of the included NAI sample applications, you can add the application as a dependency on the platform project. The Deos image needs to be rebuilt and reloaded.
-
Go to the platform project nai-ultrascale and navigate to Deos Component -> Dependencies. Right-click and select Add Dependency
-
Select the application you would like to integrate with the nai-ultrascale BSP
-
Build all projects
-
In the Target Manager add a connection for the nai-ultrascale platform project
-
Launch the Status Monitor or the Video Stream
-
Right-click the Status Monitor or Video Stream and click Update Target Load. Make sure End up in registry is set to platreg if that is where application dependency is. Make sure Force Cold Start is checked
-
Deos should now cold start and the new application should be running
-
Changing Board IP Address
-
Change the IP address in u-boot via the
ipaddrenvironment variable. Make sure to save the environment via thesaveenvcommand:setenv ipaddr 192.168.1.16 setenv serverip 192.168.1.100 saveenv-
OpenArbor stores information about the platform’s IP address in the lwip.config file.
-
-
Navigate to the platform project nai-ultrascale -> config -> lwip.config
-
Change the IP address on the following line:
interface=xilinx-gem:0 192.168.1.16 255.255.255.0-
More information can be found in the Deos NAI-UltraScale BSP User Guide.
-
Speeding Up the Platform Build
*To speed up builds and avoid building libraries that should not need to be modified during application development, we can follow a couple steps to point Open Arbor to the location of our built binaries.
-
Open OpenArbor and build all NAI libraries
-
Open a Windows PowerShell instance and run the script named release-me.ps1 with the following arguments
./release-me.ps1 -copyBinaries:$true-
This will copy the parts of the "desk tree" in the output directory to a common location that OpenArbor can be pointed to look at
-
-
In OpenArbor navigate to Window -> Preferences -> DDC-I -> Deos Search Path
-
Click 'Add'. Change Preference Scope to This Workspace Only and browse to the path that the Power Shell script created: /SSK/deos/deos_kismet/$NAI_Board_Name/built-binaries/desk
-
Hit OK
-
Now, if you would like to skip building the NAI libraries you can "Close Project" on any applicable libraries that have been copied. OpenArbor will check the search path to see if it has binaries for those libraries and use them instead
-
If you need to debug any NAI libraries or want to navigate source, open up the projects
-
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.