Xilinx Software Development Kit


2012-04-20Publicerad av Sven-Åke Andersson

Introduction


Xilinx SDK provides a graphical software development environment with comprehensive application edit, build, deploy and debug capabilities for bare-metal and operating system-based application development. Developers find Xilinx SDK to be both familiar and easy to use because it's built from the de facto standard Eclipse IDE, with additional embedded development plug-ins; open source build tools; and Xilinx-specific tools, capabilities, and source code libraries. Out of the box, SDK enables bare metal and Linux application development, and support for additional operating systems is available through the open source community and commercial RTOS providers.

Running SDK


We use the following command to start SDK: xsdk

 

Select workspace
 


 

SDK main window


 


 

Create a new software project
 

To create a new softare project in SDK, select from the File menu: New->Xilinx C Project. Before we can start our new project we have to import the xml file describing our hardware system.
 

Import the hardware platform


When we start a new project in SDK we have to import the hardware platform generated in XPS.
 







 

HelloWorld program


We will start out simple by compile and run the HelloWorld example program. In the New Project window we give the project a name and select the template Hello World.
 


We add a board support package (BSP).
 


 

 

Generate a linker script


To generate a linker script right-click HelloWorld and select <Generate Linker Script>. We choose to put all the code in the DDR3 memory.

 



 

Compile and build the application.

 


From the Project menu select Build Project.




 

Configure the FPGA


Click this button    to open the Program FPGA window.
 



 

Make sure we have the right bitstream and bd_bmm file and click Program.
 

 

Connecting a terminal


We begin by connecting our host computer to the UART port on the board using an USB cable and start the terminal program GTKterm. Find one error in this picture. The USB programming cable is missing.
 

 

Problems connecting the terminal


If this window popups when trying to connect to the terminal here is an easy fix.

 



Here is how the permissions are set for the /dev/ttyS0.
 



If we belong to the group dialout everything should work just fine. Let's fix that.
 



Logout and login again for the group change to take affect. Now it should work. We configure the serial port to match the uart interface on the board.

 


Loading and running a program


To load and run a program right-click the HelloWorld entry in Project Explorer and select Run As->Run Configuration. Select the Xilinx C/C++ ELF entry and click the New Configuration button to create a new configuration called HelloWorld Debug.

 


Click the RUN button to load and run the program. Here is the result.
 

 

One more example


Here is one more example called PrimeNumbers. The file ee_printf.c can be found here. This program calculates all prime numbers in the specified range.

 
 
Here is the result.


 


Nine months later


The SDK GUI has some small changes but the work flow is the same. Everything works fine until we run the PrimeNumber program. Then SDK crashes with the following error message:


Java lib Version   = RXTX-2.1-7
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x00007f1c3ad6a24d, pid=868, tid=139759173379840
#
# JRE version: 6.0_21-b06
# Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0-b16 mixed mode linux-amd64 )
# Problematic frame:
# C  [librxtxSerial.so+0x724d]  read_byte_array+0x3d
#
# An error report file with more information is saved as:
# /home/svenand/Projects/SP605_14.4/hs_err_pid868.log
#

The problem seems to be the library file librxtxSerial.so which is part of the Xilinx Eclips implementation. The file is found here: /opt/Xilinx/14.4/ISE_DS/EDK/eclipse/lin64/eclipse/plugins/gnu.io.rxtx.linux.x86_64_2.1.7.3_v20071015/os/linux/x86_64

Here is a solution found in the Xilinx Forum.