cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
zhaohl
Contributor
Contributor
1,217 Views
Registered: ‎07-18-2010

Device tree generation error when concentrate 2 interrupts using concat - petalinux 2019.2

Hi.

 

A customer encountered problems when generate device tree in Petalinux 2019.2 + Zynq-7000,

there are 2 interrupt sources - dpu_interrupt[1:0], which are connected to IRQ_F2P[15:0] of Zynq-7000

using concat IP,  please refer to the attached block diagram for more details about the design.

 

Following is the log: 

********************************************************************************************************************

ARNING: /opt/petalinux/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:08
Checking sstate mirror object availability: 100% |###############| Time: 0:00:27
Sstate summary: Wanted 407 Found 26 Missed 762 Current 2274 (6% match, 85% complete)
NOTE: Executing SetScene Tasks
NOTE: Executing RunQueue Tasks
ERROR: device-tree-xilinx-v2019.2+git999-r0 do_configure: Function failed: do_configure (log file is located at /home/zjf/xilinx_proj/zc706/build/tmp/work/zc706_zynq7-xilinx-linux-gnueabi/device-tree/xilinx-v2019.2+git999-r0/temp/log.do_configure.8109)
ERROR: Logfile of failure stored in: /home/zjf/xilinx_proj/zc706/build/tmp/work/zc706_zynq7-xilinx-linux-gnueabi/device-tree/xilinx-v2019.2+git999-r0/temp/log.do_configure.8109
Log data follows:
| DEBUG: Executing python function externalsrc_configure_prefunc
| DEBUG: Python function externalsrc_configure_prefunc finished
| DEBUG: Executing shell function do_configure
| MISC_ARG is -hdf_type xsa -yamlconf /home/zjf/xilinx_proj/zc706/build/tmp/work/zc706_zynq7-xilinx-linux-gnueabi/device-tree/xilinx-v2019.2+git999-r0/device-tree.yaml
| APP_ARG is -app "device-tree"
| Using xsct from: /opt/petalinux/tools/xsct/bin/xsct
| cmd is: xsct -sdx -nodisp /home/zjf/xilinx_proj/zc706/build/tmp/work/zc706_zynq7-xilinx-linux-gnueabi/device-tree/xilinx-v2019.2+git999-r0/dtgen.tcl -ws /home/zjf/xilinx_proj/zc706/build/../components/plnx_workspace/device-tree -pname device-tree -rp /home/zjf/xilinx_proj/zc706/components/plnx_workspace/sources/device-tree -processor ps7_cortexa9_0 -hdf /home/zjf/xilinx_proj/zc706/build/tmp/deploy/images/zc706-zynq7/Xilinx-zc706-zynq7.xsa -arch 32 -app "device-tree" -hdf_type xsa -yamlconf /home/zjf/xilinx_proj/zc706/build/tmp/work/zc706_zynq7-xilinx-linux-gnueabi/device-tree/xilinx-v2019.2+git999-r0/device-tree.yaml
| INFO: [Hsi 55-2053] elapsed time for repository (/opt/petalinux/tools/xsct/data/embeddedsw) loading 0 seconds
| missing operator at _@_
| in expression "61 _@_62 - 32"
| ERROR: [Hsi 55-1545] Problem running tcl command ::sw_device_tree::generate : missing operator at _@_
| in expression "61 _@_62 - 32"
| (parsing expression "61 62 - 32")
| invoked from within
| "expr $intr_id - 32"
| ("foreach" body line 81)
| invoked from within
| "foreach pin ${intr_port_name} {
| set connected_intc [get_intr_cntrl_name $drv_handle $pin]
| if {[llength $connected_intc] == 0 || [string match $con..."
| (procedure "gen_interrupt_property" line 30)
| invoked from within
| "gen_interrupt_property $drv_handle"
| ("foreach" body line 7)
| invoked from within
| "foreach drv_handle [get_drivers] {
| # generate the default properties
| gen_peripheral_nodes $drv_handle "create_node_only"
| gen_r..."
| (procedure "::sw_device_tree::generate" line 3)
| invoked from within
| "::sw_device_tree::generate device_tree"
| ERROR: [Hsi 55-1442] Error(s) while running TCL procedure generate()
| generate_target failed
| while executing
| "error "generate_target failed""
| invoked from within
| "if {[catch {hsi generate_target -dir $project} res]} {
| error "generate_target failed"
| }"
| (file "/home/zjf/xilinx_proj/zc706/build/tmp/work/zc706_zynq7-xilinx-linux-gnueabi/device-tree/xilinx-v2019.2+git999-r0/dtgen.tcl" line 38)
| WARNING: /home/zjf/xilinx_proj/zc706/build/tmp/work/zc706_zynq7-xilinx-linux-gnueabi/device-tree/xilinx-v2019.2+git999-r0/temp/run.do_configure.8109:1 exit 1 from 'eval xsct -sdx -nodisp /home/zjf/xilinx_proj/zc706/build/tmp/work/zc706_zynq7-xilinx-linux-gnueabi/device-tree/xilinx-v2019.2+git999-r0/dtgen.tcl -ws /home/zjf/xilinx_proj/zc706/build/../components/plnx_workspace/device-tree -pname device-tree -rp /home/zjf/xilinx_proj/zc706/components/plnx_workspace/sources/device-tree -processor ps7_cortexa9_0 -hdf /home/zjf/xilinx_proj/zc706/build/tmp/deploy/images/zc706-zynq7/Xilinx-zc706-zynq7.xsa -arch 32 ${APP_ARG} ${MISC_ARG}'
| ERROR: Function failed: do_configure (log file is located at /home/zjf/xilinx_proj/zc706/build/tmp/work/zc706_zynq7-xilinx-linux-gnueabi/device-tree/xilinx-v2019.2+git999-r0/temp/log.do_configure.8109)
ERROR: Task (/opt/petalinux/components/yocto/source/arm/layers/meta-xilinx/meta-xilinx-bsp/recipes-bsp/device-tree/device-tree.bb:do_configure) failed with exit code '1'
NOTE: Tasks Summary: Attempted 8312 tasks of which 8311 didn't need to be rerun and 1 failed.

Summary: 1 task failed:
/opt/petalinux/components/yocto/source/arm/layers/meta-xilinx/meta-xilinx-bsp/recipes-bsp/device-tree/device-tree.bb:do_configure
Summary: There was 1 WARNING message shown.
Summary: There was 1 ERROR message shown, returning a non-zero exit code.
ERROR: Failed to build project

*******************************************************************************************************************************

 

Does anyone have the similar case? is there a workaround to fix the problem?

Thanks.

 

zhaohl

2020.07.15

0 Kudos
19 Replies
DEJ
Visitor
Visitor
1,092 Views
Registered: ‎10-23-2020

Based on your subject line, I'm assuming your problem is directly related to the interrupts.  Before I even knew of PetaLinux, I had trouble getting Vitis to recognize interrupts when I was embedding my user code (not Linux) on the PS.

I had named my interrupts something useful, equivalent to your dpu_interrupt[1:0].  I changed the name of those pins to intr to get the interrupt connections recognized by the Vivado 2019.2 / Vitis 2019.2 platforms.

In my design, I had custom interrupts intr[7:0] going to In0[7:0] of xlconcat_0.  The dout[7:0] outputs of xlconcat_0 went to IRQ_F2P[7:0] inputs of processing_system7_0.

Even though my custom interrupts were already concatenated, I had to run them through a concat block before hitting the processing system block.  And I had to change my useful interrupt names to intr as Vivado/Vitis apparently relied on the naming convention to treat those signals as interrupts.

0 Kudos
DEJ
Visitor
Visitor
1,077 Views
Registered: ‎10-23-2020

You got me thinking about my petalinux-build failures with regard to interrupts.  My error messages differ, but I believe the failure to build the device-tree is also related to my interrupts.  I have embedded user code processing interrupts just fine and there are no issues with my embedded code talking to the PL.  Later, I determined that I wanted to run embedded Linux and install my user code as executables on the Linux operating system.  See the following which appears to be my device tree generation error related to interrupts:

https://forums.xilinx.com/t5/Embedded-Development-Tools/PetaLinus-2019-2-device-tree-failed-to-build-for-MicroZed/td-p/1170309

 

0 Kudos
stephenm
Moderator
Moderator
1,058 Views
Registered: ‎09-12-2007

Can you share the HDF/XSA here please?

0 Kudos
DEJ
Visitor
Visitor
1,033 Views
Registered: ‎10-23-2020

Are you replying to the original contributor (zhaohl), or are you replying to my (DEJ) visitor comment?  If to my (DEJ) visitor comment, please find the zipped XSA file attached.  The website rejected the .xsa extension as mismatching the header.

0 Kudos
stephenm
Moderator
Moderator
1,014 Views
Registered: ‎09-12-2007

The issue here is that you have a interrupt port of width 7 connected to the interrupt controller:

pin_width.PNG

This is causing the DTG issues

0 Kudos
stephenm
Moderator
Moderator
1,004 Views
Registered: ‎09-12-2007

you can create a patch here in the DTG to prevent the crash. For example, I added the code below:

if {[llength $intr_id] > 1} {
puts "Warning: this is a interrupt vector and is not supported"
continue
}

 

Here:

https://github.com/Xilinx/device-tree-xlnx/blob/xilinx-v2020.1/device_tree/data/common_proc.tcl#L2013

 

This will allow the DTG to pass. however, you will need to manually populate the interrupts to the system-user.dtsi

 

For help creating patches:

https://forums.xilinx.com/t5/Design-and-Debug-Techniques-Blog/PetaLinux-Image-Debug-Series-Debugging-the-Device-Tree-Generator/ba-p/1157624

0 Kudos
DEJ
Visitor
Visitor
957 Views
Registered: ‎10-23-2020

Thanks for taking a look at my XSA file and confirming the interrupt problem.  I only discovered PetaLinux last week after deciding to switch out my embedded user code for embedded Linux on which my user code would be an "installed" executable.  I developed my embedded user code on Vitis, which I've only been using for several weeks.  I just got PetaLinux successfully installed 3 days ago.  The information you have provided me is so beyond my current field of knowledge that it is not going to be trivial for me to patch the DTG and manually populate the interrupts to the system-user.dtsi.  Even if those tasks were completed, I do not know how to modify my user code to use Linux drivers to access the PL subsystem or the ARM's interrupt controller that is currently processing my 8-wide interrupt vector.  Are there any concise explanations that address my immediate needs?  I appreciate your suggestions below because I would have thought PetaLinux supported the interrupts to the same degree as Vivado & Vitis supported the Zinq ARM architecture.  Are there plans for PetaLinux to support a vector of multiple interrupts in the future?

0 Kudos
stephenm
Moderator
Moderator
927 Views
Registered: ‎09-12-2007

The blog post I added in the previous thread discusses how to manually create the Devicetree from DTG sources on GitHub, how to debug, and how create a patch for the DTG in Petalinux.

This is the flow I used to debug your issue. I recommend you follow it to

0 Kudos
DEJ
Visitor
Visitor
748 Views
Registered: ‎10-23-2020

(1)  I'm sorry, but I still do not understand how to find and identify the file in which to insert "if {[llength $intr_id] > 1 ..." Nor do I understand where in said file to insert this conditional.

(2)  I migrated to PetaLinux 2020.1, but continue to have the same problem.  In my project I did find /home/davidjones/petalinux2020.1projects/MicroZed//project-spec/meta-user/recipes-bsp/device-tree/files/ system-usr.dtsi.  However, I do not know the syntax for manually populating the interrupts.

I re-visited your flow, but I do not currently possess the knowledge to glean a solution from it.  I would be greatly appreciative if you could concisely address my issues (1) and (2) above.  Thank you for taking the time to help me.

0 Kudos
stephenm
Moderator
Moderator
718 Views
Registered: ‎09-12-2007

Firstly, you need to patch the Devicetree Generator in Petalinux to prevent the crash. The wiki below discusses how to use the DTG manually:

https://xilinx-wiki.atlassian.net/wiki/spaces/A/pages/136904764/Creating+Devicetree+from+Devicetree+Generator+for+Zynq+Ultrascale+and+Zynq+7000

 

For example, I have downloaded this, and generated the devicetree, and I see your issue:

vector_interrupt.PNG

To address this, I updated the common_proc.tcl file:

file_path.PNG

With the content here:

common_proc.PNG

You will then need to create a patch, and add this to Petalinux. This is explained at the bottom of the wiki above.

This will prevent the DTG crashing. However, you need to add the interrupts manually to the GIC

 

 

0 Kudos
stephenm
Moderator
Moderator
714 Views
Registered: ‎09-12-2007

You have an 8 bit vector of interrupts connected to the IRQ. 61:68. These are 61 - 32, 62 - 32, … 68 - 32

This is the exact node you need to append to your system-user.dtsi

&SDLC_Async_IO_v1_0_0 {
   interrupt-names = "intr_0 intr_1 intr_2 intr_3 intr_4 intr_5 intr_6 intr_7";
   interrupts = <0 29 4 0 30 4 0 31 4 0 32 4 0 33 4 0 34 4 0 35 4 0 36 4>;
};

 

Then petalinux-build -c device-tree

 

This assumes you have applied the patch as discussed above

0 Kudos
DEJ
Visitor
Visitor
704 Views
Registered: ‎10-23-2020

In Vivado 2020.1, I executed the following deprecated TCL command to create the .hdf file:
    write_hwdef -force MicroZed_USART_2020-1.hdf

I then placed this file in the following directory on my Linux laptop:
    /home/davidjones/Documents/PetaLinuxPerElement14/MicroZedHdfFile

Next, I executed the following commands on my Linux laptop:
    $ cd /home/davidjones/petalinux2020.1projects/MicroZedSDLC
    $ mkdir -p repo/my_dtg
    $ cd repo/my_dtg
    $ git clone https://github.com/Xilinx/device-tree-xlnx
$ cd device-tree-xlnx
$ git checkout xilinx-v2020.1
$ set hdf=/home/davidjones/Documents/PetaLinuxPerElement14/MicroZedHdfFile
$ echo $hdf [the path did not echo back]
$ open_hw_design $hdf [the open_hw_design command was not found]
$ open_hw_design /home/davidjones/Documents/PetaLinuxPerElement14/MicroZedHdfFile  [the open_hw_design command was not found]
_____________________________

In the past, I pulled in the hardware platform by executing the following commands:
  $ cd /home/davidjones/petalinux2020.1projects/MicroZedSDLC
  $ petalinux-config --get-hw-description=/home/davidjones/petalinux/PetaLinuxPerElement14/MicroZedXsaFile  [.xsa file location]

The PetaLinux 2020.1 System Configuration GUI opened, I ensured DTG settings which involved changing the MACHINE NAME from template to zc702.  Then I saved and exited from the PetaLinux 2020.1 System Configuration GUI.

I then performed the following series of commands, of which the final command generated the errors I listed earlier:

$ cd /home/davidjones/petalinux2020.1projects/MicroZedSDLC
$ petalinux-build -x mrproper  [I don't know why, but if I didn't execute this command and the following command, the final petalinux-build command failed due to file fetch errors]
$ petalinux -rf components/plnx_workspace/*
$ petalinux-build  [here is where the 8 interrupts to the interrupt controller errored out]

0 Kudos
stephenm
Moderator
Moderator
693 Views
Registered: ‎09-12-2007

Did you generate the patch?

If you are testing in the DTG from XSCT, then you need to prepend the commands with hsi:: for example 

hsi::open_hw_design

However, if you make the exact changes that I showed above, then this will work. You just need to create the patch and apply this to the device-tree recipe in your Petalinux project. Then update the system-user.dtsi

 

I tested this in Petalinux and it's works for me

0 Kudos
DEJ
Visitor
Visitor
685 Views
Registered: ‎10-23-2020

I could not get past this while following your steps:
.
.
.
$ git checkout xilinx-v2020.1
$ set hdf=/home/davidjones/Documents/PetaLinuxPerElement14/MicroZedHdfFile
$ echo $hdf [the path did not echo back]
$ open_hw_design $hdf [the open_hw_design command was not found]
$ open_hw_design /home/davidjones/Documents/PetaLinuxPerElement14/MicroZedHdfFile  [the open_hw_design command was not found]

The complete list of steps I took following your reference is listed in today's ‎02-12-2021 11:50 AM - edited ‎02-12-2021 11:52 AM reply.  Do you see anything I did wrong in following your reference because I could not even get to making the patch.
___________________________________

As a note of interest, I started getting fetch file errors again using my old way, which continues to have the interrupt issues.  To fix the fetch errors, I opened the following file for editing:
/home/davidjones/petalinux2020.1projects/MicroZedSDLC/project-spec/configs/config

I then removed the .* from the following two lines in this config file:
    CONFIG_PRE_MIRROR_URL="http://petalinux.xilinx.com/sswreleases/rel-v${PETALINUX_VER%%.*}/downloads" 
    CONFIG_YOCTO_NETWORK_SSTATE_FEEDS_URL="http://petalinux.xilinx.com/sswreleases/rel-v${PETALINUX_VER%%.*}/arm/sstate-cache"

0 Kudos
DEJ
Visitor
Visitor
684 Views
Registered: ‎10-23-2020

Oops, I missed the significance of this in your response:
  If you are testing in the DTG from XSCT ...

I'm not sure what this means but I am running from the Linux prompt on my Linux laptop.  I'll try preceding the relevant commands with ::hsi.

0 Kudos
stephenm
Moderator
Moderator
678 Views
Registered: ‎09-12-2007

You don't need to test in the dtg. If you update as I have shown then just create the patch and apply this to the Petalinux project

 

0 Kudos
DEJ
Visitor
Visitor
673 Views
Registered: ‎10-23-2020

I misunderstood ... sorry, I'm just not familiar with a lot of this.  I did get the repo installed.  I'll go directly to the common_proc.tcl in that repo and make the change shown in your screenshot.

Are you saying I next go into the following file within my project ...
  /home/davidjones/petalinux2020.1projects/MicroZed//project-spec/meta-user/recipes-bsp/device-tree/files/ system-usr.dtsi
... make the following addition at the end ...

&SDLC_Async_IO_v1_0_0 {
   interrupt-names = "intr_0 intr_1 intr_2 intr_3 intr_4 intr_5 intr_6 intr_7";
   interrupts = <0 29 4 0 30 4 0 31 4 0 32 4 0 33 4 0 34 4 0 35 4 0 36 4>;
};

... and now I'm ready to execute petalinux-build -c device-tree ?

0 Kudos
stephenm
Moderator
Moderator
667 Views
Registered: ‎09-12-2007

You need to create the patch (I would do this, but I don't like posting patches) 

 

cd device-tree-xlnx

git diff xilinx-v2020.1 > 0001_vector_fix.patch

Then copy this patch to the files dir in the device-tree recipe in your plnx proj dir. Then update the bbappend. These steps are in the wiki.

You can use the system-user.dtsi that I posted earlier.

Then petalinux-build -c device-tree

0 Kudos
DEJ
Visitor
Visitor
633 Views
Registered: ‎10-23-2020

Vivado 2020.1 and Vitis 2020.1 are installed on my Windows laptop.
PetaLinux 2020.1 is installed on my Linux laptop.
I copied my .hdf file, which I created using a deprecated command in the Vivado 2020.1 TCL window, over to my Linux machine. 

I am operating in a Terminal window on my Linux machine for all the following commands.  This command is accepted:
    $  set hdf=/home/davidjones/Documents/PetaLinuxPerElement14/MicroZedHdfFile

This command is accepted but displays a blank line, which I don't understand:
    $ echo $hdf

Because hdf does not appear to be getting set, I executed the open_hw_design command as follows, but the command is not found:
    $  open_hw_design /home/davidjones/Documents/PetaLinuxPerElement14/MicroZedHdfFile

 

0 Kudos