cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted
Visitor
Visitor
407 Views
Registered: ‎12-11-2018

zynq-7000 pl.dtsi syntax error

Hi, i have generated a xsa file from vivado 2019.2 for petalinux 2019.2 compilation, but got an error when build the device tree:

1)petalinux-config --get-hw-description=/home/xx/zynq7000/hdf -->this directory contains a xsa file generated from vivado

2) check the item : DTG Settings --> Devicetree overlay, then save and quit.

3)config uboot and kernel

4)petalinux-build

     here i got an error:

 

john@ubuntu:~/zynq/mp$ petalinux-build
[INFO] building project
[INFO] sourcing bitbake
[INFO] generating user layers
[INFO] generating workspace directory
INFO: bitbake petalinux-user-image
Loading cache: 100% |############################################| Time: 0:00:00
Loaded 3978 entries from dependency cache.
Parsing recipes: 100% |##########################################| Time: 0:00:04
Parsing of 2893 .bb files complete (2887 cached, 6 parsed). 3980 targets, 197 skipped, 0 masked, 0 errors.
NOTE: Resolving any missing task queue dependencies
WARNING: /home/john/petalinux_2019.2/components/yocto/source/arm/layers/meta-xilinx/meta-xilinx-bsp/recipes-kernel/linux/linux-xlnx_2019.2.bb.do_compile is tainted from a forced run
Initialising tasks: 100% |#######################################| Time: 0:00:02
Checking sstate mirror object availability: 100% |###############| Time: 0:00:18
Sstate summary: Wanted 130 Found 10 Missed 240 Current 768 (7% match, 86% complete)
NOTE: Executing SetScene Tasks
NOTE: Executing RunQueue Tasks
ERROR: device-tree-xilinx-v2019.2+gitAUTOINC+a8b39cf536-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/john/petalinux_2019.2/components/yocto/source/arm/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/john/petalinux_2019.2/components/yocto/source/arm/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/john/petalinux_2019.2/components/yocto/source/arm/buildtools/sysroots/x86_64-petalinux-linux/usr/lib/python3.5/subprocess.py', lineno: 398, function: run
0394: raise
0395: retcode = process.poll()
0396: if check and retcode:
0397: raise CalledProcessError(retcode, process.args,
*** 0398: output=stdout, stderr=stderr)
0399: return CompletedProcess(process.args, retcode, stdout, stderr)
0400:
0401:
0402:def list2cmdline(seq):
Exception: subprocess.CalledProcessError: Command '['dtc', '-R', '8', '-b', '0', '-@', '-p', '0x1000', '-i', '/home/john/zynq/mp/build/../components/plnx_workspace/device-tree/device-tree', '-i', '/home/john/zynq/mp/build/tmp/work-shared/plnx-zynq7/kernel-source/include', '-i', '/home/john/zynq/mp/build/tmp/work/plnx_zynq7-xilinx-linux-gnueabi/device-tree/xilinx-v2019.2+gitAUTOINC+a8b39cf536-r0', '-i', '/home/john/zynq/mp/build/tmp/work-shared/plnx-zynq7/kernel-source/scripts/dtc/include-prefixes', '-i', '/home/john/zynq/mp/build/tmp/work-shared/plnx-zynq7/kernel-source/arch/arm/boot/dts', '-o', 'system-top.dtb', '-I', 'dts', '-O', 'dtb', 'system-top.dts.pp']' returned non-zero exit status 1

Subprocess output:
Error: /home/john/zynq/mp/build/../components/plnx_workspace/device-tree/device-tree/pl.dtsi:8.1-9 syntax error
FATAL ERROR: Unable to parse input tree

ERROR: device-tree-xilinx-v2019.2+gitAUTOINC+a8b39cf536-r0 do_compile: Function failed: devicetree_do_compile
ERROR: Logfile of failure stored in: /home/john/zynq/mp/build/tmp/work/plnx_zynq7-xilinx-linux-gnueabi/device-tree/xilinx-v2019.2+gitAUTOINC+a8b39cf536-r0/temp/log.do_compile.21362
ERROR: Task (/home/john/petalinux_2019.2/components/yocto/source/arm/layers/meta-xilinx/meta-xilinx-bsp/recipes-bsp/device-tree/device-tree.bb:do_compile) failed with exit code '1'
NOTE: Tasks Summary: Attempted 3192 tasks of which 3175 didn't need to be rerun and 1 failed.

