Difference between revisions of "AXIOM Alpha"

From apertus wiki
Jump to: navigation, search
 
(31 intermediate revisions by 3 users not shown)
Line 1: Line 1:
=About=
=About=
Officially website: http://axiom.apertus.org/index.php?site=alpha
The AXIOM Alpha was a proof of concept camera that was built prior to development on the [[AXIOM Beta]] commencing.
 
Project overview on apertus° website: http://axiom.apertus.org/index.php?site=alpha
 
Software wiki page moved to: [[Axiom Alpha Software]]
 
 
----
 
 
=Tests and Measurements=
 
[[Darkframe Tests]]
 
 
----
 
 
=Zedboard related Notes=
=Zedboard related Notes=
==Zedboard Development on Ubuntu 12.04 LTS with ISE 14.5 (Currently running in Virtual Box on a Mac)==
==Zedboard Development on Ubuntu 12.04 LTS with ISE 14.5 (Currently running in Virtual Box on a Mac)==


Line 10: Line 28:
In Ubuntu:
In Ubuntu:


 
'''Note:''' To extract files use: tar -xvf filename
Note, to extract files use: tar -xvf filename




Line 33: Line 50:




Note there are several terminal emulator options. Minicom can be run in a shell. A google search will show how to use it. Alternatively in SDK you can use the terminal emulator that is included.
'''Note:''' There are several terminal emulator options. Minicom can be run in a shell. A google search will show how to use it. Alternatively in SDK you can use the terminal emulator that is included.
 
 
----
 


==Getting JTAG working with the Zedboard==
==Getting JTAG working with the Zedboard==
From http://www.digilentinc.com/Products/Detail.cfm?NavPath=2%2C66%2C828&Prod=ADEPT2 download the following packages (these are for 64bit so for x86 you will want the 32bit versions):
From http://www.digilentinc.com/Products/Detail.cfm?NavPath=2%2C66%2C828&Prod=ADEPT2 download the following packages (these are for 64bit so for x86 you will want the 32bit versions):
  digilent.adept.runtime_2.13.1-x86_64.tar.gz
  digilent.adept.runtime_2.13.1-x86_64.tar.gz
  digilent.adept.utilities_2.1.1-x86_64.tar.gz
  digilent.adept.utilities_2.1.1-x86_64.tar.gz
  libCseDigilent_2.4.3-x86_64.tar.gz
  libCseDigilent_2.4.3-x86_64.tar.gz


then install the runtime:  
then install the runtime:  
  tar xzf digilent.adept.runtime_2.13.1-x86_64.tar.gz; cd digilent.adept.runtime_2.13.1-x86_64; ./install.sh
  tar xzf digilent.adept.runtime_2.13.1-x86_64.tar.gz; cd digilent.adept.runtime_2.13.1-x86_64; ./install.sh


and here is the important part: '''AND''' the ftdi driver
 
... and here is the important part: '''AND''' the ftdi driver
  cd ftdi.drivers_1.0.4-x86_64; ./install.sh
  cd ftdi.drivers_1.0.4-x86_64; ./install.sh


then the utilities  
 
Then the utilities  
  same method as runtime above
  same method as runtime above


at this point the following command  
 
At this point the following command  
  djtgcfg enum
  djtgcfg enum


should show board details:  
 
... should show board details:  
  Found 1 device(s)
  Found 1 device(s)
   
   
Line 61: Line 89:
     Serial Number:  XXXXXXXXXXXX
     Serial Number:  XXXXXXXXXXXX
   
   
Note that you need to fix the udev rules, restart udev and unplug/replug the usb-jtag to get the driver (ftdi_sio) unloaded and the permissions for the usb device changed.
'''
Note:''' You need to fix the udev rules, restart udev and unplug/replug the usb-jtag to get the driver (ftdi_sio) unloaded and the permissions for the usb device changed.


The libCseDigilent_2.4.3-x86_64.tar.gz contains two files in ISE14x/plugin:
The libCseDigilent_2.4.3-x86_64.tar.gz contains two files in ISE14x/plugin:
Line 67: Line 96:
  libCseDigilent.xml
  libCseDigilent.xml


which need to be copied to the ISE plugin directory.


after that, the following should work:
... which need to be copied to the ISE plugin directory.
 
After that, the following should work:
  xmd
  xmd


and should show something like:
 
