Trenz Electronic GmbH Support Forum

Trenz Electronic Products => Trenz Electronic FPGA Modules => Topic started by: rtx on November 26, 2021, 01:19:29 PM

Title: TE0726-03-07S-1C and reference designs issues
Post by: rtx on November 26, 2021, 01:19:29 PM
Hi,
I'm trying to follow the TE0726 Test Board example https://wiki.trenz-electronic.de/display/PD/TE0726+Test+Board (https://wiki.trenz-electronic.de/display/PD/TE0726+Test+Board) with TE0726-03-07S-1C board. When I create my PetaLinux project with exported .xsa-file, after the command
> petalinux-build
I receive an error:

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: <module>
    0001:
*** 0002:devicetree_do_compile(d)
    0003:
File: '/home/vivado/test_board/os/petalinux/components/yocto/layers/core/meta/classes/devicetree.bbclass', lineno: 131, function: devicetree_do_compi
le
    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/vivado/test_board/os/petalinux/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/programs/petalinux/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', '/home/vivado/test_board/os/petalinux/build/tmp/work/zynq_gene
ric-xilinx-linux-gnueabi/device-tree/xilinx-v2020.2+gitAUTOINC+f725aaecff-r0', '-i', '/home/vivado/test_board/os/petalinux/build/tmp/work-shared/zynq
-generic/kernel-source/arch/arm/boot/dts', '-i', '/home/vivado/test_board/os/petalinux/build/tmp/work-shared/zynq-generic/kernel-source/scripts/dtc/i
nclude-prefixes', '-i', '/home/vivado/test_board/os/petalinux/project-spec/configs/../../components/plnx_workspace/device-tree/device-tree', '-o', 's
ystem-top.dtb', '-I', 'dts', '-O', 'dtb', 'system-top.dts.pp']' returned non-zero exit status 2.                                                                           
                                                                                                                                                                         
Subprocess output:                                                                                                                                                         
/home/vivado/test_board/os/petalinux/project-spec/configs/../../components/plnx_workspace/device-tree/device-tree/zynq-7000.dtsi:551.16-564.5: ERROR
(phandle_references): /amba/ptm@f889d000: Reference to non-existent node or label "cpu1"                                                                                   
                                                                                                                                                                         
ERROR: Input tree has errors, aborting (use -f to force output)                                                                                                           
                                                                                                                                                                         
ERROR: Logfile of failure stored in: /home/vivado/test_board/os/petalinux/build/tmp/work/zynq_generic-xilinx-linux-gnueabi/device-tree/xilinx-v2020.2
+gitAUTOINC+f725aaecff-r0/temp/log.do_compile.26867
ERROR: Task (/home/vivado/test_board/os/petalinux/components/yocto/layers/meta-xilinx/meta-xilinx-bsp/recipes-bsp/device-tree/device-tree.bb:do_compi
le) failed with exit code '1'
NOTE: Tasks Summary: Attempted 3447 tasks of which 2692 didn't need to be rerun and 1 failed.

Summary: 1 task failed:
  /home/vivado/test_board/os/petalinux/components/yocto/layers/meta-xilinx/meta-xilinx-bsp/recipes-bsp/device-tree/device-tree.bb:do_compile
Summary: There was 1 ERROR message shown, returning a non-zero exit code.
ERROR: Failed to build project

---------------------
How to solve the problem?
Vivado, Vitis, Petalinux - 2020.2. I found the similar eror on xilinx site - https://support.xilinx.com/s/article/76575?language=en_US (https://support.xilinx.com/s/article/76575?language=en_US), but it is for Versal device.
Title: Re: TE0726-03-07S-1C and reference designs issues
Post by: JH on November 26, 2021, 02:51:07 PM
Hi,
it looks like you use our template correct?
Did you run hw import of the XSA file before you run build?
Do you use a supported Linux version for petalinux built enviroment? Did you  install all neccesary packages? See: https://wiki.trenz-electronic.de/display/PD/PetaLinux+KICKstart#PetaLinuxKICKstart-PetaLinuxInstallation.1
Can you try out one time prebuilt xsa from a dual core variant (we generate linux files with a dual core variant, this should work also on the single core.) So you can check if single core xsa is the problem.

br
John
Title: Re: TE0726-03-07S-1C and reference designs issues
Post by: rtx on November 29, 2021, 11:52:26 AM
Hi,

> it looks like you use our template correct?
Yes

