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 [07 Jun 2021 14:23] – Change path & cross_compile Iulia Moldovanresources: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>
  
Line 54: Line 54:
 | 2019_R1 | | 2019_R1 |
 | 2019_R2 | | 2019_R2 |
 +| 2021_R1 |
  
  
 <code> <code>
-dave@hal9000:~/github-linux-build/linux$ git checkout origin/2019_R2 -b 2019_R2 +dave@hal9000:~/github-linux-build/linux$ git checkout origin/2021_R1 -b 2021_R1 
-Branch 2019_R2 set up to track remote branch 2019_R2 from origin. +Branch 2021_R1 set up to track remote branch 2021_R1from origin. 
-Switched to a new branch '2019_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 70: 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 80: Line 82:
 | 2019_R1 | Vivado 2018.3 |  | 2019_R1 | Vivado 2018.3 | 
 | 2019_R2 | Vivado 2019.1 |  | 2019_R2 | Vivado 2019.1 | 
- +| 2021_R1 | Vivado 2021.1 
-Vivado 2019.1 SDK may be installed into a different directory+
  
 <code> <code>
-dave@hal9000:~/github-linux-build/linux$ source $PATH_to_Xilinx/Xilinx/SDK/$SDK_version/gnu/aarch32/lin/gcc-arm-linux-gnueabi/bin/settings64.sh+dave@hal9000:~/github-linux-build/linux$ source $PATH_to_Xilinx/Xilinx/Vitis/$Vitis_version/settings64.sh
 </code> </code>
  
Line 94: Line 95:
  
 <note important> <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 **$SDK_version**, where you choose the SDK version.  +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> </note>
  
Line 100: Line 101:
  
 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 121: 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 150: 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]] |
Line 158: Line 163:
 | zynq-adrv9364-z7020-bob-cmos | [[adi>ADRV1CRR-BOB]] | [[adi>ADRV9364]] | | zynq-adrv9364-z7020-bob-cmos | [[adi>ADRV1CRR-BOB]] | [[adi>ADRV9364]] |
 | zynq-adrv9364-z7020-packrf | [[adi>ADRV-PACKRF]] | [[adi>ADRV9364]] | | zynq-adrv9364-z7020-packrf | [[adi>ADRV-PACKRF]] | [[adi>ADRV9364]] |
 +| zynq-coraz7s | [[https://digilent.com/reference/programmable-logic/cora-z7/start|cora-z7]] |
 | zynq-mini-itx-adv7511 | [[http://zedboard.org/product/mini-itx-board|Mini-ITX]] | the on-board [[adi>ADV7511]] | | zynq-mini-itx-adv7511 | [[http://zedboard.org/product/mini-itx-board|Mini-ITX]] | the on-board [[adi>ADV7511]] |
 | 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-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 |
Line 189: 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 197: 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.1623068610.txt.gz · Last modified: 07 Jun 2021 14:23 by Iulia Moldovan