Thursday, December 3, 2015

Talking to ZedBoard/Secure Digital (SD) Card mounting and un-mounting

Setting Jumpers

MI05 and MI04 must be set to High (1) as shown in ZedBoard image (Image 1)



Image 1


Voltage Supply Pin or GND is indicated by VADJ and either select 2V5 or 1V8 (seen in Image 2)


Image 2



Now SD Card and the ZedBoard

Opening SDK and connecting the ZedBoard to the terminal properly will prompt: zynq> 

The ZedBoard will be lighten up accordingly to what Image 3 shows. 

Image 3


Mounting the SD Card command:

zynq> mount /dev/mmcb1k0p1 /mnt

Un-mounting the SD Card command:

zynq> unmount  /mnt

The image below shows the mounting process from terminal in SDK (Image 4)



Image 4

Proper command to poweroff the ZedBoard from the terminal:

zynq> poweroff

Image 5 shows this process in the terminal below.



Image 5


OPEN SOURCE LINUX

OPEN SOURCE LINUX

Our Command: opt/Xilinx/SDK/2013.4/gnu/arm/lin/bin

Steps:

1. Need to fetch source codes and then fetch linux kernel

in the terminal: git clone git://github.com/Xilinx/linux-xlnx.git
1.75GB

2. Now U-Boot: git clone git://github.com/Xilinx/U-boot-xlnx.gir

3. Device Tree Gen: git clone git://github.com/Xilinx/device-tree.git

Note: Need to add GPU core on PL


Fall Semester 2015 ZedBoard Research

Tuesday, October 20, 2015

General AXI Properties/About AXI (unfinished)

AXI
-AXI is a type of bus that connects modules on a chip
-two types: Slaves and Masters

AXI Masters
-initiate transactions between modules (transactions can be seen as read/write data being sent back and forth)

AXI Slaves
-respond to initiated transactions made by Masters
-addresses for slave modules can be defined by the user but no two slaves can have any address overlap

AXI Interconnect
-capable of a lot of actions
-connect master and slave modules
-can be hierarchical
-one AXI Interconnect can have up 16 slaves and 16 masters
-can convert 64 bit transactions to 32 bit transactions if needed





AXI Addressing
-Masters send read/write commands through the AXI Interconnect to slaves
-slaves have address ranges that commands from masters must fall into
Examples: UART: 0x40000000-0x40000FFF
                   GPIO: 0x40001000-0x40001FFF
                   RAM: 0x40010000-0x4001FFFF







**The AXI interconnect is a vital piece when assembling a block design in Xilinx Vivado.**


Monday, October 19, 2015

Video Series to understand Petalinux

The following link has a quite lengthy video series Sessions 1-13 that cover parts of the FPGA, what they do, and how they can be used together to ultimately load Petalinux using the ZedBoard.

(Some of the videos on this channel are unrelated, videos can be differentiated by looking at the titles)

Mohammadsadegh Sadri


Monday, July 27, 2015

Exporting Project to SDK for AD9467/Running Example Github Code

This blog follows up the Vivado Hardware design for the AD9467 created in Vivado 2014.2. I then tried to open up the Vivado project in 2014.4, which ran fine. Before exporting to SDK in 2014.4, I had to update some of the ip-blocks in the Block Design because they were designed for 2014.2. There were 13 blocks total that needed to be upgraded. Only 7 upgraded without manual intervention.  I was unable to update the last 6 with an error telling me that the blocks could not be found in the IP Catalog. From some research,  I found that I had to add another IP Repository with the 6 "locked" blocks. Since they were not upgraded, I was unable to customize them; therefore locked.

I am still working on this problem but I wanted to export the project and program the FPGA with the software from:

http://wiki.analog.com/resources/fpga/xilinx/fmc/ad9467#using_the_hdl_reference_design 

Select AD9467-FMC-EBZ Reference Design  the following menu:

You will be brought to a Github repository similar to the one found in the Hardware Design. Click the double arrow on the right-hand side of the page and download the ZIP file.  

1. Extract the files to your download directory and copy them to wherever you'd like.

