Wiki

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
resources:tools-software:linux-build:generic:zynq [16 Apr 2019 15:31] – [Setup cross compile environment variables] Michael Hennerichresources:tools-software:linux-build:generic:zynq [02 Feb 2024 16:08] (current) – update: master -> main Marcelo Schmitt
Line 3: Line 3:
 ===== The script method ===== ===== The script method =====
  
-We provide [[https://raw.githubusercontent.com/analogdevicesinc/wiki-scripts/master/linux/build_zynq_kernel_image.sh|a script that does automates]] the build for Zynq using the Linaro toolchain.+We provide [[https://raw.githubusercontent.com/analogdevicesinc/wiki-scripts/main/linux/build_zynq_kernel_image.sh|a script that does automates]] the build for Zynq using the Linaro toolchain.
  
 The script takes up to 3 parameters, but if left blank, it uses defaults: The script takes up to 3 parameters, but if left blank, it uses defaults:
Line 18: Line 18:
 ==== Running the script in one line [with defaults] ==== ==== Running the script in one line [with defaults] ====
 <code> <code>
-wget https://raw.githubusercontent.com/analogdevicesinc/wiki-scripts/master/linux/build_zynq_kernel_image.sh && chmod +x build_zynq_kernel_image.sh && ./build_zynq_kernel_image.sh +wget https://raw.githubusercontent.com/analogdevicesinc/wiki-scripts/main/linux/build_zynq_kernel_image.sh && chmod +x build_zynq_kernel_image.sh && ./build_zynq_kernel_image.sh 
 </code> </code>
  
 +
 +===== Building using Petalinux =====
 +
 +Please see here: [[resources:tools-software:linux-build:generic:petalinux|Building with Petalinux]]
  
 ===== On the development host ===== ===== On the development host =====
Line 37: Line 41:
  
 <note tip> <note tip>
-If not otherwise required always use the latest release!+Use the latest release, if not required otherwise!
 </note> </note>
  
Line 48: Line 52:
 | 2018_R1 | | 2018_R1 |
 | 2018_R2 | | 2018_R2 |
 +| 2019_R1 |
 +| 2019_R2 |
 +| 2021_R1 |
  
  
 <code> <code>
-dave@hal9000:~/github-linux-build/linux$ git checkout origin/2015_R2 -b 2015_R2 +dave@hal9000:~/github-linux-build/linux$ git checkout origin/2021_R1 -b 2021_R1 
-Branch 2015_R2 set up to track remote branch 2015_R2 from origin. +Branch 2021_R1 set up to track remote branch 2021_R1from origin. 
-Switched to a new branch '2015_R2'+Switched to a new branch '2021_R1'
 </code> </code>
  
 ==== Setup cross compile environment variables ==== ==== Setup cross compile environment variables ====
 +
  
 There are a few toolchains that can be used. The Xilinx toolchain is recommended, but the Linaro toolchain can also be used. There are a few toolchains that can be used. The Xilinx toolchain is recommended, but the Linaro toolchain can also be used.
Line 64: Line 72:
 === Using the Xilinx toolchain === === Using the Xilinx toolchain ===
  
-^ Release names and Branches ^ Required Vivado/SDK versions ^+^ Release names and Branches ^ Required Vivado/Vitis versions ^
 | 2014_R2 | Vivado 2014.2 |  | 2014_R2 | Vivado 2014.2 | 
 | 2015_R2 | Vivado 2015.2 |  | 2015_R2 | Vivado 2015.2 | 
Line 72: Line 80:
 | 2018_R1 | Vivado 2017.4 |  | 2018_R1 | Vivado 2017.4 | 
 | 2018_R2 | Vivado 2018.2 |  | 2018_R2 | Vivado 2018.2 | 
- +| 2019_R1 | Vivado 2018.3 |  
-Vivado 2015.2 SDK may be installed into a different directory+| 2019_R2 | Vivado 2019.1 |  
 +| 2021_R1 | Vivado 2021.1 | 
  
 <code> <code>
-dave@hal9000:~/github-linux-build/linux$ source /opt/Xilinx/SDK/2015.2/settings64.sh+dave@hal9000:~/github-linux-build/linux$ source $PATH_to_Xilinx/Xilinx/Vitis/$Vitis_version/settings64.sh
 </code> </code>
  
Line 82: Line 91:
 <code> <code>
 dave@hal9000:~/github-linux-build/linux$ export ARCH=arm dave@hal9000:~/github-linux-build/linux$ export ARCH=arm
-dave@hal9000:~/github-linux-build/linux$ export CROSS_COMPILE=arm-xilinx-linux-gnueabi-+dave@hal9000:~/github-linux-build/linux$ export CROSS_COMPILE="arm-linux-gnueabihf-"
 </code> </code>
 +
 +<note important>
 +Find the path to the Xilinx installation folder, and then use it to replace this string: **$PATH_to_Xilinx** that is written above. Same goes for the **$Vitis_version**, where you choose the Vitis version.  
 +</note>
  
 === Using the Linaro toolchain === === Using the Linaro toolchain ===
  
 Alternatively, the Linaro toolchain/compiler can be used to compile to kernel. Alternatively, the Linaro toolchain/compiler can be used to compile to kernel.
-Linaro compilers (that work with Zynq) can be downloaded from: https://releases.linaro.org/components/toolchain/binaries/latest-5/arm-linux-gnueabi/+Linaro compilers (that work with Zynq) can be downloaded from:  
 +https://releases.linaro.org/components/toolchain/binaries/latest-7/arm-linux-gnueabi/ . Always use the latest release just in case.
  
 Example: Example:
 <code> <code>
-wget https://releases.linaro.org/components/toolchain/binaries/latest-5/arm-linux-gnueabi/gcc-linaro-5.5.0-2017.10-x86_64_arm-linux-gnueabi.tar.xz +wget https://releases.linaro.org/components/toolchain/binaries/latest-7/arm-linux-gnueabi/gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabi.tar.xz 
-tar -xvf gcc-linaro-5.5.0-2017.10-x86_64_arm-linux-gnueabi.tar.xz+tar -xvf gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabi.tar.xz
 </code> </code>
  
 <code> <code>
 export ARCH=arm export ARCH=arm
-export CROSS_COMPILE=$(pwd)/gcc-linaro-5.5.0-2017.10-x86_64_arm-linux-gnueabi/bin/arm-linux-gnueabi-+export CROSS_COMPILE=$(pwd)/gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabi/bin/arm-linux-gnueabi-
 </code> </code>
  
 ==== Configure the kernel ==== ==== Configure the kernel ====
 +Inside the repository, generate the configuration file before building the kernel tree. The command shown below is generic and is not project specific. As long as the board is a ZYNQ FPGA, use the configuration below.
 <code> <code>
 dave@hal9000:~/github-linux-build/linux$ make zynq_xcomm_adv7511_defconfig dave@hal9000:~/github-linux-build/linux$ make zynq_xcomm_adv7511_defconfig
Line 109: Line 124:
 dave@hal9000:~/github-linux-build/linux$ dave@hal9000:~/github-linux-build/linux$
 </code> </code>
-==== Build the kernel ==== 
  
 +==== Build the kernel ====
 +Build the kernel via 'make'. This is the same for all Xilinx ZYNQ FPGAs. 
 <code> <code>
 dave@hal9000:~/github-linux-build/linux$ make -j5 UIMAGE_LOADADDR=0x8000 uImage dave@hal9000:~/github-linux-build/linux$ make -j5 UIMAGE_LOADADDR=0x8000 uImage
Line 138: Line 154:
  
 === Build the one that fits your FPGA carrier and FMC card === === Build the one that fits your FPGA carrier and FMC card ===
 +^ device tree ^ board ^ chip ^
 | zynq-adrv9361-z7035-bob | [[adi>ADRV1CRR-BOB]] | [[adi>ADRV9361]] | | zynq-adrv9361-z7035-bob | [[adi>ADRV1CRR-BOB]] | [[adi>ADRV9361]] |
 | zynq-adrv9361-z7035-bob-cmos | [[adi>ADRV1CRR-BOB]] | [[adi>ADRV9361]] | | zynq-adrv9361-z7035-bob-cmos | [[adi>ADRV1CRR-BOB]] | [[adi>ADRV9361]] |
-| zynq-adrv9361-z7035-box | [[adi>ADRV1CRR-BOX]] | [[adi>ADRV9361]] |+| zynq-adrv9361-z7035-packrf | [[adi>ADRV-PACKRF]] | [[adi>ADRV9361]] |
 | zynq-adrv9361-z7035-fmc | [[adi>ADRV1CRR-FMC]] | the on-board [[adi>ADV7511]] and the [[adi>ADRV9361]] | | zynq-adrv9361-z7035-fmc | [[adi>ADRV1CRR-FMC]] | the on-board [[adi>ADV7511]] and the [[adi>ADRV9361]] |
 | zynq-adrv9361-z7035-fmc-rfcard-tdd | [[adi>ADRV1CRR-FMC]] | the on-board [[adi>ADV7511]], [[adi>ADRV9361]] and the [[adi>AD-PZSDR2400TDD-EB]] |  | zynq-adrv9361-z7035-fmc-rfcard-tdd | [[adi>ADRV1CRR-FMC]] | the on-board [[adi>ADV7511]], [[adi>ADRV9361]] and the [[adi>AD-PZSDR2400TDD-EB]] | 
 | zynq-adrv9364-z7020-bob | [[adi>ADRV1CRR-BOB]] | [[adi>ADRV9364]] | | zynq-adrv9364-z7020-bob | [[adi>ADRV1CRR-BOB]] | [[adi>ADRV9364]] |
 | zynq-adrv9364-z7020-bob-cmos | [[adi>ADRV1CRR-BOB]] | [[adi>ADRV9364]] | | zynq-adrv9364-z7020-bob-cmos | [[adi>ADRV1CRR-BOB]] | [[adi>ADRV9364]] |
-| zynq-adrv9364-z7020-box | [[adi>ADRV1CRR-BOX]] | [[adi>ADRV9364]] | +| zynq-adrv9364-z7020-packrf | [[adi>ADRV-PACKRF]] | [[adi>ADRV9364]] | 
-| zynq-mini-itx-adv7511 | [[http://zedboard.org/product/mini-itx|Mini-ITX]] | the on-board [[adi>ADV7511]] | +| zynq-coraz7s | [[https://digilent.com/reference/programmable-logic/cora-z7/start|cora-z7]] | 
-| zynq-mini-itx-adv7511-ad9361-fmcomms2-3 | [[http://zedboard.org/product/mini-itx|Mini-ITX]] | on-board [[adi>ADV7511]] and the [[/resources/eval/user-guides/ad-fmcomms2-ebz|AD-FMCOMMS2-EBZ]] or [[/resources/eval/user-guides/ad-fmcomms3-ebz|AD-FMCOMMS3-EBZ]] board | +| zynq-mini-itx-adv7511 | [[http://zedboard.org/product/mini-itx-board|Mini-ITX]] | the on-board [[adi>ADV7511]] | 
-| zynq-mini-itx-adv7511-ad9364-fmcomms4 | [[http://zedboard.org/product/mini-itx|Mini-ITX]] | the on-board [[adi>ADV7511]] and the [[/resources/eval/user-guides/ad-fmcomms4-ebz|AD-FMCOMMS4-EBZ]] board |+| zynq-mini-itx-adv7511-ad9361-fmcomms2-3 | [[http://zedboard.org/product/mini-itx-board|Mini-ITX]] | on-board [[adi>ADV7511]] and the [[/resources/eval/user-guides/ad-fmcomms2-ebz|AD-FMCOMMS2-EBZ]] or [[/resources/eval/user-guides/ad-fmcomms3-ebz|AD-FMCOMMS3-EBZ]] board | 
 +| zynq-mini-itx-adv7511-ad9364-fmcomms4 | [[http://zedboard.org/product/mini-itx-board|Mini-ITX]] | the on-board [[adi>ADV7511]] and the [[/resources/eval/user-guides/ad-fmcomms4-ebz|AD-FMCOMMS4-EBZ]] board |
 | zynq-zc702-adv7511 | [[xilinx>ZC702]] | the on-board [[adi>ADV7511]] | | zynq-zc702-adv7511 | [[xilinx>ZC702]] | the on-board [[adi>ADV7511]] |
 | zynq-zc702-adv7511-ad9361-fmcomms2-3 | [[xilinx>ZC702]] | the on-board [[adi>ADV7511]] and the [[/resources/eval/user-guides/ad-fmcomms2-ebz|AD-FMCOMMS2-EBZ]] or [[/resources/eval/user-guides/ad-fmcomms3-ebz|AD-FMCOMMS3-EBZ]] board | | zynq-zc702-adv7511-ad9361-fmcomms2-3 | [[xilinx>ZC702]] | the on-board [[adi>ADV7511]] and the [[/resources/eval/user-guides/ad-fmcomms2-ebz|AD-FMCOMMS2-EBZ]] or [[/resources/eval/user-guides/ad-fmcomms3-ebz|AD-FMCOMMS3-EBZ]] board |
Line 177: Line 195:
 | zynq-zed-imageon | [[http://zedboard.org/product/zedboard|Zed Board]] | FMC-IMAGEON | | zynq-zed-imageon | [[http://zedboard.org/product/zedboard|Zed Board]] | FMC-IMAGEON |
  
 +Building the device tree uses 'make' by turning the .dts file to a .dtb. The command is simply 'make' plus the device tree name with a .dtb file extension.
  
 <code> <code>
Line 185: Line 204:
  
 ==== Copy the generated files to your SD Card ==== ==== Copy the generated files to your SD Card ====
 +The output files for building the kernel and device tree are **uImage** and **<device_tree_name>.dtb**. Refer to the code below to find their respective output directories. Take note that the device tree file needs to be renamed to **devicetree.dtb**. See [[:resources:tools-software:linux-software:kuiper-linux]] for more information in configuring the SD card.
 <code> <code>
 dave@hal9000:~/github-linux-build/linux$ cp arch/arm/boot/uImage /media/BOOT/uImage dave@hal9000:~/github-linux-build/linux$ cp arch/arm/boot/uImage /media/BOOT/uImage
resources/tools-software/linux-build/generic/zynq.1555421495.txt.gz · Last modified: 16 Apr 2019 15:31 by Michael Hennerich