Get readout box up and running

From ift
Revision as of 10:09, 3 February 2012 by Sya081 (talk | contribs)

Overview

Hardware requirements

  • Focal read-out box
  • Linux computer with Gb network capability for data taking
  • Windows PC for software/firmware debugging
  • One or more patch panels PCBs
  • One or more flex PCBs with mounted MIMOSA ASICs


Software requirements and drivers

  • Xilinx Lab tools v13.2, including XMD, iMPACT and ChipScope
  • Serial console software like PuTTY
  • TFTP server for Linux kernel downloading

Configure the FPGA(s)

Using XMD

XMD can be called from SDK or a normal cmd command window, we need to set up the path environment firstly with the settings32.bat(settings64.bat for a 64 bit PC) file from the Xilinx software installation directory like "D:\Xilinx\13.2\ISE_DS\settings32.bat", copy it to your work directory where firmware, boot-loader and Linux kernel are, replace the XIL_SCRIPT_LOC variable with absolute path:

set XIL_SCRIPT_LOC=D:\\Xilinx\\13.2\\ISE_DS\\

Open a cmd window, switch to your work directory, run:

O:\phase1\xilinx\test> settings32.bat
O:\phase1\xilinx\test> xmd

After entering into XMD prompt window, using "fpga -f" command to program Virtex FPGA:

XMD% fpga -f system.bit

If there are more than one device in the JTAG chain, use "-debugdevice devicenr" to specify the component to be programmed, here we need to configure one Virtex6 and two Spartan6 FPGAs:

XMD% fpga -f spartan6_u1.bit -debugdevice devicenr 1
XMD% fpga -f spartan6_u2.bit -debugdevice devicenr 2
XMD% fpga -f system.bit -debugdevice devicenr 4

Using iMPACT

Run iMPACT from windows Start -> Xilinx ISE Design Suite 13.2 -> ISE Design Tools -> Tools -> iMPACT, or from the cmd window opened above,

XMD% impact

In the iMPACT window, select File -> Initialize Chain, then you will find the devices in the JTAG chain on the "Boundary Scan" window, right click on the FPGA you need to program, Assign a configuration file, then program it following the commands.

Configure TFTP server

Open TFTP Server, select File -> Properties..., in "Preferences" page, enable "Allow Read Requests", in the "Directories" page, add the directory where the Linux kernel is placed. This configration is only needed at the first time.

Connect to debug module on Processor Bus

In the XMD prompt window, you can connect to the Microblaze debug module to download and run your bootloader:

 XMD% connect mb mdm -debugdevice devicenr 4
 XMD% dow u-boot.elf
 XMD% run

Open a serial console like Putty, select the serial port which you can find from you windows Device Manager -> Ports(COM & LPT) -> Silicon Labs CP210x USB to UART Bridge(COM4), set with Baud rate 115200, No Parity, 8 data bits, 1 stop bit.

In the U-Boot command prompt window of Putty, modify the Virtex MAC/IP address and the TFTP server ip address at the first time.

U-Boot-PetaLinux> setenv ethaddr 00:0a:35:02:31:1f
U-Boot-PetaLinux> setenv ipaddr 129.177.39.131
U-Boot-PetaLinux> setenv serverip 129.177.39.230
U-Boot-PetaLinux> saveenv

Download the linux kernel from TFTP server:

U-Boot-PetaLinux> tftp

Boot Linux kernel:

U-Boot-PetaLinux> bootm

If you want to burn the kernel image to the on-board flash memory, run:

U-Boot-PetaLinux> run update_kernel

Running PetaLinux

After PetaLinux boots up, log in and set up network with your Virtex MAC/IP:

~ # ifconfig eth0 hw ether 00:0a:35:02:31:1f
~ # ifconfig eth0 129.177.39.131

If your network support dhcp:

~ # udhcpc

To enable SSH service:

~ # dropbear

To set up jumbo frame support for data shipment

~ # ifconfig eth0 down
~ # ifconfig eth0 mtu 9000
~ # ifconfig eth0 txqueuelen 10000
~ # /sbin/sysctl -w net.ipv4.tcp_sack=0
~ # ifconfig eth0 up

All of the above configurations can be put into a single initiative script file.

Before running the DAQ software, if the device driver has not been compiled into Linux kernle, then manually load it and make new device nodes in the /dev directory:

~ # /home/uib/load.sh

Run the client side DAQ software:

~ # /home/uib/focal

Start the server side DAQ software:

$ ./server