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.
Using the Software Development Kit It is time to start writing some small programs to be used in our simulations. We will use theSoftware Devlopment Kit (SDK) to help us out with this task. SDK was designed to facilitate the development of embedded software application projects. It has its own GUI and is based on the Eclipse open-source tool suite. SDK is a complementary program to XPS; that is, from SDK, you can develop the software that the peripherals and processor(s) elements connected in XPS use.
We will start by exporting our hardware design to the SDK tool suite. From the Project menu select <Export Hardware Design to SDK>.
Select a workspace.
SDK will start and display the start up screen.
The next time we start SDK we use the command: xsdk &
Writing our first c-program
Getting our first c-program written, compiled and executed in our simulation environment is a very simple task. Just follow these instructions:
1. From the File menu select <New->Xilinx C project>
Fill in a project name (gpio_register_rw) and select the Empty Application. We are going to write our first simple program from scratch.
2. Create a board support package (BSP).
3. Click Finish.
This is the result shown in the SDK Project Explorer. Select the src under gpio_register_rw
4. Create a new source file
From the SDK File menu select New->Source File. Enter the name of our c-program source file (main_gpio_register_rw.c) and click Finish.
5. Edit the file
Double-click the main_gpio_register_rw.c entry in the Project Explorer and start editing the file.
6. Generate a linker script
For our simple programs we are not going to use the default linker script provided by Xilinx, instead we are going to generate our own script. Right-click the entry the gpio_register_rw in the Project Explorer and select <Generate Linker Script>. This window will open. Make sure all code, data, heap and stack is placed in local memory (ilmb_cntrl_dlmb_ctrl) and save the settings.
To find the linker script settings, open the Project->Properties window and select Settings->Linker Script.
7. Compile the program.
From the SDK menus select Project->Build project. Here is a print out from the compilation run:
8. Here is the resulting file structure. We are all set.