Lab: Implementing The Xilkernel On The Xilinx Spartan 3E Starter Kit
Lab: Implementing The Xilkernel On The Xilinx Spartan 3E Starter Kit
Lab: Implementing The Xilkernel On The Xilinx Spartan 3E Starter Kit
Contact Information:
Vincent Claes
claesvincent@gmail.com
http://www.linkedin.com/in/vincentclaes
Software Requirements:
Xilinx EDK 10.1 SP3
Xilinx EDK (SDK) 10.1 SP3
Hardware Requirements:
Xilinx Spartan3E Starter kit:
http://www.xilinx.com/products/devkits/HW-SPAR3E-SK-US-
G.htm
User manual:
www.xilinx.com/support/documentation/boards_and_kits/ug23
0.pdf
Getting Started
When you want to use this labs you have to setup your board.
This labs are written for the Xilinx SPARTAN3E Starter Kit so
it is quite interesting to read the user manual of the board.
Be sure to plug in the USB cable, plug in the Power cord and
Switch the board on before starting the lab.
Put in the “Project Name” box a name that you wish to give to
your project. Be sure you select the correct microblaze
instance for your project, normally there is only one if you
are working in a design with only one processor core. Leave
all the other options like they are presented to you and click
on the “Next” button.
Now you have generated a “New SDK project”. The first thing we
are going to do is setting all the “Software Platform
Settings” to the values we want. Remember we want to get a
xilkernel platform on the Xilinx Spartan 3E Starter board. So
for now select “Xilinx Tools” and “Software Platform Settings”
from the top-down menu.
//====================================================
static pthread_t newthread1; // an identifier for creating a new pthread
XGpio GpioOutput;
/* The driver instance for GPIO Device configured as O/P */
if (kill(mainproc_pid) != 0)
{
xil_printf("\r\n--- Error during kill operation...---\r\n");
}
Status = XGpio_Initialize(&GpioOutput,XPAR_LEDS_8BIT_BASEADDR);
XGpio_SetDataDirection(&GpioOutput,1,0x0);
while(1)
{
XGpio_DiscreteWrite(&GpioOutput,1,counter);
xil_printf("\r\n%d",counter);
sleep(5000); // This is why we need a software timer!
counter++;
}
while(1)
{
i++;
if(i==25)
// spawn the thread after some time
{
pthread_attr_init(&thread1attr);
newthreadsched.sched_priority = 1;
temp = pthread_create(&newthread1, &thread1attr,
(void*)launched_pthread, NULL);
// NULL: It's used if the thread function must take in an argument
}
}
}
Enjoy.
Vincent Claes
XIOS Hogeschool Limburg
Department of Industrial Sciences and Technology
Universitaire Campus - Agoralaan – Gebouw H
B-3590 Diepenbeek
Belgium
vincent.claes@xios.be
tel.: +32 11 26 00 39
fax: +32 11 26 00 54
mobile: +32 478 35 38 49