PYNQ v2.7 for zedboard: do_compile error

I am using PYNQ v2.7 to build it for zedboard. Xilinx Vitis 2020.2 and petalinux 2020.2 using to build.

I am using the prebuilt board-agnostic image to build, but I am getting errors shown below.
make PREBUILT=./focal.arm.2.7.0_2021_11_17.tar.gz BOARDS=zed

ERROR: device-tree-xilinx-v2020.2+gitAUTOINC+f725aaecff-r0 do_compile: Error executing a python function in exec_python_func() autogenerated:

The stack trace of python calls that resulted in this exception/failure was:
File: ‘exec_python_func() autogenerated’, lineno: 2, function:
0001:
*** 0002:devicetree_do_compile(d)
0003:
File: ‘/workspace/PYNQ/sdbuild/build/zed/petalinux_project/components/yocto/layers/core/meta/classes/devicetree.bbclass’, lineno: 131, function: devicetree_do_compile
0127: if not(os.path.isfile(dtspath)) or not(dts.endswith(“.dts”) or devicetree_source_is_overlay(dtspath)):
0128: continue # skip non-.dts files and non-overlay files
0129: except:
0130: continue # skip if can’t determine if overlay
*** 0131: devicetree_compile(dtspath, includes, d)
0132:}
0133:
0134:devicetree_do_install() {
0135: for DTB_FILE in ls *.dtb *.dtbo; do
File: ‘/workspace/PYNQ/sdbuild/build/zed/petalinux_project/components/yocto/layers/core/meta/classes/devicetree.bbclass’, lineno: 119, function: devicetree_compile
0115: dtcargs += [“-i”, i]
0116: dtcargs += [“-o”, “{0}.{1}”.format(dtname, “dtbo” if isoverlay else “dtb”)]
0117: dtcargs += [“-I”, “dts”, “-O”, “dtb”, “{0}.pp”.format(dts)]
0118: bb.note(“Running {0}”.format(" ".join(dtcargs)))
*** 0119: subprocess.run(dtcargs, check = True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
0120:
0121:python devicetree_do_compile() {
0122: includes = expand_includes(“DT_INCLUDE”, d)
0123: listpath = d.getVar(“DT_FILES_PATH”)
File: ‘/workspace/petaliinux/2020.2/components/yocto/buildtools/sysroots/x86_64-petalinux-linux/usr/lib/python3.7/subprocess.py’, lineno: 512, function: run
0508: raise
0509: retcode = process.poll()
0510: if check and retcode:
0511: raise CalledProcessError(retcode, process.args,
*** 0512: output=stdout, stderr=stderr)
0513: return CompletedProcess(process.args, retcode, stdout, stderr)
0514:
0515:
0516:def list2cmdline(seq):
Exception: subprocess.CalledProcessError: Command ‘[‘dtc’, ‘-@’, ‘-@’, ‘-p’, ‘0x1000’, ‘-i’, ‘/workspace/PYNQ/sdbuild/build/zed/petalinux_project/build/tmp/work-shared/zynq-generic/kernel-source/scripts/dtc/include-prefixes’, ‘-i’, ‘/workspace/PYNQ/sdbuild/build/zed/petalinux_project/build/tmp/work-shared/zynq-generic/kernel-source/arch/arm/boot/dts’, ‘-i’, ‘/workspace/PYNQ/sdbuild/build/zed/petalinux_project/project-spec/configs/…/…/components/plnx_workspace/device-tree/device-tree’, ‘-i’, ‘/workspace/PYNQ/sdbuild/build/zed/petalinux_project/build/tmp/work/zynq_generic-xilinx-linux-gnueabi/device-tree/xilinx-v2020.2+gitAUTOINC+f725aaecff-r0’, ‘-o’, ‘system-top.dtb’, ‘-I’, ‘dts’, ‘-O’, ‘dtb’, ‘system-top.dts.pp’]’ returned non-zero exit status 2.

Subprocess output:
/workspace/PYNQ/sdbuild/build/zed/petalinux_project/build/tmp/work/zynq_generic-xilinx-linux-gnueabi/device-tree/xilinx-v2020.2+gitAUTOINC+f725aaecff-r0/system-user.dtsi:7.32-9.6: ERROR (duplicate_label): /amba/ethernet@e000b000/ethernet-phy@1: Duplicate label ‘ethernet_phy’ on /amba/ethernet@e000b000/ethernet-phy@1 and /amba/ethernet@e000b000/ethernet-phy@0
/workspace/PYNQ/sdbuild/build/zed/petalinux_project/build/tmp/work/zynq_generic-xilinx-linux-gnueabi/device-tree/xilinx-v2020.2+gitAUTOINC+f725aaecff-r0/system-user.dtsi:12.24-18.11: ERROR (duplicate_label): /phy0: Duplicate label ‘usb_phy0’ on /phy0 and /phy0@e0002000
ERROR: Input tree has errors, aborting (use -f to force output)

ERROR: Logfile of failure stored in: /workspace/PYNQ/sdbuild/build/zed/petalinux_project/build/tmp/work/zynq_generic-xilinx-linux-gnueabi/device-tree/xilinx-v2020.2+gitAUTOINC+f725aaecff-r0/temp/log.do_compile.2038
ERROR: Task (/workspace/PYNQ/sdbuild/build/zed/petalinux_project/components/yocto/layers/meta-xilinx/meta-xilinx-bsp/recipes-bsp/device-tree/device-tree.bb:do_compile) failed with exit code ‘1’
NOTE: Tasks Summary: Attempted 2225 tasks of which 2001 didn’t need to be rerun and 1 failed.

Please help how to solve this problem.

Hello welcome,

Please check this build instruction on PYNQ 2.7:

https://discuss.pynq.io/t/stuck-at-extract-yocoto/4134/8?u=briansune

Hey, I will try your method without using Vagrant. Thank You

I want to ask one more thing before “make” the command can I install PyTorch and then build? Will that work? Or can we add PyTorch command in the script_host.sh ?

Please, if you know any alternative, please tell me how to install PyTorch.

Thank you for the help

Hello,

For any package related to the PYNQ, I will highly suggest you do it after the image is bootable and boot into the PYNQ ubuntu and install it. rather than using the virtual environment on Linux to install it.
As you screw up any thing will result in rebuild the image again while if you had a image built and you screw up the installation you can easily reimage the SD card.

Ohh …okay thank you so much for your help

Hey, still, I am getting the same error. I followed your steps as shown in these steps [Stuck at extract yocoto - #8 by briansune].

ERROR: device-tree-xilinx-v2020.2+gitAUTOINC+f725aaecff-r0 do_compile: Error executing a python function in exec_python_func() autogenerated:

The stack trace of python calls that resulted in this exception/failure was:
File: ‘exec_python_func() autogenerated’, lineno: 2, function:
0001:
*** 0002:devicetree_do_compile(d)
0003:
File: ‘/home/PYNQ/sdbuild/build/zed/petalinux_project/components/yocto/layers/core/meta/classes/devicetree.bbclass’, lineno: 131, function: devicetree_do_compile
0127: if not(os.path.isfile(dtspath)) or not(dts.endswith(“.dts”) or devicetree_source_is_overlay(dtspath)):
0128: continue # skip non-.dts files and non-overlay files
0129: except:
0130: continue # skip if can’t determine if overlay
*** 0131: devicetree_compile(dtspath, includes, d)
0132:}
0133:
0134:devicetree_do_install() {
0135: for DTB_FILE in ls *.dtb *.dtbo; do
File: ‘/home/PYNQ/sdbuild/build/zed/petalinux_project/components/yocto/layers/core/meta/classes/devicetree.bbclass’, lineno: 119, function: devicetree_compile
0115: dtcargs += [“-i”, i]
0116: dtcargs += [“-o”, “{0}.{1}”.format(dtname, “dtbo” if isoverlay else “dtb”)]
0117: dtcargs += [“-I”, “dts”, “-O”, “dtb”, “{0}.pp”.format(dts)]
0118: bb.note(“Running {0}”.format(" ".join(dtcargs)))
*** 0119: subprocess.run(dtcargs, check = True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
0120:
0121:python devicetree_do_compile() {
0122: includes = expand_includes(“DT_INCLUDE”, d)
0123: listpath = d.getVar(“DT_FILES_PATH”)
File: ‘/home/PYNQ/Xilinx/petalinux/components/yocto/buildtools/sysroots/x86_64-petalinux-linux/usr/lib/python3.7/subprocess.py’, lineno: 512, function: run
0508: raise
0509: retcode = process.poll()
0510: if check and retcode:
0511: raise CalledProcessError(retcode, process.args,
*** 0512: output=stdout, stderr=stderr)
0513: return CompletedProcess(process.args, retcode, stdout, stderr)
0514:
0515:
0516:def list2cmdline(seq):
Exception: subprocess.CalledProcessError: Command ‘[‘dtc’, ‘-@’, ‘-@’, ‘-p’, ‘0x1000’, ‘-i’, ‘/home/PYNQ/sdbuild/build/zed/petalinux_project/build/tmp/work-shared/zynq-generic/kernel-source/arch/arm/boot/dts’, ‘-i’, ‘/home/PYNQ/sdbuild/build/zed/petalinux_project/build/tmp/work-shared/zynq-generic/kernel-source/scripts/dtc/include-prefixes’, ‘-i’, ‘/home/PYNQ/sdbuild/build/zed/petalinux_project/build/tmp/work/zynq_generic-xilinx-linux-gnueabi/device-tree/xilinx-v2020.2+gitAUTOINC+f725aaecff-r0’, ‘-i’, ‘/home/PYNQ/sdbuild/build/zed/petalinux_project/project-spec/configs/…/…/components/plnx_workspace/device-tree/device-tree’, ‘-o’, ‘system-top.dtb’, ‘-I’, ‘dts’, ‘-O’, ‘dtb’, ‘system-top.dts.pp’]’ returned non-zero exit status 2.

Subprocess output:
/home/PYNQ/sdbuild/build/zed/petalinux_project/build/tmp/work/zynq_generic-xilinx-linux-gnueabi/device-tree/xilinx-v2020.2+gitAUTOINC+f725aaecff-r0/system-user.dtsi:7.32-9.6: ERROR (duplicate_label): /amba/ethernet@e000b000/ethernet-phy@1: Duplicate label ‘ethernet_phy’ on /amba/ethernet@e000b000/ethernet-phy@1 and /amba/ethernet@e000b000/ethernet-phy@0
/home/PYNQ/sdbuild/build/zed/petalinux_project/build/tmp/work/zynq_generic-xilinx-linux-gnueabi/device-tree/xilinx-v2020.2+gitAUTOINC+f725aaecff-r0/system-user.dtsi:12.24-18.11: ERROR (duplicate_label): /phy0: Duplicate label ‘usb_phy0’ on /phy0 and /phy0@e0002000
ERROR: Input tree has errors, aborting (use -f to force output)

ERROR: Logfile of failure stored in: /home/PYNQ/sdbuild/build/zed/petalinux_project/build/tmp/work/zynq_generic-xilinx-linux-gnueabi/device-tree/xilinx-v2020.2+gitAUTOINC+f725aaecff-r0/temp/log.do_compile.9271
ERROR: Task (/home/PYNQ/sdbuild/build/zed/petalinux_project/components/yocto/layers/meta-xilinx/meta-xilinx-bsp/recipes-bsp/device-tree/device-tree.bb:do_compile) failed with exit code ‘1’
NOTE: Tasks Summary: Attempted 2225 tasks, of which 2001 didn’t need to be rerun and 1 failed.

Please tell me how to solve this problem.
Thank You

It looks like your dtsi had some issue.
What is your base overlay project?
Empty Zynq or there are additional device that had set?

Yeah, it is fixed. There was a problem with the board file. In the project_bsp folder, I put zedboard xsa in that folder, and after that, I build it, and it was working.

2 Likes

Great to hear it is working now. =]

2 Likes

Thank You so much for the help.

1 Like