... and should show something like:
  Xilinx Microprocessor Debugger (XMD) Engine
  Xilinx Microprocessor Debugger (XMD) Engine
  Xilinx EDK 14.5 Build EDK_P.58f
  Xilinx EDK 14.5 Build EDK_P.58f
  Copyright (c) 1995-2012 Xilinx, Inc.  All rights reserved.
  Copyright (c) 1995-2012 Xilinx, Inc.  All rights reserved.


Then typing:
Then typing:
  connect mb mdm -cable type xilinx_plugin modulename digilent_plugin
  connect mb mdm -cable type xilinx_plugin modulename digilent_plugin


Should show:
Should show:
Line 85: Line 118:
  XMD% connect mb mdm -cable type xilinx_plugin modulename digilent_plugin
  XMD% connect mb mdm -cable type xilinx_plugin modulename digilent_plugin
   
   
  JTAG chain configuration
  JTAG chain configuration
  --------------------------------------------------
  --------------------------------------------------
Line 96: Line 130:
         4. If the correct MDM is referred, in case of a multiple MDM system
         4. If the correct MDM is referred, in case of a multiple MDM system


Note that the default image has no mdm IP
'''Note:''' The default image has no mdm IP
 
 
----
 


==Booting the Zedboard via JTAG==
==Booting the Zedboard via JTAG==
You want to get the ZedBoard_CTT_v14.3_121017.zip for some files from: http://www.zedboard.org/sites/default/files/design/ZedBoard_CTT_v14.3_121017.zip
You want to get the ZedBoard_CTT_v14.3_121017.zip for some files from: http://www.zedboard.org/sites/default/files/design/ZedBoard_CTT_v14.3_121017.zip
namely: ps7_init.tcl and stub.tcl
namely: ps7_init.tcl and stub.tcl
Line 106: Line 145:
*u-boot.elf or some other elf binary [PS 2nd stage]
*u-boot.elf or some other elf binary [PS 2nd stage]
*optionally (Linux Boot): zImage, ramdisk*.gz and devicetree.dtb
*optionally (Linux Boot): zImage, ramdisk*.gz and devicetree.dtb


start xmd (the Xilinx® Microprocessor Debugger console as part of ISE), then in the xmd prompt do:
start xmd (the Xilinx® Microprocessor Debugger console as part of ISE), then in the xmd prompt do:
Line 118: Line 158:
  con
  con


this will connect to the target, upload the fpga bitstream (PL), initialize memory and MIO devices (ps7_init/init_user) and load the second level bootloader (PS)
 
the 'con' already starts the bootloader
This will connect to the target, upload the fpga bitstream (PL), initialize memory and MIO devices (ps7_init/init_user) and load the second level bootloader (PS)
the 'con' already starts the bootloader.
 


optionally, you can also upload the Linux kernel, initramfs and the devicetree like this:
optionally, you can also upload the Linux kernel, initramfs and the devicetree like this:
Line 126: Line 168:
  dow -data devicetree.dtb 0x1000000
  dow -data devicetree.dtb 0x1000000


and boot the kernel/linux with:
 
... and boot the kernel/linux with:
  con 0x8000
  con 0x8000
----




==Booting the Zedboard via TFTP==
==Booting the Zedboard via TFTP==
Booting the Zedboard via TFTP is a lot faster than the JTAG boot method and doesn't have the drawbacks of SD card shuffling.
Booting the Zedboard via TFTP is a lot faster than the JTAG boot method and doesn't have the drawbacks of SD card shuffling.
It basically boots the Zedboard over the network, a DHCP server directs the Zedboard to the right place to read the required files via TFTP.
It basically boots the Zedboard over the network, a DHCP server directs the Zedboard to the right place to read the required files via TFTP.
----


===DHCP Server Setup Ubuntu 12.04 LTS===
===DHCP Server Setup Ubuntu 12.04 LTS===
Connect the Zedboard via Ethernet to a PC running Ubuntu 12.04. Make sure the router in this set up does not contain DHCP records for the Zedboard otherwise the DHCP server running on the PC will have no effects on the Zedboard. The DHCP server on the router and the DHCP server on the PC even if they are on the same network do not interfere normally.
Connect the Zedboard via Ethernet to a PC running Ubuntu 12.04. Make sure the router in this set up does not contain DHCP records for the Zedboard otherwise the DHCP server running on the PC will have no effects on the Zedboard. The DHCP server on the router and the DHCP server on the PC even if they are on the same network do not interfere normally.


To install the required packages run:
To install the required packages run:
  sudo apt-get install dhcp3-server dhcpd isc-dhcp-server
  sudo apt-get install dhcp3-server dhcpd isc-dhcp-server


