My name is Sven Andersson and I
work as a consultant in embedded
system design, implemented in ASIC
In my spare time I write this blog
and I hope it will inspire others to
learn more about this fantastic field.
I live in Stockholm Sweden and have
my own company
You are welcome to contact me
and ask questions or make comments
about my blog.
To start a software project in SDK, the hardware design information needs to be exported from XPS to SDK. Go to Project->Export Hardware Design to SDK.
Include the bitstream and BMM files and click Export Only.The exported files are located in the SDK/SDK_Export/hw directory inside the XPS project directory.
When finished we are ready to start SDK.
--> xsdk &
We will use the SDK directory as our workspace.
SDK will open and display the Welcome page.
To get help select Help->Help Content to display this page.
Before we start
We have to make sure gmake is installed. If we are using Ubuntu gmake is named make. Here is an easy fix, adding a soft link to the make program:
sudo ln -s /usr/bin/make /usr/bin/gmake
Starting a new C-project
Select File->New->Xilinx C Project to start. The first time we we start SDK after exporting our design, this window will be displayed. We have to move the hardware platform into the workspace.
We have to specify the path to the LX9_AXI_system.xml file in the SDK_Export/hw directory. Now we are ready to start our software project.
We will use one of the project templates available, the Peripheral Tests and create a board support package (BSP) called Standalone_BSP.
Click Finish. The application will start building and create an ELF file, which is the compiled application. The SDK Project Navigator shows all the files generated during this process.
The main source file is called testperiph.c and looks like this.
Generate a linker script
The system contains internal BRAM memory as well as external DDR memory. We can select where the code will be physically located through a linker script. Right-click on the peripheral_tests_0 project and select Generate Linker Script. We will put the application code in LPDDR memory.
Program the FPGA
When programming the FPGA the hardware will be constructed and the memories will be loaded with the boot loader and application code.
Click the Program FPGA button and specify the bitstream file (system.bit) and the block memory map file (system_bd.bmm). SDK automatically detects the processor in the system and shows them in a table at the bottom of the window. Under Software Configuration, select the executable (.elf) file to initialize at the reset start address for the processor. This is the program the processor will start executing when it comes out of reset. We will use BootLoop.
Click Program to start the FPGA programming. Here is the console output from this action. The data2mem program will build the complete programming file called download.bit which will be used to program the FPGA.
Setting up a run configuration
The FPGA is configured, the application program is loaded and we are ready to run. Right-click the Peripheral_test_0 entry in the Project Explorer and select Run As->Run Configuration. Select Xilinx C/C++ ELF and press the New button to create a run configuration of that type.
Select the STDIO Connection tab and mark the Connect STDIO to Console check box. Select port /dev/ttyUSB0 and leave the baud rate at 9600.
Click the RUN button to start program execution. Here is the printout on the console.
Congratulations!! We have our first program running.
I still i have a problem. When I do “Export hardware design to SDK with bitstream” and after this i did “Program FPGA” on SDK v13.2 for lwip application, I have my_project.bit files 333 KB and microblaze_0.elf 1KB. I am sure i couldn’t create the right download.bit file. Because these files are dummy files. What will be the problem? And also i have too many warnings on my generation bit file. ISE v13.2 Design Summary says that “No errors and 284 warnings” Is this can be the problem? My computer’s Operating System is Windows XP Pro 2002 with Service Pack 3.