>Did you run hw import of the XSA file before you run build?
Yes

> Do you use a supported Linux version for petalinux built enviroment? Did you  install all neccesary packages?
I use openSuse, but I installed all the same necessary packages

> Can you try out one time prebuilt xsa from a dual core variant (we generate linux files with a dual core variant, this should work also on the single core.) So you can check if single core xsa is the problem.
I tried for TE0726-03-41C74-R and the build was successful, no any errors. Then I again tried to build for TE0726-03-07S-1C and again the same error.

So the problem is in the single core. Can you please fix it?
Title: Re: TE0726-03-07S-1C and reference designs issues
Post by: JH on November 29, 2021, 12:31:52 PM
Hi,
QuoteSo the problem is in the single core. Can you please fix it?
In this case it's bug from on xilinx xsa import. I can't fix it. Check automatically generated part from device tree.
Sometimes Xilinx published patches, sometimes you must generate your own one.
I found an single core problem for older versions:
https://support.xilinx.com/s/article/70402?language=ja

or

https://support.xilinx.com/s/question/0D52E00006hprmh/petalinux-20201-build-error-device-tree?language=en_US

both looks like the same problem.

br
John
Title: Re: TE0726-03-07S-1C and reference designs issues
Post by: rtx on November 29, 2021, 02:36:19 PM
I tried to use the patch from https://support.xilinx.com/s/article/70402?language=ja (https://support.xilinx.com/s/article/70402?language=ja)
I placed 0001-Update-the-logic-to-check-if-cpu-is-present-in-the-d.patch file in the <plnx-proj-root>/project-spec/meta-user/recipes-bsp/device-tree/files and changed <plnx-proj-root>/project-spec/meta-user/recipes-bsp/device-tree/device_tree.bbappend file:
device_tree.bbappend:

SRC_URI_append = "\
     file://0001-Update-the-logic-to-check-if-cpu-is-present-in-the-d.patch \
"

FILESEXTRAPATHS_prepend := "${THISDIR}/files:"

SRC_URI += "file://system-user.dtsi"


python () {
    if d.getVar("CONFIG_DISABLE"):
        d.setVarFlag("do_configure", "noexec", "1")
}

export PETALINUX
do_configure_append () {
<------>script="${PETALINUX}/etc/hsm/scripts/petalinux_hsm_bridge.tcl"
<------>data=${PETALINUX}/etc/hsm/data/
<------>eval xsct -sdx -nodisp ${script} -c ${WORKDIR}/config \
<------>-hdf ${DT_FILES_PATH}/hardware_description.${HDF_EXT} -repo ${S} \
<------>-data ${data} -sw ${DT_FILES_PATH} -o ${DT_FILES_PATH} -a "soc_mapping"
}

Still can't build.

I looked into 0001-Update-the-logic-to-check-if-cpu-is-present-in-the-d.patch. It modifies the file /device_tree/data/device_tree.tcl. Where is this file located? Can I modify it manually?
Title: Re: TE0726-03-07S-1C and reference designs issues
Post by: JH on November 29, 2021, 07:35:21 PM
Hi,
this patch from xilinx was for older petalinux version.I think it's not longer compatible.

Can you add this one to your device tree for your single core variant and try again:

Quote
&amba {
   ptm@f889d000 {
      cpu = <&cpu0>;
   };
};

br
John
Title: Re: TE0726-03-07S-1C and reference designs issues
Post by: rtx on November 30, 2021, 01:07:11 PM
John,

[INFO] Successfully built project.
I successfully started Linux on the device and can use Linux shell.

Thank you!
Title: Re: TE0726-03-07S-1C and reference designs issues
Post by: rtx on November 30, 2021, 02:16:04 PM
Oh, I successfully got linux shell only with your boot.scr and image.ub. With my boot.scr and image.ub I just have:
Zynq>
Maybe it is because I did nothing when configured PetaLinux project. Do you have any documentation how to configure? Or any scripts that configure it the same way as you do?
Title: Re: TE0726-03-07S-1C and reference designs issues
Post by: JH on November 30, 2021, 02:28:34 PM
Hi,
https://wiki.trenz-electronic.de/display/PD/Distro+Boot+with+Boot.scr

or use simple our boot.scr from the reference design
br
John
Title: Re: TE0726-03-07S-1C and reference designs issues
Post by: rtx on November 30, 2021, 05:49:15 PM
Everything is ok now. Thank you very much.