Post Go back to editing

Building HDL from Reference Files

Category: Hardware
Product Number: AD4630-24
We're having trouble building the HDL from source and capturing samples using the python scripts from github. We're using the board design available here (github.com/.../hdl) and the python drivers here (github.com/.../pyadi-iio) to capture data.

Here our are steps for generating the build image:
We're pulling the repo down, following the steps here(wiki.analog.com/.../build) to build the .xsa. Then running this script to generate the BOOT.bin based on these steps (wiki.analog.com/.../build-the-zynq-boot-image). We're using the boot files that came with the sdcard from zynq-common.

We've tried building in both Vivado/Vitas 2021. and 2023. I can tell the capture is not correct when we are using test signals to capture.

We also verified the zedboard and FMC card are working by using the SD card that came with the board and the same python script to capture data with the SD card that came with the board.
Any thoughts on what could be wrong with our build process? Does anyone have experience using the HDL from GitHub to work with this FMC card?

Thread Notes

Parents Reply Children
  • Hi,

    Here is a guide on how to build the HDL system_top.xsa, needed by the build_zynq_boot_bin.sh build_boot_bin.sh script to generate the BOOT.BIN.

    https://analogdevicesinc.github.io/hdl/user_guide/build_hdl.html#building-an-amd-project

    As my colleague said, if you used the main branch from HDL, you should use the main branch on Linux as well. This means you need to build the uImage from main branch, like this: https://wiki.analog.com/resources/tools-software/linux-build/generic/zynq. You don't take it from zynq-common folder from SD card.

    If you changed the device tree, then that one you need to build as well, to create the .dtb file. Here is an example: https://wiki.analog.com/resources/tools-software/linux-build/generic/zynq#build_the_devicetree_fcmomms2345 

    Best regards,
    iulia

  • Am I understanding the following steps correctly? I did the following but am not able to get data.

    Building the HDL
    1. Pull down HDL repo from github, using the main branch
    2. cd /hdl/projects/ad4630_fmc
    3. Build the .xsa file
    - make ADI_IGNORE_VERSION_CHECK=1
    at this point, system_top.xsa is in should be in zed/ADIIGNOREVERSIONCHECK/ad4630_fmc_zed.sdk

    Next, I'm generating the BOOT.bin using the system_top.xsa file. But first, I built the u-boot.elf doing the following:
    4. Download u-boot-xlnx
    5. cd u-boot-xlnx
    6. edit my bashrc to include:
    - export CROSS_COMPILE=arm-linux-gnueabihf-
    - export ARCH=arm
    6. run source ~/.bashrc in the same terminal
    7. continue running commands to build u-boot.elf
    - make distclean
    - make xilinx_zynq_virt_defconfig
    - export DEVICE_TREE="zync-zc702"
    - make

    Next, I'm buidling the BOOT.bin using .xsa and .elf files
    8. Download the build_boot_bin.sh script and use "chmod +x" on it
    9. run the script:
    - ./build_boot_bin.sh path/to/.xsa path/to/u-boot.elf
    10. The output is in a folder, "output_boot_bin"
    11. Copy the BOOT.bin generated file to the SD Card with the Kiper Linux install, top directory

    Appreciate any help on clarifying this.

    I also didn't see where the build_zynq_boot_bin.sh script is that was referenced. I'm using Vivado/Vitis v2021.2
  • I also didn't see where the build_zynq_boot_bin.sh script is that was referenced. I'm using Vivado/Vitis v2021.2

    You're right; the name is build_boot_bin.sh. I got a bit confused and mixed the name (because for Zynq UltraScale is build_zynqmp_boot_bin.sh). I corrected my previous reply.

  • The steps you're describing, they're good, except for steps 4 and 7.

    4. Download u-boot-xlnx

    Did you use our repohttps://github.com/analogdevicesinc/u-boot-xlnx 

    7. continue running commands to build u-boot.elf
    - make distclean
    - make xilinx_zynq_virt_defconfig
    - export DEVICE_TREE="zync-zc702"
    - make

    Replace the commands you said, with these:

    make distclean
    make zynq_zc702_defconfig
    make

    What FPGA are you using? Because if you use Zedboard, you need to replace the above command with make zynq_zed_defconfig

    About the Linux files (devicetree.dtb and uImage) where did you take them from?

    And I want to mention again this:

    As my colleague said, if you used the main branch from HDL, you should use the main branch on Linux as well. This means you need to build the uImage from main branch, like this: https://wiki.analog.com/resources/tools-software/linux-build/generic/zynq. You don't take it from zynq-common folder from SD card.

    If you changed the device tree, then that one you need to build as well, to create the .dtb file. Here is an example: https://wiki.analog.com/resources/tools-software/linux-build/generic/zynq#build_the_devicetree_fcmomms2345 

    Best regards,
    Iulia

  • Yes, I'm using your repo here: https://github.com/analogdevicesinc/u-boot-xlnx 

    I am using a Zedboard. But when I run "make zynq_zed_deconfig" I get the following error:

    ***
    *** Can't find default configuration "arch/../configs/zynq_zed_deconfig"!
    ***
    make[1]: *** [scripts/kconfig/Makefile:96: zynq_zed_deconfig] Error 1
    make: *** [Makefile:586: zynq_zed_deconfig] Error 2

    For the uImage, I was following the steps at the top of this page: https://wiki.analog.com/resources/tools-software/linux-build/generic/zynq

    1. clone the ADI kernel tree
    2. download the Linaro GCC toolchain [if no other is specified]
    3. build the ADI kernel tree
    4. export/copy the Image file and device tree file out of the kernel build folder

    Can you please confirm how I should be generating the .dtb and uImage files?

    Thanks

  • For building the u-boot:

    But when I run "make zynq_zed_deconfig"

    It is defconfig. You missed the F.

    See the below screenshot on how I built the defconfig file:

    Then when running "make", it succeeds for me, after printing lots of messages which I can't upload in a screenshot here.

    For building the ADI Linux kernel (uImage) and device tree blob:

    git clone https://github.com/analogdevicesinc/linux.git

    cd linux/
    source $PATH_to_Xilinx/Xilinx/Vitis/$Vitis_version/settings64.sh
    export ARCH=arm
    export CROSS_COMPILE="arm-linux-gnueabihf-"
    make zynq_xcomm_adv7511_defconfig
    make -j5 UIMAGE_LOADADDR=0x8000 uImage
    make zynq-zed-adv7511-ad4630-24.dtb (if this is how your dts file is named)

    Then as you said, copy the uImage (and not Image!) from arch/arm/boot and .dtb file from arch/arm/boot/dts into the BOOT partition of the SD card. The .dtb file you rename it as devicetree.dtb

    Did you do these steps?

  • I did add the source and export lines to my .bashrc and ran source in the terminal for those to take effect.

    I ran without the typo and get the following results.

    make distclean

      CLEAN   scripts/basic
      CLEAN   scripts/kconfig

    make zynq_zed_defconfig

      HOSTCC  scripts/basic/fixdep
      HOSTCC  scripts/kconfig/conf.o
      YACC    scripts/kconfig/zconf.tab.c
      LEX     scripts/kconfig/zconf.lex.c
      HOSTCC  scripts/kconfig/zconf.tab.o
      HOSTLD  scripts/kconfig/conf
    ***
    *** Can't find default configuration "arch/../configs/zynq_zed_defconfig"!
    ***
    make[1]: *** [scripts/kconfig/Makefile:96: zynq_zed_defconfig] Error 1
    make: *** [Makefile:586: zynq_zed_defconfig] Error 2

    I also reran "make distclean" and tried rerunning with "zynq_xcomm_adv7511_defconfig", here's the output:

      HOSTCC  scripts/basic/fixdep
      HOSTCC  scripts/kconfig/conf.o
      YACC    scripts/kconfig/zconf.tab.c
      LEX     scripts/kconfig/zconf.lex.c
      HOSTCC  scripts/kconfig/zconf.tab.o
      HOSTLD  scripts/kconfig/conf
    ***
    *** Can't find default configuration "arch/../configs/zynq_zed_defconfig"!
    ***
    make[1]: *** [scripts/kconfig/Makefile:96: zynq_zed_defconfig] Error 1
    make: *** [Makefile:586: zynq_zed_defconfig] Error 2

    I looked at the config files here: https://github.com/analogdevicesinc/u-boot-xlnx/tree/master/configs

    I don't see anything that mentions zed or xcomm. Is there a branch other than the main branch that I should be using? Or another config?

  • Ok, I see you're mixing up the repos and commands.

    I'm sorry for not being clear enough, I confused you with the other make command of a defconfig file.

    I edited my response above for clarity, and added a screenshot.

    I don't see anything that mentions zed or xcomm.

    configs/zynq_zed_defconfig

    Best regards,
    Iulia

  • Ok, thanks for clarifying. I think I'm on the right track.

    I was able to run the following commands without any errors, "make zynq_zed_defconfig", "make"

    However, I don't see the boot folder in the path /arc/arm/boot generated. I do get some warnings on running both commands, so I'm not sure if that is having an impact. for example when I run "make zynq_zed_defconfig" I get:

    In file included from scripts/kconfig/zconf.tab.c:2468:
    scripts/kconfig/confdata.c:774:20: warning: ‘.tmpconfig.’ directive writing 11 bytes into a region of size between 1 and 4097 [-Wformat-overflow=]
      774 |   sprintf(tmpname, "%s.tmpconfig.%d", dirname, (int)getpid());
          |                    ^~~~~~~~~~~~~~~~~
    In file included from /usr/include/stdio.h:867,
                     from scripts/kconfig/zconf.tab.c:82:
    /usr/include/x86_64-linux-gnu/bits/stdio2.h:36:10: note: ‘__builtin___sprintf_chk’ output between 13 and 4119 bytes into a destination of size 4097
       36 |   return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
          |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       37 |       __bos (__s), __fmt, __va_arg_pack ());

    And when running "make" I get:

    include/linux/log2.h:19:1: warning: ignoring attribute 'noreturn' because it conflicts with attribute 'const' [-Wattributes]
       19 | int ____ilog2_NaN(void);

    Do I need to run additional steps to generate the uImage nad dtb file?

  • Do I need to run additional steps to generate the uImage nad dtb file?

    No. Exactly those steps that I have showed you.

    1. The arch/arm/boot folder is found in the Linux repository, because there is where you ran make (...) uImage and make (...) .dtb, right?
    2. Can you give me the output of the command? which vitis
    3. Can you try again all the steps I showed previously in this reply (click the link), but replacing the CROSS_COMPILE line with this one?
      export CROSS_COMPILE="/$PATH_to_Xilinx/Xilinx/Vitis/$vitis_version/gnu/aarch32/lin/gcc-arm-linux-gnueabi/bin/arm-linux-gnueabihf-"