If there is more than one network card(s) in your Ubuntu PC, then you have to select the network card on which your server will be listen for dhcp request. (By default, it listens on eth0):
If there is more than one network card(s) in your Ubuntu PC, then you have to select the network card on which your server will be listen for dhcp request. (By default, it listens on eth0):
  sudo gedit /etc/default/isc-dhcp-server
  sudo gedit /etc/default/isc-dhcp-server


Then edit the config file:
Then edit the config file:
Line 163: Line 217:
}
}


Note that all Zedboards have the same MAC address hardcoded into our bootloader currently:
'''Note:''' All Zedboards have the same MAC address hardcoded into our bootloader currently:
  00:0A:35:00:01:22
  00:0A:35:00:01:22


Line 169: Line 223:
  sudo service isc-dhcp-server restart
  sudo service isc-dhcp-server restart


or start it manually if it has not been started yet:
 
... or start it manually if it has not been started yet:
  sudo service isc-dhcp-server start
  sudo service isc-dhcp-server start


When you look at the syslog on your Ubuntu PC with:
When you look at the syslog on your Ubuntu PC with:
  sudo tail -f /var/log/syslog
  sudo tail -f /var/log/syslog


You should see lines like the following when the DHCP server is started and Zedboard is making requests to the DHCP server (AAA = Ubuntu PC, BBB = Zedboard):
You should see lines like the following when the DHCP server is started and Zedboard is making requests to the DHCP server (AAA = Ubuntu PC, BBB = Zedboard):
Line 228: Line 285:
  Load address: 0x1000000
  Load address: 0x1000000
  Loading: *�############################
  Loading: *�############################
----


===TFTP Server Setup Ubuntu 12.04 LTS===
===TFTP Server Setup Ubuntu 12.04 LTS===
Install required packages:
Install required packages:
  apt-get install tftpd-hpa tftp-hpa xinetd
  apt-get install tftpd-hpa tftp-hpa xinetd


Create a text file if it does not exist yet called tftp under /etc/xinetd.d/
Create a text file if it does not exist yet called tftp under /etc/xinetd.d/
Line 248: Line 311:
  disable        = no
  disable        = no
  }
  }


The files that are served via tftp are located in  
The files that are served via tftp are located in  
  /var/lib/tftpboot
  /var/lib/tftpboot


Download the 'ZED' folder to your /var/lib/tftpboot folder by typing:
Download the 'ZED' folder to your /var/lib/tftpboot folder by typing:
  wget -m -nv -np -c -nH --cut-dirs=3 -R 'index.html*' http://vserver.13thfloor.at/Stuff/AXIOM/TFTP/ZED/
  wget -m -nv -np -c -nH --cut-dirs=3 -R 'index.html*' http://vserver.13thfloor.at/Stuff/AXIOM/TFTP/ZED/


Download the  
Download the  
Line 265: Line 331:
  ln -s ZedBoard_OOB_Design/ramdisk8M.image.gz ramdisk.image.gz
  ln -s ZedBoard_OOB_Design/ramdisk8M.image.gz ramdisk.image.gz
  ln -s BERTL.xilinx/devicetree_ramdisk.dtb devicetree_ramdisk.dtb
  ln -s BERTL.xilinx/devicetree_ramdisk.dtb devicetree_ramdisk.dtb