Summary: 1 task failed:
/home/john/petalinux_2019.2/components/yocto/source/arm/layers/meta-xilinx/meta-xilinx-bsp/recipes-bsp/device-tree/device-tree.bb:do_compile
Summary: There was 1 WARNING message shown.
Summary: There were 2 ERROR messages shown, returning a non-zero exit code.
ERROR: Failed to build project

 

 

 

 

 

 

 

pl.dtsi that contains the following contents was generated automaticly by petalinux tools 

/*
* CAUTION: This file is automatically generated by Xilinx.
* Version:
* Today is: Thu Jun 4 02:45:44 2020
*/


/dts-v1/;          //is here any problem?
/plugin/;
/ {
fragment@0 {
target = <&fpga_full>;
overlay0: __overlay__ {
#address-cells = <1>;
#size-cells = <1>;
firmware-name = "petalinux_usb_7020_wrapper.bit.bin";
};
};
fragment@1 {
target = <&amba>;
overlay1: __overlay__ {
afi0: afi0@f8008000 {
#address-cells = <1>;
#size-cells = <0>;
compatible = "xlnx,afi-fpga";
reg = <0xF8008000 0x1000>;
xlnx,afi-width = <0>;
};
clocking0: clocking0 {
#clock-cells = <0>;
assigned-clock-rates = <100000000>;
assigned-clocks = <&clkc 15>;
clock-output-names = "fabric_clk";
clocks = <&clkc 15>;
compatible = "xlnx,fclk";
};
};
};
...//ignore belows
};

 

So what's the solution to build the iamges with pl IPs? 

0 Kudos
4 Replies
Highlighted
Moderator
Moderator
376 Views
Registered: ‎09-12-2007

What version of the DTC are you using? I know that the dtc only supports symbols (which is needed to compile DTO) in v1.43

Anyway, for these issue it is best to isolate the issue outside of Petalinux:

For example:

  • cd components/plnx_workspace/device-tree/device-tree 
  • dtc -I dts -O dtb -o pl.dtbo -b 0 -@ pl.dtsi

 

0 Kudos
Highlighted
Visitor
Visitor
351 Views
Registered: ‎12-11-2018

Hi, Stephenm:

  Can you please help to check the pl.dtsi attached, it was generated by petalinux tool-chains automatically when the petalinux-build command had been launched.

 petalinux 2019.2 produced an error below, that seems to be a problem connected with the dtc tool used by petalinux internally(and i don't know what's the version of it).

Subprocess output:
Error: /home/john/zynq/mp/build/../components/plnx_workspace/device-tree/device-tree/pl.dtsi:8.1-9 syntax error
FATAL ERROR: Unable to parse input tree

then i installed a dtc(version 1.4.0) manually  to test it again, and got the error below, a little difference from the previous one:

device-tree/device-tree$ dtc -I dts -O dtb -o pl.dtbo -b 0 pl.dtsi
Error: pl.dtsi:9.2-8 syntax error
FATAL ERROR: Unable to parse input tree

 

pl.dtsi:

1 /*
2 * CAUTION: This file is automatically generated by Xilinx.
3 * Version:
4 * Today is: Thu Jun 4 10:06:49 2020
5 */
6
7
8 /dts-v1/;
9 /plugin/;
10 / {
11      fragment@0 {
12            target = <&fpga_full>;
13            overlay0: __overlay__ {
14                         #address-cells = <1>;
15                         #size-cells = <1>;
16                         firmware-name = "petalinux_usb_7020_wrapper.bit.bin";
17              };
18       };

 

so,  how can i invoke a special version of dtc when running the "petalinux-build" command if this is a version problem of dtc, or is it impossible to accomplish the job with a single petalinux-build command if pl IPs are in use?

0 Kudos
Highlighted
Moderator
Moderator
331 Views
Registered: ‎09-12-2007

Your command line is incorrect, it should be:

dtc -I dts -O dtb -o pl.dtbo -b 0 -@ pl.dtsi

However, you need to use a later version of the DTC

dto.PNG

 

I used 1.4.4 above as this is the release that started supporting symbols. If you are on ubuntu, just do a 

sudo apt-get install dtc

Then compile the DTO outside of Petalinux, and disable this in your petalinux-config options. 

0 Kudos
Highlighted
Visitor
Visitor
268 Views
Registered: ‎12-11-2018

Hi, stephenm:

  Accourding to the results of the mannual compilation with different versions of DTC tools, the petalinux tools does not use the proper version of dtc. How can i force petalinux 2019.2 to use a specific version? 

0 Kudos