How to set up hardware and software

Note: This HowTo is intended for students at the IAIK who have access to the actual SPARC/Ethernet MAC soft-core.

Setting up the necessary tools

First, get the LEOX toolbox from www.leox.org, page about Development Tools, section: "Development Tools: LEOX Cross Development Kit (CDK)". Follow the instructions for setup.

You will need the following tools from this toolbox:

Additionally you will need:

For running a compiled version of uClinux on the XSV800 board, you will just need the XSTOOLS and a terminal program. In this case, continue to read at chapter Connecting and configuring the XSV-board.

Compiling the uClinux port for LEON

Follow the instructions from www.leox.org, page about Software IPs, section: "Software IP: uClinux port". Compile the original uClinux as described.
If you are doing this for the first time, you might want to skip the rest of this section.

Then, apply the patches you need, run "make xconfig" again.

Kernel configuration:

Application configuration:

Don't forget to "make dep" after changing kernel settings.

Simulation

Note that it is not possible to simulate uClinux with the Ethernet MAC driver. This will result in an access violation when trying to access the Ethernet MAC's IO-ports.

For command line debugging:
tsim-leon -nfp -freq 25 -nov8 images/image.elf

For debugging with GUI:
sparc-elf-gdb images/image.elf &
tsim-leon -nfp -freq 25 -nov8 -gdb

For further information refer to: www.leox.org, page about Software IPs, section: "Software IP: uClinux port" (second part)

Connecting and configuring the XSV-board

If you use the board for the first time, follow the instructions of the chapter "Installation" in the XSV-board manual to test your board and to set the clock frequency to 25MHz.

To configure the programmable logic, you need to download the following three files in this sequence (necessary every time after power-up):

Windows: "gxsload"; Drag the files into CPLD/FPGA sections and press "load".
Linux: "xsload [-cpld|-fpga] <filename>"

The processor has two serial ports, one for UART A and one for the integrated debug support unit (DSU). Both ports are joined in the single serial connector on the XSV-board. Therefore you will need a split serial cable. Connect DSUMON output to ttyS0 (COM1) and UART A output to ttyS1 (COM2).

Pin assignment of the serial connector:

DescriptionPin on XSV-boardPin on COM1Pin on COM2
RXD122-
TXD133-
GND555
TXD27-2
RXD28-3

Use the following settings for minicom or hyperterminal:

To verify the FPGA and CPLD configuration and the terminal settings, press the reset button (SW1). The following prompt should appear:

LEON-1: 1*2048K 32-bit memory, rmw

>

Downloading and debugging Linux

There are several ways to download programs to the board:

Using DSUMON:

You can use DSUMON either with or without GDB.

DSUMON without GBD:

dsumon images/image.elf

This starts the download automatically. When it is complete, type "go" to run the program.

DSUMON with GDB:

sparc-elf-gdb images/image.elf &
dsumon -gdb

Insight needs the same Target Settings as for simulation with TSIM, except for the port number:

From the Run menu execute in this order: Download will take one or two minutes.
Debugging works the same way as with TSIM, but it is slower.

Without DSUMON (no debugging):

You need the kernel image in srec-format. To convert from elf to srec format, type:

sparc-elf-objcopy -O srec images/image.elf images/image.srec

Press reset (SW1) to get the prompt in your terminal window. Now simply download the image.srec file to the board in raw ASCII mode. After the download has finished, Linux boots automatically.
The disadvantage of this method is, that it is very slow, because the srec-file has a size of about 2 megabytes (when downloading with DSUMON, only 700k are transferred and the baud rate is higher).

© 2003, Michael Wurm. – Read about my other projects.