Then make sure that all the files can be acessed by TFTP:
Then make sure that all the files can be acessed by TFTP:
  sudo chmod -R 777 /var/lib/tftpboot/*
  sudo chmod -R 777 /var/lib/tftpboot/*


Start the TFTP server with:
Start the TFTP server with:
  sudo service xinetd start
  sudo service xinetd start


Monitor your Ubuntu-PC's syslog by typing:
Monitor your Ubuntu-PC's syslog by typing:
  sudo tail -f /var/log/syslog
  sudo tail -f /var/log/syslog


When the Zedboard is correctly booting via TFTP you should see something like the following in syslog (AAA = Ubuntu PC, BBB = Zedboard):
When the Zedboard is correctly booting via TFTP you should see something like the following in syslog (AAA = Ubuntu PC, BBB = Zedboard):
Line 281: Line 351:
  Oct  3 20:24:55 Ubuntu-PC in.tftpd[2862]: RRQ from 192.168.10.BBB filename ZED/devicetree_ramdisk.dtb
  Oct  3 20:24:55 Ubuntu-PC in.tftpd[2862]: RRQ from 192.168.10.BBB filename ZED/devicetree_ramdisk.dtb
  Oct  3 20:24:55 Ubuntu-PC in.tftpd[2863]: RRQ from 192.168.10.BBB filename ZED/ramdisk.image.gz
  Oct  3 20:24:55 Ubuntu-PC in.tftpd[2863]: RRQ from 192.168.10.BBB filename ZED/ramdisk.image.gz
----


===SD Card Preparations===
===SD Card Preparations===
Download boot.bin (as BOOT.BIN) and copy it the to the SD card that is plugged into the Zedboard:
Download boot.bin (as BOOT.BIN) and copy it the to the SD card that is plugged into the Zedboard:
*Download from http://vserver.13thfloor.at/Stuff/AXIOM/TFTP/boot.bin
*Download from http://vserver.13thfloor.at/Stuff/AXIOM/TFTP/boot.bin
Line 289: Line 364:
The boot.bin will request an IP via DHCP and then start loading the advertised boot file, which is an u-boot script that is then executed, and can be used to customize the setup steps.
The boot.bin will request an IP via DHCP and then start loading the advertised boot file, which is an u-boot script that is then executed, and can be used to customize the setup steps.
An example script is provided to boot into the demo ZedBoard_OOB design.
An example script is provided to boot into the demo ZedBoard_OOB design.
----


===Boot Process===
===Boot Process===
Boot time from power on till Linux prompt is 29 seconds
Boot time from power on till Linux prompt is 29 seconds


Line 308: Line 388:
#then it tries to boot the new style
#then it tries to boot the new style


==Capturing an Image==
Preparations:
ssh root@*alpha-IP* "./cmv_init.sh
ssh root@*alpha-IP* "./cmv_train


ssh root@*alpha-IP* "./cmv_snap -r -e 0x200" | tee snap.raw16 | display -size 4096x3072 -depth 16 gray:-
----


==cmv_snap==
cmv_snap -h
This is ./cmv_snap V1.1
options are:
-h        print this help message
-8        output 8 bit per pixel
-b        enable black columns
-r        dump sensor registers
-e <exp>  exposure values
-s <num>  shift values by <num>
-B <val>  register mapping base
-S <val>  register mapping size
-A <val>  register mapping address
-M <val>  buffer memory base
-Z <val>  buffer memory size
-P <pat>  mark pattern


==Post Processing images==
=Sensor Front End=
===Create RGGB separated color images from raw file:===
convert -size 4096x3072 -depth 16 -crop +0+0 -sample 2048x1536 gray:colors_500ms.raw16 gray:colors_500ms_ch0.raw
convert -size 4096x3072 -depth 16 -crop -1+0 -sample 2048x1536 gray:colors_500ms.raw16 gray:colors_500ms_ch1.raw
convert -size 4096x3072 -depth 16 -crop +0-1 -sample 2048x1536 gray:colors_500ms.raw16 gray:colors_500ms_ch2.raw
convert -size 4096x3072 -depth 16 -crop -1-1 -sample 2048x1536 gray:colors_500ms.raw16 gray:colors_500ms_ch3.raw


===Simple debayer with ImageMagick:===
==Parts==
For flipped images:
convert \( -size 4096x3072 -depth 16 gray:colors_500ms.raw16 \) \
\( -clone 0 -crop -1-1 \) \( -clone 0 -crop -1+0 \) \( -clone 0 -crop +0-1 \) \
-sample 2048x1536 \( -clone 2,3 -average \) -delete 2,3 -swap 0,1 +swap -combine colors_500ms.png


For unflipped images:
convert \( -size 4096x3072 -depth 16 gray:IT8_incand.raw16 \) \
\( -clone 0 -crop -1-1 \) \( -clone 0 -crop -1+0 \) \( -clone 0 -crop +0-1 \) \
-sample 2048x1536 \( -clone 0,1 -average \) -delete 0,1 +swap -combine IT8_incand.png


=== Plot Histogram of Raw Image ===
----


Create histogram values file with imagemagick:
convert -size 4096x3072 -depth 16 gray:image.raw16 -format "%c" histogram:info: > histogram.hist
Reformat the file:
gawk -F, '(NF>3) { printf "%d\t%d\n", $2/16, $1 }'


Or all in one command:
===Image Sensor===
convert -size 4096x3072 -depth 16 gray:image.raw16 -colors 4096 -format %c histogram:info:- | gawk -F, '(NF>3) { printf "%d\t%d\n", $2/16, $1 }' > histogram.info


Then draw it with gnuplot:
CMV12000 from Cmosis
set notitle
set term svg size 1024, 512
set multiplot
set xrange[0:4096]
set yrange[0:8000]
plot 'histogram.info' using 1:2 with lines lc rgb "#FF0000" title "dark"
unset multiplot
pause mouse any


=Sensor Front End=
http://www.cmosis.com/products/standard_products/cmv12000


==Parts==
Price: 1265.00 €


===Image Sensor===
CMV12000 from Cmosis


http://www.cmosis.com/products/standard_products/cmv12000
----


Price: 1265.00 €


===FMC connector===
===FMC connector===
Samtec Vita 57
Samtec Vita 57


Line 389: Line 421:


Price: $19.70
Price: $19.70
----


===HDR Cable===
===HDR Cable===
300mm FMC extension cable (HDR⁃169473⁃01)
300mm FMC extension cable (HDR⁃169473⁃01)


Line 396: Line 433:


Price: $180.54
Price: $180.54
----


===Image Sensor Socket===
===Image Sensor Socket===
Socket for CMV12000 from Andon:
Socket for CMV12000 from Andon:


Line 408: Line 450:




==Reading and Writing Sensor Register==
----
 
This example script:
 
#!/bin/sh
cmv_reg() {
    addr=$(( 0x60000000 + ($1 * 4) ))
    [ $# -gt 1 ] && devmem $addr 32 $2
    devmem $addr 32
}
#change the registers 69/98/102/107/108/112 and 124               
cmv_reg  69      2
cmv_reg  98  39705
cmv_reg 102  8312
cmv_reg 107  9814
cmv_reg 108  12381
cmv_reg 112      5
cmv_reg 124    15
#read the register 127
cmv_reg 127
 
basically the registers get mapped to 32bit spaces starting at a specific memory address (0x60000000 in this case), reading from that memory will show the register, writing to that memory will change it
 
so register '0' is at 0x60000000, register '1' at 0x60000004 ...
 
 
This example script reads the current bitdepth the sensor is running with:
get_bitdepth () {
depth=$(( `cmv_reg 118` + 0 ))
[ $depth -eq 0 ] && echo "12 bit mode"
[ $depth -eq 1 ] && echo "10 bit mode"
[ $depth -eq 2 ] && echo "8 bit mode"
}
===statically linked busybox===
http://vserver.13thfloor.at/Stuff/AXIOM/FAKE/
 
builtin fake devmem


all you need to get it to work is the following:
dd if=/dev/zero of=/tmp/mem bs=1k seek=4M count=1
this will create a sparse 4GB file /tmp/mem, which will be used by the fake devmem
values written can be read back, non existing values return 0


/bin/sh and /sbin/devmem both link to busybox on the axiom alpha filesystem so both can be tested with this executeable
[[Category:AXIOM Alpha]]
[[Category:ZedBoard]]
[[Category:JTAG]]

Latest revision as of 16:57, 6 November 2018

1 About

The AXIOM Alpha was a proof of concept camera that was built prior to development on the AXIOM Beta commencing.

Project overview on apertus° website: http://axiom.apertus.org/index.php?site=alpha

Software wiki page moved to: Axiom Alpha Software




2 Tests and Measurements

Darkframe Tests




3 Zedboard related Notes

3.1 Zedboard Development on Ubuntu 12.04 LTS with ISE 14.5 (Currently running in Virtual Box on a Mac)

Plug in two micro USB cables (one is provided with the Zedboard) to Zedboard ports J13 and J17 (UART and PROG) respectively. Set jumpers JP7-JP11 as described in tutorial for Helloworld. Plug USB cables into computer.

Turn on Zedboard. In Virtual Box open the machine settings that Ubuntu is installed in. Select the Ports tab, and the USB tab. Add a USB Device Filter (plus sign) for 2012 Cyprus Semiconductor Cypress - USB2UART-Ver1.0G, and also Digilent USB Device. This automatically connects the USB ports for Ubuntu whenever the Zedboard is connected.

In Ubuntu:

Note: To extract files use: tar -xvf filename


1) Install libusb: sudo apt-get install libusb-dev

2) Work around for arm toolchain install: sudo dpkg-reconfigure -plow dash (Select NO when prompted)

3) Download ISE 14.5

4) Install: ./xsetup (do not install cable drivers). Select System Edition

5) Work around for arm toolchain install: sudo dpkg-reconfigure -plow dash (Select YES when prompted)

6) Download Digilent Runtime and Utilities: [1]

7) Install both using: sudo ./install.sh (note install can be for all users or the user installing, see README for instructions)

8) Download Digilent Plugin: [2]

9) Install plugin per instructions included in PDF.


Note: There are several terminal emulator options. Minicom can be run in a shell. A google search will show how to use it. Alternatively in SDK you can use the terminal emulator that is included.




3.2 Getting JTAG working with the Zedboard

From http://www.digilentinc.com/Products/Detail.cfm?NavPath=2%2C66%2C828&Prod=ADEPT2 download the following packages (these are for 64bit so for x86 you will want the 32bit versions):

digilent.adept.runtime_2.13.1-x86_64.tar.gz
digilent.adept.utilities_2.1.1-x86_64.tar.gz
libCseDigilent_2.4.3-x86_64.tar.gz


then install the runtime:

tar xzf digilent.adept.runtime_2.13.1-x86_64.tar.gz; cd digilent.adept.runtime_2.13.1-x86_64; ./install.sh


... and here is the important part: AND the ftdi driver

cd ftdi.drivers_1.0.4-x86_64; ./install.sh


Then the utilities

same method as runtime above


At this point the following command

djtgcfg enum


... should show board details:

Found 1 device(s)

Device: Zed
   Product Name:   Digilent Zed
   User Name:      Zed
   Serial Number:  XXXXXXXXXXXX

Note: You need to fix the udev rules, restart udev and unplug/replug the usb-jtag to get the driver (ftdi_sio) unloaded and the permissions for the usb device changed.

The libCseDigilent_2.4.3-x86_64.tar.gz contains two files in ISE14x/plugin:

libCseDigilent.so  
libCseDigilent.xml


... which need to be copied to the ISE plugin directory.

After that, the following should work:

xmd


... and should show something like:

Xilinx Microprocessor Debugger (XMD) Engine
Xilinx EDK 14.5 Build EDK_P.58f
Copyright (c) 1995-2012 Xilinx, Inc.  All rights reserved.


Then typing:

connect mb mdm -cable type xilinx_plugin modulename digilent_plugin


Should show:

XMD%
XMD% connect mb mdm -cable type xilinx_plugin modulename digilent_plugin

JTAG chain configuration
--------------------------------------------------
Device   ID Code        IR Length    Part Name
 1       4ba00477           4        Cortex-A9
 2       03727093           6        XC7Z020
ERROR: Could not detect MDM peripheral on hardware. Please check:
        1. If FPGA is configured correctly
        2. MDM Core is instantiated in the design
        3. If the correct FPGA is referred, in case of multiple FPGAs
        4. If the correct MDM is referred, in case of a multiple MDM system

Note: The default image has no mdm IP




3.3 Booting the Zedboard via JTAG

You want to get the ZedBoard_CTT_v14.3_121017.zip for some files from: http://www.zedboard.org/sites/default/files/design/ZedBoard_CTT_v14.3_121017.zip namely: ps7_init.tcl and stub.tcl

Then you also need the following from your design:

  • system.bit [PL bitstream]
  • u-boot.elf or some other elf binary [PS 2nd stage]
  • optionally (Linux Boot): zImage, ramdisk*.gz and devicetree.dtb


start xmd (the Xilinx® Microprocessor Debugger console as part of ISE), then in the xmd prompt do:

connect arm hw
fpga -f system.bit
source ps7_init.tcl
ps7_init
init_user
source stub.tcl
target 64
dow u-boot.elf
con


This will connect to the target, upload the fpga bitstream (PL), initialize memory and MIO devices (ps7_init/init_user) and load the second level bootloader (PS) the 'con' already starts the bootloader.


optionally, you can also upload the Linux kernel, initramfs and the devicetree like this:

dow -data zImage 0x8000
dow -data ramdisk8M.image.gz 0x800000
dow -data devicetree.dtb 0x1000000


... and boot the kernel/linux with:

con 0x8000




3.4 Booting the Zedboard via TFTP

Booting the Zedboard via TFTP is a lot faster than the JTAG boot method and doesn't have the drawbacks of SD card shuffling. It basically boots the Zedboard over the network, a DHCP server directs the Zedboard to the right place to read the required files via TFTP.




3.4.1 DHCP Server Setup Ubuntu 12.04 LTS

Connect the Zedboard via Ethernet to a PC running Ubuntu 12.04. Make sure the router in this set up does not contain DHCP records for the Zedboard otherwise the DHCP server running on the PC will have no effects on the Zedboard. The DHCP server on the router and the DHCP server on the PC even if they are on the same network do not interfere normally.

To install the required packages run:

sudo apt-get install dhcp3-server dhcpd isc-dhcp-server


If there is more than one network card(s) in your Ubuntu PC, then you have to select the network card on which your server will be listen for dhcp request. (By default, it listens on eth0):

sudo gedit /etc/default/isc-dhcp-server


Then edit the config file:

sudo gedit /etc/dhcp/dhcpd.conf

In this case the network is set up in the 192.168.10.X range and the dhcpd.conf looks like this (AAA = Ubuntu PC, BBB = Zedboard)

subnet 192.168.10.0 netmask 255.255.255.0 {
       # default gateway
       option routers 192.168.10.254;
       option subnet-mask 255.255.255.0;
         
       always-reply-rfc1048 true;
       next-server 192.168.10.AAA;

       host zedboard {
               hardware ethernet 00:0A:35:00:01:22;
               fixed-address 192.168.10.BBB;
               filename "/ZED/u-boot.scr";
       }

}

Note: All Zedboards have the same MAC address hardcoded into our bootloader currently:

00:0A:35:00:01:22

After making changes to the file restart the dhcp server with:

sudo service isc-dhcp-server restart


... or start it manually if it has not been started yet:

sudo service isc-dhcp-server start


When you look at the syslog on your Ubuntu PC with:

sudo tail -f /var/log/syslog


You should see lines like the following when the DHCP server is started and Zedboard is making requests to the DHCP server (AAA = Ubuntu PC, BBB = Zedboard):

Oct  3 20:23:40 Ubuntu-PC dhcpd: Internet Systems Consortium DHCP Server 4.1-ESV-R4
Oct  3 20:23:40 Ubuntu-PC dhcpd: Copyright 2004-2011 Internet Systems Consortium.
Oct  3 20:23:40 Ubuntu-PC dhcpd: All rights reserved.
Oct  3 20:23:40 Ubuntu-PC dhcpd: For info, please visit https://www.isc.org/software/dhcp/
Oct  3 20:23:40 Ubuntu-PC dhcpd: Wrote 0 deleted host decls to leases file.
Oct  3 20:23:40 Ubuntu-PC dhcpd: Wrote 0 new dynamic host decls to leases file.
Oct  3 20:23:40 Ubuntu-PC dhcpd: Wrote 0 leases to leases file.
Oct  3 20:23:54 Ubuntu-PC dhcpd: BOOTREQUEST from 00:0a:35:00:01:22 via eth0
Oct  3 20:23:54 Ubuntu-PC dhcpd: BOOTREPLY for 192.168.10.BBB to zedboard (00:0a:35:00:01:22) via eth0

On the Zedboards UART you should see something like this (AAA = Ubuntu PC, BBB = Zedboard):

U-Boot 2012.04.01-dirty (Jun 23 2013 - 19:36:00)
DRAM:  512 MiB
WARNING: Caches not enabled
MMC:   SDHCI: 0
Using default environment
In:    serial
Out:   serial
Err:   serial
Net:   zynq_gem
Hit any key to stop autoboot:  3 ��� 2 ��� 1 ��� 0 
Scripted Boot via TFTP...
Xilinx Device
Descriptor @ 0x1ffb8a64
Family:        	Zynq PL
Interface type:	Device configuration interface (Zynq)
Device Size:   	4045564 bytes
Cookie:        	0x0 (0)
No Device Function Table.
Requesting Boot Script via TFTP...
Trying to set up GEM link...
Phy ID: 01410DD1
Resetting PHY... 
PHY reset complete.
Waiting for PHY to complete auto-negotiation...
Link is now at 1000Mbps!
BOOTP broadcast 1
Using zynq_gem device
TFTP from server 192.168.10.AAA; our IP address is 192.168.10.BBB
Filename '/ZED/u-boot.scr'.
Load address: 0xf00000
Loading: *�#
done
Bytes transferred = 303 (12f hex)
Executing Boot Script...
## Executing script at 00f00000
Using zynq_gem device
TFTP from server 192.168.10.AAA; our IP address is 192.168.10.BBB
Filename 'ZED/system.bin'.
Load address: 0x1000000
Loading: *�############################




3.4.2 TFTP Server Setup Ubuntu 12.04 LTS

Install required packages:

apt-get install tftpd-hpa tftp-hpa xinetd


Create a text file if it does not exist yet called tftp under /etc/xinetd.d/

sudo gedit /etc/xinetd.d/tftp

The tftp file should look like this:

service tftp
{
protocol        = udp
port            = 69
socket_type     = dgram
wait            = yes
user            = root
server          = /usr/sbin/in.tftpd
server_args     = -c -s /var/lib/tftpboot --verbose
disable         = no
}


The files that are served via tftp are located in

/var/lib/tftpboot


Download the 'ZED' folder to your /var/lib/tftpboot folder by typing:

wget -m -nv -np -c -nH --cut-dirs=3 -R 'index.html*' http://vserver.13thfloor.at/Stuff/AXIOM/TFTP/ZED/


Download the

boot.bin

from http://vserver.13thfloor.at/Stuff/AXIOM/TFTP/ to your /var/lib/tftpboot/ directory

Then create some symlinks inside the ZED folder in the root TFTP folder (/var/lib/tftpboot/ZED/)

cd /var/lib/tftpboot/ZED/
ln -s BERTL.xilinx/zImage zImage
ln -s BERTL.PL/cmv_io.bin system.bin
ln -s ZedBoard_OOB_Design/ramdisk8M.image.gz ramdisk.image.gz
ln -s BERTL.xilinx/devicetree_ramdisk.dtb devicetree_ramdisk.dtb


Then make sure that all the files can be acessed by TFTP:

sudo chmod -R 777 /var/lib/tftpboot/*


Start the TFTP server with:

sudo service xinetd start


Monitor your Ubuntu-PC's syslog by typing:

sudo tail -f /var/log/syslog


When the Zedboard is correctly booting via TFTP you should see something like the following in syslog (AAA = Ubuntu PC, BBB = Zedboard):

Oct  3 20:24:52 Ubuntu-PC in.tftpd[2859]: RRQ from 192.168.10.BBB filename /ZED/u-boot.scr
Oct  3 20:24:52 Ubuntu-PC in.tftpd[2860]: RRQ from 192.168.10.BBB filename ZED/system.bin
Oct  3 20:24:54 Ubuntu-PC in.tftpd[2861]: RRQ from 192.168.10.BBB filename ZED/zImage
Oct  3 20:24:55 Ubuntu-PC in.tftpd[2862]: RRQ from 192.168.10.BBB filename ZED/devicetree_ramdisk.dtb
Oct  3 20:24:55 Ubuntu-PC in.tftpd[2863]: RRQ from 192.168.10.BBB filename ZED/ramdisk.image.gz




3.4.3 SD Card Preparations

Download boot.bin (as BOOT.BIN) and copy it the to the SD card that is plugged into the Zedboard:


The boot.bin will request an IP via DHCP and then start loading the advertised boot file, which is an u-boot script that is then executed, and can be used to customize the setup steps. An example script is provided to boot into the demo ZedBoard_OOB design.




3.4.4 Boot Process

Boot time from power on till Linux prompt is 29 seconds

5 seconds till boot.bin is booted, 3 seconds wait to interrupt the bootloader, 3 seconds kernel boot, rest is bootp/tftp and stuff

  1. Autoboot (from boot.bin) will first request an IP via BOOTP
  2. Then request the file ZED/u-boot.scr (the script)
  3. Then execute that script, which contains:
  4. tftp 0x1000000 ZED/system.bin
  5. fpga load 0 0x${fileaddr} 0x${filesize}
  6. tftp 0x8000 ZED/zImage
  7. tftp 0x1000000 ZED/devicetree_ramdisk.dtb
  8. tftp 0x800000 ZED/ramdisk.image.gz
  9. bootz 0x8000 0x${fileaddr}:0x${filesize} 0x1000000
  10. go 0x8000 so it first fetches the PL code and uploads it to the FPGA
  11. then it requests the kernel, devicetree and initrd
  12. then it tries to boot the new style




4 Sensor Front End

4.1 Parts



4.1.1 Image Sensor

CMV12000 from Cmosis

http://www.cmosis.com/products/standard_products/cmv12000

Price: 1265.00 €




4.1.2 FMC connector

Samtec Vita 57

http://www.samtec.com/standards/vita.aspx

Part Number: ASP-134604-01

Price: $19.70




4.1.3 HDR Cable

300mm FMC extension cable (HDR⁃169473⁃01)

http://www.samtec.com/standards/vita.aspx

Price: $180.54




4.1.4 Image Sensor Socket

Socket for CMV12000 from Andon:

Partnumber | Prices: 10-30-07-237-414T4-R27-L14 - 87.00 €

10-30-07-237-400T4-R27-L14 - 88.15 €

10-30-07-237-RB501T4-R27-L14 - 102.30 €