Target Platform:
- Hardware: MiniZed Development Board
- Workstation OS: Ubuntu 16.04 LTS
- Essential Tools: PetaLinux Tools, Vivado Design Suite
This project is built upon two other repos.
-
App & Modules aes128_driver
-
HDL AXIS_AES128
There are several essential components with dependency on one another. Please follow the following sections in the listed order to build the project.
- Have Vivado 2017.4 and git installed on your machine
- Have the MiniZed board definition file (BDF) in <your-vivado-install_path>/data/boards (* This can be downloaded from Avnet website. Tutorials are also available there.
- On the workstation PC, download the minized_petalinux project by issuing
mkdir ~/Vivadoprojects
cd ~/Vivadoprojects
git clone git://github.com/Avnet/hdl.git
- Launch Vivado. In the TCL prompt window, issue
cd ~/Vivadoprojects/hdl/Scripts
source ./make_minized_petalinux.tcl
-
Open the project
/hdl/Projects/minized_petalinux/
-
Clone the AXIS_AES128 repo to wherever you want on your workstation PC.
-
In Vivado, click Open Block Design. In the IP Catalog window, right click and select Add Repository. Select the AXIS_AES128 repo you just cloned.
-
Add the following to the block design.
- axis_aes128
- axilite_aes_cntl
- AXI Direct Memory Access
- Two instances of AXIS_DATA_FIFO
- Connect the signals accordingly.
From | To |
---|---|
M_AXIS_MM2S of the axi_dma | S_AXIS of axis_data_fifo_0 |
M_AXIS of axis_data_fifo_0 | S00_AXIS of axis_aes128 |
M00_AXIS of axis_aes128 | S_AXIS of axis_data_fifo_1 |
M_AXIS of axis_data_fifo_1 | S_AXIS_S2MM of axi_dma |
aes_key of axilite_aes_cntl | cipher_key of axis_aes128 |
set_IV of axilite_aes_cntl | set_IV of axis_aes128 |
-
Let auto-connection tool handle the rest of the connections.
-
Double click on axi_dma.
- Disable Scatter Gather Engine
- Set Width of Buffer Length Register to 20 bits.
- Set the Memory Map Data Width and Stream Data Width to 128 bits.
- Double click on the axi_data_fifo (do this step for both data fifos)
- Set TDATA width to 16 bytes
- Double clock on the processing_system (PS). Under Clock Configuration -> PL Fabric Clocks, set
- Set FCLK_CLK_0 to 71 MHz
- Set FCLK_CLK_1 to 34.782608 MHz
- Double click on bluetooth_uart
- Set External CLK Freqency to 34.782608 MHz
-
On the toolbar, click Validate Block Design. (And pray for no errors :) )
-
Click Regenerate Layout on the toolbar. You should have something similar to the following schematic. Save the block design.
- On top of the toolbar of block design window, click on the Address Editor tab. Record the Offset Address of
- processing_system7_0
- -> Data
- -> axi_dma_0
- -> axilite_aes_cntl_0
- -> Data
- Go to Tools -> Settings -> Project Settings -> Implementation
- Change the Strategy under Options to Performance_ExtraTimingOpt
-
Run Synthesis. Run Implementation. Generate Bitstream.
-
File -> Export -> Export Hardware (check Include Bitstream). A small window will popup and you can specify the export location or leave it as default.
*Make sure you know where the HDF and BIT files are exported to
- Running Ubuntu 16.04
- Installed PetaLinux Tools 2017.3 (Link Follow the user guide to so do)
- Have the minized_petalinux.hdf and minized_petalinux.bit files from the previous section.
-
Download minized_qspi.bsp 2017.2 from minized.org (under MiniZed->Tutorial).
-
Source $(PETALINUX)/settings.sh to start PetaLinux enviornment if you haven't
-
Create a folder for PetaLinux projects if you don't have one yet
mkdir ~/projects
cd ~/projects
- Create a petalinux project by typing
petalinux-create -t project -n minized_qspi -s <path-to-minized_qspi.bsp>
- Replace the following files with the ones you have exported in Section I.
- minized_qspi/hardware/MINIZED/minized_petalinux.sdk/minized_petalinux_hw.hdf
- minized_qspi/hardware/MINIZED/minized_petalinux.sdk/minized_petalinux_hw/minized_petalinux_hw.bit
- Issue
cd ~/projects/minized_qspi
petalinux-config --get-hw-description=./hardware/MINIZED/minized_petalinux.sdk/
The configuration screen should pop up. Just simply save and exit.
- Build the project by issuing
petalinux-build
- Copy the following three files from minized_qspi.zip file to ~/projects/minized_qspi
-
boot_gen.sh
-
bootgen.bif
Also copy
./image/linux/zynq_fsbl.elf
to the same directory. If it is not there, download the python server tutorial on minized.org and just use thezynq_fsbl.elf
in the zip file.
- Generate bootable binary. Under ~/projects/minized_qspi, issue
./boot_gen.sh
- Start xsct in sudo mode by typing
sudo <your-vivado-install_path>/Xilinx/SDK/2017.4/bin/xsct
-
Connect MiniZed to your workstation PC
-
In XSCT, issue
exec program_flash -f BOOT.BIN -bin zynq_fsbl.elf -flash_type qspi_single
You should expect a message saying program flash operation succeeded.
- Running Ubuntu 16.04
- Installed PetaLinux Tools 2017.3 (Link Follow the user guide to so do)
- You have created the minized_qspi project and programmed the flash accordingly
- A USB stick
- Download minized.bsp 2017.2 from minized.org (under MiniZed->Tutorial).
petalinux-create -t project -n minized -s <path-to-the-minized.bsp>
- Source $(PETALINUX)/settings.sh to start PetaLinux environment if you haven't
source $(PETALINUX)/settings.sh
- Create a new petalinux project by typing the following.
cd ~/projects
petalinux-create -t project -n minized_qspi -s <path-to-the-minized.bsp>
-
Replace
minized/hardware/MINIZED/minized_petalinux.sdk/minized_petalinux_hw.hdf
with the HDF you have exported in Section I. -
Issue
cd ~/projects/minized
petalinux-config --get-hw-description=./hardware/MINIZED/minized_petalinux.sdk/
Optional: When the settings screen pop up, change the rootfs type from initram to initrd if you think your image.ub will exceed 64MB.
- Issue
cd ./project-spec/meta-user/recipes-core/images
-
Replace or modifiy
petalinux-user-image.bbappend
with /petalinux_configs/petalinux-user-image.bbappend. -
Configure the kernel. Two ways:
Simply replace
./project-spec/configs/config with petalinux_configs/config
with /petalinux_configs/configsOR
Issue
petalinux-config -c kernel
In the pop up configuration screen,
- EXCLUDE all Xilinx AXI-DMA drivers.
- Include the UVC driver
Save and exit.
-
Configure the rootfs. Also two ways:
Replace
./project-spec/configs/rootfs_config
with /petalinux_configs/rootfs_configOR
Issue
petalinux-config -c rootfs
In the pop up configuration screen,
- Include all Gstreamer plugins
- Include the av encoder/decoder package
Save and exit.
- Have Section I, II, and III done without any errors
-
Follow the steps in aes128_driver to include the necessary applications and modules.
-
Copy
./images/linux/image.up
to your USB stick. Also copy the tool scripts as well as the wifi config files to the usb stick. -
Boot your minized. Interrupt the autobooting. In uboot shell, type
run boot_qspi
-
Plug-in an extra power cable and the USB stick. Mount the device to
/mnt/usb
if it is not mounted automatically. -
Copy the image, scripts, config files to the eMMC.
cd /mnt/usb
cp image.ub ../emmc/
cp <all-demo-files-and-wifi-conf-file> ../emmc
sync
reboot
- Setup the receiver programs on your client side computer. Run the following to see your ip address
ifconf
-
Download ALL source files for the AES128 program in aes128_driver/aes128 and /common
-
Compile the AES128 program on your client PC by issuing
cc -o aes128 aes128.c dma_driver.c sw_aes.c
-
Install Gstreamer and Netcat tools on your client PC if you haven't.
-
Download the receiver side script /demo_scripts/receiver.sh to the same folder as your aes128 program. Make sure you have the same key file in the directory.
-
Boot minized. Connect an extra power cable and the USB camera. Connect MiniZed to the Wi-Fi by issuing
wifi.sh
-
Make sure the client PC and the MiniZed are in the same network and there is no firewall blocking the connections between them (e.g. you get a response on one if you
ping
the other). -
On the Client PC, in the directory where you put the client scripts, issue
./receiver 5000 8192
- On the MiniZed board, run
/mnt/emmc/easy_demo.sh <your-computers-ip>
- You should see the video streaming on the client PC now (hopefully).
See the following repos: