User Tools

Site Tools


xilinx_running_petalinux

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
xilinx_running_petalinux [2019/05/29 11:20]
rpjday [The packaging step]
xilinx_running_petalinux [2019/10/20 12:01] (current)
rpjday [Configuration options]
Line 1: Line 1:
 ===== Overview ===== ===== Overview =====
  
-This page steps through using the Vivado-generated artifacts ​''​*.hdf'' ​(hardware description ​file) and ''​*.bit''​ (FPGA bitstream file) to build a bootable SD card for the target boardbased on the 2018.3 versions of both Vivado ​and PetaLinux.+This page steps through ​building for a ZCU102 ​using an ''​.hdf''​ file downloaded from GitHub, and PetaLinux ​2019.1.
  
-===== Prerequisites ​=====+===== Format of the ZCU102 HDF file =====
  
-For this example, PetaLinux requires two files generated by an earlier run of the same version of Vivado+<​code>​ 
- +-rw-r--r--. 1 rpjday rpjday ​   46772 May  5 15:09 design_1_bd.tcl 
-  * the hardware description file ''​*.hdf''​ +-rw-r--r--. 1 rpjday rpjday ​  ​124564 May  5 15:09 design_1.hwh 
-  ​* the FPGA bitstream file ''​*.bit''​ +-rw-r--r--. 1 rpjday rpjday 26510901 May  5 15:09 design_1_wrapper.bit 
- +-rw-r--r--. 1 rpjday rpjday ​  ​922239 May  5 15:09 psu_init.c 
-Depending on how the HDF file was generated, it may in fact contain the bitstream file as one of its components+-rw-r--r--1 rpjday rpjday ​  ​921403 May  5 15:09 psu_init_gpl.c 
- +-rw-r--r--. 1 rpjday rpjday ​ 1660902 May  5 15:09 psu_init_gpl.h 
-===== Format of the HDF file =====+-rw-r--r--. 1 rpjday rpjday ​ 1661516 May  5 15:09 psu_init.h 
 +-rw-r--r--. 1 rpjday rpjday ​   52815 May  5 15:09 psu_init.html 
 +-rw-r--r--. 1 rpjday rpjday ​  ​881371 May  5 15:09 psu_init.tcl 
 +-rw-r--r--. 1 rpjday rpjday ​    1007 May  5 15:09 sysdef.xml 
 +</​code>​
  
-Purely for interest's sake, the Vivado-generated HDF file is a Zip-format file, which can be examined and/or unpacked via ''​unzip'', as in:+''​system.xml'':​
  
 <​code>​ <​code>​
-$ unzip -l system.hdf +<?xml version="​1.0"?>​ 
-Archive: ​ system.hdf +<Project Version="​1"​ Minor="​3"​ DIGEST="">​ 
-02nWkJ+EVzMl9sp/​6/​wZQgcY7ZuqXJnPS/​fNhuMgTyrp0+        <​TOOL_VERSION Version="​2019.1"/>​ 
-  ​Length ​     Date    Time    ​Name +        <​MODE ​Name="​Post-Synthesis"/>​ 
----------  ---------- -----   ---- +        <​SYSTEMINFO BOARD="​xilinx.com:​zcu102:​3.3"​ PART="​xczu9eg-ffvb1156-2-e" ARCH="​zynquplus"​ PACKAGE="​ffvb1156"​ DEVICE="​xczu9eg"​ SPEED="​-2" LUT="​274080"​ FF="​548160"​ BRAM="​912"​ DSP="​2520"/>​ 
-      ​913 ​ 05-27-2019 10:21   ​sysdef.xml +        <​HIERARCHY Name="​design_1_wrapper"/>​ 
-   438549 ​ 05-27-2019 10:21   ​DMA_PCIe_EP.hwh +        <​File Type="​HW_HANDOFF"​ Name="​design_1.hwh" DESIGN_HIERARCHY="​design_1_i"​ BD_TYPE="​DEFAULT_BD"/>​ 
-    ​84343 ​ 05-27-2019 10:21   ​DMA_PCIe_EP_bd.tcl +        <​File Type="​BD_TCL"​ Name="​design_1_bd.tcl"/> 
-   750745 ​ 05-27-2019 10:21   psu_init.c +        <​File Type="​PS_FSBL_INIT"​ Name="psu_init.c"/> 
-  ​1425922 ​ 05-27-2019 10:21   psu_init.h +        <​File Type="​PS_FSBL_INIT"​ Name="psu_init.h"/> 
-   749909 ​ 05-27-2019 10:21   psu_init_gpl.c +        <​File Type="​PS_FSBL_INIT_GPL"​ Name="psu_init_gpl.c"/> 
-  ​1425308 ​ 05-27-2019 10:21   psu_init_gpl.h +        <​File Type="​PS_FSBL_INIT_GPL"​ Name="psu_init_gpl.h"/> 
-    ​48659 ​ 05-27-2019 10:21   psu_init.html +        <​File Type="​PS_INIT_HELP"​ Name="psu_init.html"/> 
-   731011 ​ 05-27-2019 10:21   psu_init.tcl +        <​File Type="​PS_XMD_INIT"​ Name="psu_init.tcl"/> 
- 36343237 ​ 05-27-2019 10:21   ​DMA_PCIe_EP_wrapper.bit +        <​File Type="​BIT"​ Name="​design_1_wrapper.bit"/> 
---------- ​                    ​------- +        <​BOARD Type="​NotIntegrated">​ 
- 41998596 ​                    10 files +                <​BASEBOARD Name="​xilinx.com:​zcu102:​3.3">​ 
-$+                </​BASEBOARD>​ 
 +        </​BOARD>​ 
 +        <​USEDRESOURCES LUT="​300"​ FF="​1"​ BRAM="​0"​ DSP="​0"/>​ 
 +</​Project>​
 </​code>​ </​code>​
