cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted
Adventurer
Adventurer
471 Views
Registered: ‎10-18-2019

Petalinux project for ZYBO using HDF issue

Jump to solution

Hi, 

I would like to create a Petalinux project for ZYBO 7Z-20 using HDF generated from Vivado. There are two HDF that I found in the Vivado project. 

"design-1-wrapper.hdf" and "system.hdf" 

I use the following commands to add HDF but not able to run properly. 

"petalinux-config--get-hw-description=<PATH-TO-HDF/DSA-DIRECTORY>"

Which CONFIG_SUBSYSTEM_MACHINE_NAME should I use in SET command ? 

 

peter@peter:~/opt/xilinx/petalinux/projects$ petalinux-create --type project --template zynq --name zybo-hello-2

peter@peter:~/opt/xilinx/petalinux/projects/zybo-hello-2$ petalinux-config --get-hw-description ../../libraries/design-1-wrapper.hdf
INFO: Getting hardware description...
ERROR: No HDF or DSA is found in /home/peter/opt/xilinx/petalinux/libraries/design-1-wrapper.hdf.
ERROR: Please use --get-hw-description=<VIVADO_SDK_EXPORT_DIR> to specify the location of Vivado export to SDK directory.

peter@peter:~/opt/xilinx/petalinux/projects/zybo-hello-2$ petalinux-config --get-hw-description ../../libraries/system.hdf
INFO: Getting hardware description...
ERROR: No HDF or DSA is found in /home/peter/opt/xilinx/petalinux/libraries/system.hdf.
ERROR: Please use --get-hw-description= <VIVADO_SDK_EXPORT_DIR> to specify the location of Vivado export to SDK directory.

peter@peter:~/opt/xilinx/petalinux/projects/zybo-hello-2$ Set CONFIG_SUBSYSTEM_MACHINE_NAME 

 

 

 

 

0 Kudos
1 Solution

Accepted Solutions
Highlighted
Moderator
Moderator
287 Views
Registered: ‎09-12-2007

When you export to SDK you should include the bitstream. This will be then added to the HDF. This way the SW stays in sync with the HW.

Then when you generate the Petalinux project, this bit will be used in Petalinux and delivered in images/linux folder.

Then use petalinux-package --boot --fpga system.bit --u-boot

 

You can use whatever bit you like. However, I recommend using the one delivered in the HDF. This way the metadata in the HDF matches the bitstream

View solution in original post

0 Kudos
10 Replies
Highlighted
Moderator
Moderator
399 Views
Registered: ‎09-12-2007

As your instructions states:

"petalinux-config--get-hw-description=<PATH-TO-HDF/DSA-DIRECTORY>"

 

You need to use the PATH to the XSA/DSA. You are providing the file

0 Kudos
Highlighted
Adventurer
Adventurer
395 Views
Registered: ‎10-18-2019

Hi @stephenm,

Which HDF file should I place in the directory "design-1-wrapper.hdf" or "system.hdf" ?

 Which CONFIG_SUBSYSTEM_MACHINE_NAME should I use in SET command ? 

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

Point to the one that is output from Vivado

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

So, there are two ways to create a petalinux project; using the BSP, or the template.

If you are using a dev board with a BSP, I suggest your use this as this will configure the petalinux project at a board level. 

If you use the template, the petlainux project will be configured at chip level using your HDF/XSA file. So, you would need to 

update the devicetree for any external devices to the chip. You can pass the machine name in the DTG though. For the Xilinx dev boards these can be seen 

below:

https://github.com/Xilinx/device-tree-xlnx/tree/master/device_tree/data/kernel_dtsi/2020.1/BOARD

 

In your case, just leave this as template. You will need to manually update the system-user.dtsi file. Or, use a BSP if available for your board

0 Kudos
Highlighted
Adventurer
Adventurer
381 Views
Registered: ‎10-18-2019

@stephenm

In the Vivado folder there are two HDF files. 

C:\XilinxProjects\zybo_project_1\zybo_project_1.sdk\design_1_wrapper.hdf

C:\XilinxProjects\zybo_project_1\zybo_project_1.sdk\design_1_wrapper_hw_platform_0\system.hdf 

which HDF should I put in the directory to point in get-hw-description command ? 

 

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

These two files are the same. SDK will just copy this when generating the platform.

0 Kudos
Highlighted
Adventurer
Adventurer
366 Views
Registered: ‎10-18-2019

HI @stephenm

Yes the BSP for ZYBO 7Z020 is available "Petalinux-Zybo-Z7-20-2017.4-3.bsp" but this is for v2017.4 and I am using v2018.3. I am not sure if it also work with v2018.3 but I will try and if it work I will add a comment here in this post to let other know. 

Presently, I am using ZYBO but latter I need to test a custom board then I would need to create Petalinux project using template and HDF and would need to update the devicetree for any external devices.

Should I then just update "system-user.dtsi" manually and build the project ?  

Regarding the Set command should I run "Set DTG" in the project directory ? 

Set CONFIG_SUBSYSTEM_MACHINE_NAME

 

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

Yes, just manually update the system-user.dtsi

 

Use the BSP (unzip it) as a reference for the system-user.dtsi

0 Kudos
Highlighted
Adventurer
Adventurer
318 Views
Registered: ‎10-18-2019

Hi @stephenm

Just one more question. There is a bit file in Vivado project folder. 

C:\XilinxProjects\zybo_project_1\zybo_project_1.sdk\design_1_wrapper_hw_platform_0\design_1_wrapper.bit

If I create Petalinux project using HDF or using BSP, there is also a bit file after running petalinux-build command. The new bit file appear in the directory image/linux together with several other files like elf, u-boot.bin and zimage etc. Which bit file should I use to program ? 

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

When you export to SDK you should include the bitstream. This will be then added to the HDF. This way the SW stays in sync with the HW.

Then when you generate the Petalinux project, this bit will be used in Petalinux and delivered in images/linux folder.

Then use petalinux-package --boot --fpga system.bit --u-boot

 

You can use whatever bit you like. However, I recommend using the one delivered in the HDF. This way the metadata in the HDF matches the bitstream

View solution in original post

0 Kudos