2. Make sure the bitstream is written in Vivado (it should be done for you if you follow the directions in the hardware blog).

3. Export Hardware.

4. Launch SDK ensuring the workspace is the same as the one you've been saving your other projects too.

5. Create a new Empty Application

6. Import the following files to the "src" folder:
/home/zynquser/Downloads/no-OS-master/drivers/AD9467/AD9467.c
/home/zynquser/Downloads/no-OS-master/drivers/AD9467/AD9467.h
/home/zynquser/Downloads/no-OS-master/drivers/AD9517/AD9517.c
/home/zynquser/Downloads/no-OS-master/drivers/AD9517/AD9517.h
/home/zynquser/Downloads/no-OS-master/drivers/AD9517/AD9517_cfg.h
/home/zynquser/Downloads/no-OS-master/AD9467-FMC-EBZ/cf_ad9467.c
/home/zynquser/Downloads/no-OS-master/AD9467-FMC-EBZcf_ad9467.h
/home/zynquser/Downloads/no-OS-master/AD9467-FMC-EBZ/main.c
/home/zynquser/Downloads/no-OS-master/AD9467-FMC-EBZ/spi.c
/home/zynquser/Downloads/no-OS-master/AD9467-FMC-EBZ/spi.h

7. Program the FPGA - there should be no issues here

8. In order to see the output (if you check the main.c file you  will see that there are some initial tests the code runs to ensure proper connection and driver installation), open up gtkterm from the terminal.

9. Check to see which port the UART cable is connected to, usually ttyACM0. Change the permissions using sudo chmod 666 /dev/ttyACM0.

10. Run as -> Launch on Hardware (you should see the program output some print statements)

***Note: We have not connected the AD9467 to any function generator yet, this is just the instructions to load the software onto the Zedboard. Once we get the cables to connect to a function generator, we can practice with some example frequencies and take some data. Then move it to MATLAB, plot it, and see if we can get some meaningful graphs.***



Friday, July 24, 2015

Dr. McColgan's Lab Computer Setup

