- FSBL - First Stage Boot Loader (using the SDK).
- u-boot.elf - Linux boot loader.
- BOOT.BIN - which is the catenation of the FSBL, file system, system.bit(option), and u-boot.elf using the SDK.
- uImage - A Linux kernel named uImage.
- Devicetree - A devicetree blob named devicetree.dtb.
- A FAT32 partition on our SD card that comprises these files BOOT.BIN,uImage, and devicetree.dtb
Basic SD card
Basic SD card must contain the following files:
- BOOT.BIN - includes FSBL, u-boot, file system and FPGA bitsteeam(optional), device tree (optional) http://www.wiki.xilinx.com/Prepare+boot+image
- image.ub - linux kernel
- rootfs.cpio.gz – file system
- system.dtb - Device tree (if not included in BOOT.BIN)
- system.bit - FPGA bitstream (if not included in BOOT.BIN)
Installation
Virtual machine
- Install virtual machine VirtualBox.
- Create new machine with ~120GB HD
- Download Ubuntu x64 iso image, mount it and install.
Folders
- Create workspace folder inside /home/usr: mkdir workspace
- Create petalinux and SharedFS folder inside workspace folder.
cd workspace
mkdir petalinux
mkdir SharedFS
|
Shared Folder between windows and Vbox
- Create Ubuntu-Shared folder inside Windows
- Add Ubuntu-Shared to Vbox Shared folders.
- Mount the folder inside Ubuntu
sudo mount -t vboxsf Ubuntu-Shared /home/<user name>/workspace/SharedFS/
|
Install Packages
The follow packages are necessary
sudo apt --yes --force-yes update
sudo apt --yes --force-yes upgrade
python --version
sudo apt --assume-yes install tofrodos
sudo apt --assume-yes install iproute2
sudo apt --assume-yes install gawk
sudo apt --assume-yes install xfvb
sudo apt --assume-yes install git
sudo apt --assume-yes install net-toolsp
sudo apt --assume-yes install tftpd
sudo apt --assume-yes install zlib1g-dev
sudo apt --assume-yes install libssl-dev
sudo apt --assume-yes install flex
sudo apt --assume-yes install bison
sudo apt --assume-yes install libselinux1
sudo apt --assume-yes install gnupg
sudo apt --assume-yes install wget
sudo apt --assume-yes install diffstat
sudo apt --assume-yes install chrpath
sudo apt --assume-yes install socat
sudo apt --assume-yes install xterm
sudo apt --assume-yes install autoconf
sudo apt --assume-yes install libtool
sudo apt --assume-yes install unzip
sudo apt --assume-yes install texinfo
sudo apt --assume-yes install zlib1g-dev
sudo apt --assume-yes install gccmultilib
sudo apt --assume-yes install gcc-multilib
sudo apt --assume-yes install build-essential
sudo apt --assume-yes install libsdl1.2-dev
sudo apt --assume-yes install libglib2.0-dev
sudo apt --assume-yes install screen
sudo apt --assume-yes install gzip
sudo apt --assume-yes install libncurses5-dev
sudo apt --assume-yes install xvfb
sudo apt --assume-yes install zlib1g:i386
|
Create TFTP
sudo nano /etc/xinetd.d/tftp
Paste below:
service tftp
{
protocol = udp
port = 69
socket_type = dgram
wait = yes
user = nobody
server = /usr/sbin/in.tftpd
server_args = /tftpboot
disable = no
}
note: Don’t forget ti save the file ctrl+o and exit ctrl+x
note: under root
sudo mkdir /tftpboot
sudo chmod -R 777 /tftpboot
sudo chown -R nobody /tftpboot
sudo service xinetd restart
|
Install PetaLinux SDK
- Download the installer:
- Install the SDK to /workspace/petalinux/:
./petalinux-v2017.2-final-installer.run ~/workspace/petalinux/
|
- Load SDK Environments variables
source ~/workspace/petalinux/settings.sh
|
Install Xilinx SDK (if you want to compile something)
- Download Software Development Kit Standalone WebInstall Client:
Note: you need internet connection
- Change the file access permission:
sudo chmod +x Xilinx_SDK_2017.2_0616_1_Lin64.bin
|
- Install SDK by:
sudo ./Xilinx_SDK_2017.2_0616_1_Lin64.bin
|
- Install the SDK to:
/home/bspdeveloper/workspace/Xilinx-SDK
How to Generate Reference Design (TRD)
- Download TRD reference design zip file:
- Extract zip file to:
~/workspace/peta-builds/<trd name>
- Enter the extracted folder (must)
~/workspace/peta-builds/<trd name>/apu/petalinux_bsp
|
- Load SDK environments
Source ~/workspace/petalinux/settings.h
|
- Compile the reference design
petalinux-build
|
Note: For more option see petalinux-build --help
How to use ZCU102 BSP
Create new project
- Download bsp file for ZCU102:
- Save the bsp file for example:
~/workspace/peta-builds/
- Create new Petalinux project and import bsp
source ~/workspace/petalinux/settings.sh
cd ~/workspace/peta-builds/bsp
petalinux-create -t project -s xilinx-zcu102-v2017.2-final.bsp
|
Import HDF (Hardware configuration file) from vivado
Copy HDF file to project folder
For example:
~/workspace/peta-builds/bsp/hdf
cd ~/workspace/peta-builds/xilinx-zcu102-2017.2/
petalinux-config --get-hw-description=~/workspace/peta-builds/bsp/hdf
|
- Compile bsp again
cd ~/workspace/peta-builds/bsp/xilinx-zcu102-2017.2
petalinux-build
|
Configuring Devicetree
System-user.dtsi
PetaLinux device tree configuration is associated with following config file
~/workspace/peta-builds/<projectname>/project-spec/meta-user/recipes-bsp/device-tree/files/system-user.dtsi
|
Which can be modified, please note that any changes on other dtsi files will be overwrite after compile
Generated files
All the generated device tree files are located in:
~/workspace/peta-builds/<project name>/components/plnx_workspace/device-tree-generation/
|
Generate BOOT.BIN Image
petalinux-package --boot --fsbl <FSBL image> --fpga <FPGA bitstream> --pmufw <PATH_TO_PMU_FW_ELF> --u-boot
|
For example:
petalinux-package --boot --fsbl zynqmp_fsbl.elf --u-boot --force
or
petalinux-package --boot --fsbl zynqmp_fsbl.elf --fpga zcu102_top.bit --u-boot --force
|
Boot a PetaLinux Image on Hardware with SD Card
Copy the following files from <plnx-proj-root>/pre-built/linux/images/ into the root directory of the first partition which is in FAT32 format in the SD card:
- BOOT.BIN
- image.ub
No comments:
Post a Comment