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
  • Hi  ,

    Can you give us more details on what exactly is not working, and what & how you tested? To have an overall idea of what has been done so far.

    What branch did you use? I'm asking for both repos.

    What files did you upload onto the SD card?

    Also if you can post the contents that the command dmesg is printing. This command should be run in the terminal connected to your Zedboard.

    Best regards,
    Iulia

  • Hi,

    I'll start with the main branch on the repo. I pulled down the repo and ran:
    make -C projects/ad4630_fmc/ build2=1

    Using theses steps and build_boot_bin.sh here (wiki.analog.com/.../build-the-zynq-boot-image), made a Boot.bin file using the .xsa file in projects/ad4630_fmc/zed/ad4630_fmc_zed.sdk folder.

    I use a sdcard to make a kiper imageusing these steps wiki.analog.com/.../adi-kuiper_images_for_ace

    Then copy the files to the SDCard. I'm sure that the way I make the SDCard is fine because when I copy the BOOT.bin from the SDCard that came with the FMC card, everything works. But when I copy the BOOT.bin that I generated, the capture isn't working.

    Do you all have steps on how to build this FMC using the HDL from the repo?
  • 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-"
  • Ok, sorry about that. I'm now able to make the uImage and .dtb files.

    Do I still need to generate the BOOT.bin and if so, what .elf file should I use?

    Can you also please confirm what repo I should use to grab samples that are being sent from the zedboard?

    I'm restating the steps that I've done so far below for clarity

    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, Building the uImage and devicetree.dtb files:
    4. Download repo from github.com/.../linux
    5. cd linux
    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 uImage and devicetree
    - make distclean
    - make zynq_xcomm_adv7511_defconfig
    - make -j5 UIMAGE_LOADADDR=0x8000 uImage
    - make zynq-zed-adv7511-ad4630-24.dtb
    8. Copy /arch/arm/boot/uImage to the BOOT portion of the SD Card
    9. Copy /arch/arm/boot/dts/zynq-zed-adv7511-ad4630-24.dtb to the SD Card
    10. On the SD Card, rename zynq-zed-adv7511-ad4630-24.dtb to devicetree.dtb

    Thanks

  • When I say grab samples, I mean collect from a host machine that is connected to the zedboard. thanks

  • Hi Chaii,

    Sorry for the delay, but only now I notice step 3 is wrong.

    Step 3 should be:

    projects/ad4630_fmc/zed$ export ADI_IGNORE_VERSION_CHECK=1
    projects/ad4630_fmc/zed$ make

    Then you will find the system_top.xsa in projects/ad4630_fmc/zed/ad4630_fmc_zed.sdk

    To build the BOOT.BIN, you first need the u-boot.elf from the u-boot-xlnx repo that you used before.

    In u-boot-xlnx folder, do you remember that you ran make distclean -> make zynq_zed_defconfig -> make? I showed you in my screenshot. After that, you need to run cp u-boot "./u-boot_${defcfg//_defconfig/}.elf" to add the .elf extension to the u-boot. Then you use u-boot.elf to generate the BOOT.BIN.

    In the folder projects/ad4630_fmc/zed you need to have the u-boot.elf and the system_top.xsa.

    Then generate the BOOT.BIN, using this script: https://wiki.analog.com/resources/tools-software/linux-software/build-the-zynq-boot-image 

    Can you also please confirm what repo I should use to grab samples that are being sent from the zedboard?

    After you have the BOOT.BIN, uImage and devicetree.dtb in your BOOT partition of the SD card, and you turn on Zedboard, you can connect to it an UART cable and an Ethernet cable, and through UART to find the IP of the board. Then using that IP, you can use IIO Oscilloscope application. 

    Just download it from here, open it, and do step 2 from here: https://wiki.analog.com/resources/tools-software/linux-software/iio_oscilloscope#running_remote 

    Best regards,
    Iulia

  • Hi Iulia,

    Thank you for all your help on this! Using your additional steps, I am able to generate the SD Card and the correct build files. I tested using the python example here (https://github.com/analogdevicesinc/pyadi-iio/blob/master/examples/ad4630/ad4630_example_simple_plot.py) with success. I had to modify a line in ad4630.py that was erroring (something to do with if "differential" in ch.name:"). But after doing that, I was able to capture signals using the process to build from scratch.

    Best

Reply Children
No Data