Workstation 1 (in the annex, shorter desk, closer to McColgan's office):

Hard Drive 1: WDC W10EZEX-75M2NA0    - CentOS 6
Hard Drive 2: ST500DM002-1BD142             - Windows (with Virtual Machine)



Workstation 2 (in the annex, taller desk, near the window):

Hard Drive 1: WDC W10EZEX-75M2NA0    - CentOS 6
Hard Drive 2: ST500DM002-1BD142             - Windows (with Virtual Machine)


During boot-up press F12  (Dell Logo Screen) and select which hard drive you plan to use.

Tuesday, July 21, 2015

Building/Running a Vivado Project from the Tcl Console

***Read through the whole blog before following it step by step. There are notes sprinkled throughout that are helpful to keep in mind. The blog reads as a my own personal trial and error story so some things seem superfluous when they are not! Avoid the same mistakes I made!***


Continuing on the ADC project, we ordered a board called the AD9467-FMC-250EBZ. Searching online and getting help from Joe Kujawski, I found that there is a Github repository filled with a hardware design and pre-written software that should allow us to run a program on the board seamlessly. Here is the link to the Wiki page explaining the board and it functionality:

http://wiki.analog.com/resources/fpga/xilinx/fmc/ad9467#using_the_hdl_reference_design

The page above lists links to the Github repository I downloaded the zip file from. I chose the first link (Zed HDL Reference Design) from this download section to navigate to the hardware design:



Once at the new page I simply click the double arrow on the right hand side of the page (<>) to get a new menu which appears directly underneath it:

Before:


After clicking <>:


Notice in the picture above there is an option for "Download Zip". Click this and the download will start automatically. Once downloaded, navigate to your Downloads directory and extract the files to whichever location you choose. I typically go with the strategy of extracting right in the Downloads directory and copying the file to a new one ("Vivado Projects" perhaps) later on. But if I forget where I copy it to I know it is always in the Download folder!

Once extracted I followed the directions from a great tutorial found here:

http://wiki.analog.com/resources/fpga/docs/hdl#building_hdl


Starting with "Building with Vivado," follow the instructions for building the libraries for your project and generating your block design for the project (all done through the Tcl console).

***Note: The project files downloaded from the Github repository are only compatible with Vivado 2014.2. The Virtual Machine I am working on did not have this Xilinx version installed so it is important to check before going ahead with the instructions. Completing the instructions from the tutorial page using Vivado 2014.2 will result in an error from the Tcl console that reads:

ERROR: This project requires Vivado 2014.2.
    while executing
"adi_project_create $project_name"
    (file "./system_project.tcl" line 7)


***Additional Notes: Running the Tcl script for building the libraries loads just fine in 2014.2, but trying to run the project files (generate block diagram) comes up with this error:

ERROR: [BD 5-216] VLNV <analog.com:user:util_i2c_mixer:1.0> is not supported for this version of the tools.
ERROR: [Common 17-39] 'create_bd_cell' failed due to earlier errors.

    while executing
"create_bd_cell -type ip -vlnv analog.com:user:util_i2c_mixer:1.0 sys_i2c_mixer"
    invoked from within
"set sys_i2c_mixer [create_bd_cell -type ip -vlnv analog.com:user:util_i2c_mixer:1.0 sys_i2c_mixer]"
    (file "../../../projects/common/zed/zed_system_bd.tcl" line 66)

    while executing
"source $ad_hdl_dir/projects/common/zed/zed_system_bd.tcl"
    (file "system_bd.tcl" line 2)

    while executing
"source system_bd.tcl"
    (procedure "adi_project_create" line 107)
    invoked from within
"adi_project_create $project_name"

    (file "./system_project.tcl" line 7)


Solving this problem takes awhile whether or not you know what you are doing. It is important to RUN EVERY SINGLE TCL SCRIPT FOUND IN THIS DIRECTORY:

/home/zynquser/Downloads/hdl-master/library

There are roughly 40 .tcl files (Tcl scripts) that need to be run before getting to the next step of the process; loading the project file you need.

Recapping:

1. Download
2. Extract into Downloads folder.
3. Open Vivado 2014.2
4. Build every sub-library listed in:
          /home/zynquser/Downloads/hdl-master/library
         ***This requires entering these instructions for ALL 42 items in the library folder:***
        

Library

We need to build the libraries first. So open the GUI and at the TCL console change the directory to where the libraries are. You must build ALL the libraries (each folder insider the library directory).
cd /home/zynquser/Downloads/hdl-master/library/axi_ad6676
You should see a tcl script axi_ad6676_ip.tcl in this directory. We just need to run that script.
source ./axi_ad9122_ip.tcl
You will see commands being executed, and the GUI will change into a project window. There is nothing to do here, you could browse the source, if you prefer to do synthesis as stand alone and such things. If you are not fancy about it, just quit and continue to build libraries for other cores.



5. Load the project you need: It will be AD9467 for this specific application:

Projects

After building all the libraries (or the ones you are interested in), you can run the project (generate bitstream and export the design to SDK). This is the same procedure as above except for changes in path and tcl file names.
Let's open the GUI again and at the TCL console change the directory to where the project is.
cd //home/zynquser/Downloads/hdl-master/projects/ad9467_fmc/zed
You should see a tcl script system_project.tcl in this directory. We just need to run that script.
source ./system_project.tcl
You will see commands being executed, and the GUI will change into a project window. The script will create a board design in IPI, generate all the IP targets, synthesize the netlist and implementation. It also exports the hardware to SDK.

6. The Tcl script we just ran will take care of everything we usually do with Vivado: Run Synthesis, Run Implementation, Write Bitsream, Export Hardware. In addition the pin assignments for the FMC-LPC portion of the Zedoboard is automated by the Tcl script so no need to go in to I/O Ports and assign specific Sites. The only thing left to do is Launch SDK with your project.

***Although it is somewhat obvious, this is how the AD9467 connects to the Zedboard:***






 It is officially time to Launch SDK and begin loading software onto the Zedboard (Program FPGA). Luckily, there is another Github repository that has pre-written software. I will explain those steps in the next blog post.