- 
-As you can see, if you seem to be missing the FPGA bitstream file, it might already be in the HDF file. 
- 
 ===== PetaLinux build procedure ===== ===== PetaLinux build procedure =====
  
 ==== Preparing for the build ==== ==== Preparing for the build ====
  
-First, source the appropriate environment file for PetaLinux ​2018.3; something like:+First, source the appropriate environment file for PetaLinux ​2019.1; something like:
  
 <​code>​ <​code>​
-$ source .../PetaLinux/​2018.3/​settings.sh+$ source .../2019.1/​settings.sh 
 +$ echo $PETALINUX 
 +/​home/​rpjday/​xilinx/​2019.1 
 +$
 </​code>​ </​code>​
  
Line 54: Line 61:
 $ petalinux-create \ $ petalinux-create \
   --type project \   --type project \
-  --name ​myproj ​\+  --name ​zcu102 ​\
   --template zynqMP   --template zynqMP
-$ cd myproj+$ cd zcu102
 </​code>​ </​code>​
  
 +End result:
 +
 +<​code>​
 +$ tree -d
 +.
 +└── project-spec
 +    ├── configs
 +    ├── hw-description
 +    └── meta-user
 +        ├── conf
 +        ├── recipes-apps
 +        │   ├── gpio-demo
 +        │   │   └── files
 +        │   └── peekpoke
 +        │   ​    ​└── files
 +        ├── recipes-bsp
 +        │   ├── device-tree
 +        │   │   └── files
 +        │   │   ​    ​└── multi-arch
 +        │   └── u-boot
 +        │   ​    ​└── files
 +        └── recipes-core
 +            └── images
 +</​code>​
 ==== Incorporating the HDF file ==== ==== Incorporating the HDF file ====
  
Line 64: Line 95:
  
 <​code>​ <​code>​
-$ petalinux-config --get-hw-description <dirname of HDF File>+$ petalinux-config --get-hw-description <dirname of ZCU102 ​HDF File>
 </​code>​ </​code>​
  
-at which time you will be placed in the PetaLinux "​System Configuration"​ utility; if you have nothing to change, simply exit and save your configuration.+at which time you will be placed in the PetaLinux "​System Configuration"​ utility; if you have nothing to change, simply exit and //save your configuration//.
  
-==== Configuring the project ​kernel ====+Major result is new content under ''​project-spec/​meta-plnx-generated''​.
  
-If you want to configure the project'​s kernel, first ensure that you have some appropriate terminal emulation to support the configuration window. For example, if you're connected to the build host via SSH, and that build host has the ''​screen''​ utility installed, simply set: +===== Configuration options =====
- +
-<​code>​ +
-$ export TERM=screen +
-</​code>​ +
- +
-Once that's done, you can configure the kernel with:+
  
 <​code>​ <​code>​
 +$ petalinux-config
 +$ petalinux-config -c bootloader ​  ​[virtual/​fsbl]
 +$ petalinux-config -c u-boot ​      ​[virtual/​bootloader]
 $ petalinux-config -c kernel $ petalinux-config -c kernel
 +$ petalinux-config -c rootfs
 +$ petalinux-config -c busybox
 +$ petalinux-config -c pmufw
 +$ petalinux-config -c device-tree
 </​code>​ </​code>​
  
-As a common example of configuration (necessary for the Sidewinder board), you can select the PCI-related kernel feature: +===== The build process ​=====
- +
-  * Bus Support -> +
-    * PCI host controller drivers -> +
-      * Xilinx XDMA PL PCIe host bridge support +
- +
-then save and exit. +
- +
-==== The build process ====+
  
 Now that all of the project configuration is complete, kick off the PetaLinux build with: Now that all of the project configuration is complete, kick off the PetaLinux build with:
xilinx_running_petalinux.1559128837.txt.gz · Last modified: 2019/05/29 11:20 by rpjday