cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted
Explorer
Explorer
2,392 Views
Registered: ‎04-19-2018

Device tree system-user.dtsi, not building

Jump to solution

Hi

I am trying to allocate some reserved memory in petalinux as in the wiki/confluence page;
https://xilinx-wiki.atlassian.net/wiki/spaces/A/pages/18841683/Linux+Reserved+Memory

I have a project based on the ZCU111 (RFSoC eval), i have added a modified 'system-user.dtsi' as shown in the wiki/confluence page this appears to compile and i can boot the image,  however this image when booted does not show reservered memory using command;
'cat /proc/iomem.'

Injecting syntax errors in the system.dtsi does not cause errors when i run "petalinux-build -c device-tree" , however "petalinux-build -b device-tree" does causes errors (as expected due to the syntax errrors)., but i'm unsure how to build this 'system.dtb' into the 'image.ub'

The project doesn't appear to always be including system-user.dtsi?

Any pointers on what is going wrong or what to try.

Thanks
Tim

1 Solution

Accepted Solutions
Highlighted
Moderator
Moderator
2,312 Views
Registered: ‎09-12-2007

Also, you can always quickly compile the DT if you are making changes here as running through the tools can be time consuming:

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

cd <plnx proj>/components/plnx_workspace/device-tree/device-tree
gcc -I ../../../../project-spec/meta-user/recipes-bsp/device-tree/files/system-user.dtsi -E -nostdinc -undef -D__DTS__ -x assembler-with-cpp -o my_dts/system-top.dts.tmp system-top.dts
dtc -I dts -O dtb -o system-top.dtb system-top.dts.tmp

 

Once you are happy, then as Sandeep says:

  • petalinux-build -c device-tree -x cleanstate
  • petalinux-build -c device-tree
 

View solution in original post

0 Kudos
10 Replies
Highlighted
Explorer
Explorer
2,331 Views
Registered: ‎04-19-2018

It appears the running "petalinux-build -c device-tree" build on first build and includes "system-user.dtsi" file.

 

Subsequent rebuild using "petalinux-build -c device-tree" does not rebuild even if changes to the "system-user.dtsi" file have been applied.

I am forced to do a "petalinux-build -x mrproper" to clean the project, then rebuild using "petalinux-build".

 

Is this expected behaviour of the petalinux tools?

Thanks
Tim

0 Kudos
Highlighted
Moderator
Moderator
2,320 Views
Registered: ‎04-24-2017

Hi @tmonaghan84 ,

Whenever you add nodes to system-user.dtsi you need to run cleansstate.

$ petalinux-build -c device-tree -x cleansstate
$ petalinux-build -c device-tree

With this it should generate the right nodes and you no need to run "petalinux-build -x mrproper"

Once you run any bitbake recipe for example in this case it's "device-tree" you can verify the list of task executed in log.task_order file

$ cat <TMPDIR>/<PROJECT_NAME>/work/<YOCTO_MACHINE_NAME>-xilinx-linux/device-tree/xilinx+gitAUTOINC+73e546e312-r0/temp/log.task_order
Thanks,
Sandeep
PetaLinux Yocto | Embedded SW Support

---------------------------------------------------------------------------
Don’t forget to Reply, Kudo, and Accept as Solution.
---------------------------------------------------------------------------
Highlighted
Moderator
Moderator
2,313 Views
Registered: ‎09-12-2007

Also, you can always quickly compile the DT if you are making changes here as running through the tools can be time consuming:

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

cd <plnx proj>/components/plnx_workspace/device-tree/device-tree
gcc -I ../../../../project-spec/meta-user/recipes-bsp/device-tree/files/system-user.dtsi -E -nostdinc -undef -D__DTS__ -x assembler-with-cpp -o my_dts/system-top.dts.tmp system-top.dts
dtc -I dts -O dtb -o system-top.dtb system-top.dts.tmp

 

Once you are happy, then as Sandeep says:

  • petalinux-build -c device-tree -x cleanstate
  • petalinux-build -c device-tree
 

View solution in original post

0 Kudos
Highlighted
Explorer
Explorer
2,234 Views
Registered: ‎04-19-2018

should be

 

petalinux-build -c device-tree -x cleansstate

Highlighted
1,650 Views
Registered: ‎08-20-2019

Hi,

   I have the exact same problem. However even after I run "petalinux-build -c device-tree -x cleanstate" and "petalinux-build -x mrproper" the problem persists in both cases. I know that system-user.dtsi does not get processed because I created syntax error in it on purpose. Petalinux builds and runs through just fine without calling out the error. What else could keep Petalinux not to process the updated system-user.dtsi?

thanks,

Simon

0 Kudos
Highlighted
Moderator
Moderator
1,648 Views
Registered: ‎09-12-2007

Can you share your hdf/xsa and your system-user.dtsi?

0 Kudos
Highlighted
1,637 Views
Registered: ‎08-20-2019

Hi,

   Thank you for the quick response. Attached are the requested files. Basically the design is based on the HDMI_RX from the ZCU106 TRD. I added in my own custom design on the HDMI transmit side which I don't plan on be part of the video framework. Then I borrowed the vcu_10g.dtsi from the TRD with some modifications to make my own system-user.dtsi. You will see the system-user.dtsi has injected error in it as I mentioned before.

Regards,

 

Simon

0 Kudos
Highlighted
Moderator
Moderator
1,583 Views
Registered: ‎09-12-2007

There are alot of syntax errors in your system-user.dtsi. For example, if you are modifying an existing node, then you just need the &. If you want to add a node, then you need to do this within the DT structure /{ ... }; Also, there are alot of node that you are trying to modify that dont exist in the existing DT.

 

I have attached a zip file with a make that you can run for testing the DTG, and DTC more quickly.

For example, you will need to download the DTG from the github.

Once you do this, then make dts, and make include_dtsi DTSI_FILE=system-user.dtsi

Then to test, make compile

Highlighted
1,510 Views
Registered: ‎08-20-2019

Hi,

   As I mentioned in the original post I left errors in the system-user.dtsi on purpose to make the build flow to fail. However the build always succeeded. This was the case even after I did distclean, sstate and mrproper clean and even reinstalled Petalinux.

   But it finally worked after I created the project on a different machine from scratch. So looks like the original project was corrupted in some way. I have no idea how that happened.

   In any case thank you very much for looking into the issue.

 

Regards,

 

Simon

 

0 Kudos
Highlighted
Moderator
Moderator
1,474 Views
Registered: ‎09-12-2007

OK, great. The main point I tried to make is how to better debug as doing this via trial and error in Petalinux can be painful. The script in the zip makes this alot easier.

0 Kudos