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

How to create Petalinux 2018.3 project with BSP from 2017.4

Jump to solution

Hi, 

I am wondering if there is any way to create Petalinux 2018.3 project with BSP from 2017.4 ? 

0 Kudos
1 Solution

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

I have not used this Zybo board. So, I gave it a go on my end.

Building Hardware:

I downloaded the board files from here:

git clone https://github.com/Digilent/vivado-boards

I then launched Vivado, and in the TCL console I added this board:

  • set_param board.repoPaths ./vivado-boards/new/board_files/zybo/B.4

I created a simple BD with just the Zynq PS in it for testing. I generated the output products,

created the HDL wrapper, and generate bitstream, and exported to SDK

Building Software:

  • petalinux-create -t project --template zynq -n zybo_image
  • cd zybo_image
  • petalinux-config --get-hw-description=<path to HDF file> --silentconfig
    • Note: The Yocto Settings -> YOCTO_MACHINE_NAME is set to plnx_zynq7
    • Note: The DTG Settings ->  MACHINE_NAME is only for Xilinx boards. You will need to leave this as template
  • petalinux-build
  • cd images/linux
  • petalinux-package --boot --fpga system.bit --u-boot

View solution in original post

0 Kudos
18 Replies
Highlighted
Moderator
Moderator
493 Views
Registered: ‎09-12-2007

This will work, but it's not recommended. 

You should use the petalinux-create -t project --template zynq -n linux_images

Then update the system-user.dtsi with the system-user.dtsi found in the BSP (just unzip it)

 this assumes your HW is the same as the one used in the BSP

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

@stephenm

I have created a Petalinux project in v2018.3 using HDF taken from Vivado SDK.  

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/hdf

Then I unzip "Petalinux-Zybo-2017.4-1.bsp" and locate the file "system-user.dtsi" in unzip folder. I copy the contents from this file and paste in the file "system-user.dtsi" in project directory: zybo-hello-2/project-spec/meta-user/recipes-bsp/device-tree/files/system-user.dtsi

 There are several errors when I build the Petalinux project. 

peter@peter:~/opt/xilinx/petalinux/projects/zybo-hello-2$ petalinux-build
[INFO] building project
[INFO] sourcing bitbake
INFO: bitbake petalinux-user-image
Loading cache: 100% |#######################################################################################################################################################################| Time: 0:00:01
Loaded 3445 entries from dependency cache.
Parsing recipes: 100% |#####################################################################################################################################################################| Time: 0:00:07
Parsing of 2570 .bb files complete (2537 cached, 33 parsed). 3446 targets, 149 skipped, 0 masked, 0 errors.
NOTE: Resolving any missing task queue dependencies
Initialising tasks: 100% |##################################################################################################################################################################| Time: 0:00:18
Checking sstate mirror object availability: 100% |##########################################################################################################################################| Time: 0:00:13
NOTE: Executing SetScene Tasks
NOTE: Executing RunQueue Tasks
ERROR: device-tree-xilinx+gitAUTOINC+b7466bbeee-r0 do_compile: Function failed: do_compile (log file is located at /home/peter/opt/xilinx/petalinux/projects/zybo-hello-2/build/tmp/work/plnx_zynq7-xilinx-linux-gnueabi/device-tree/xilinx+gitAUTOINC+b7466bbeee-r0/temp/log.do_compile.25146)
ERROR: Logfile of failure stored in: /home/peter/opt/xilinx/petalinux/projects/zybo-hello-2/build/tmp/work/plnx_zynq7-xilinx-linux-gnueabi/device-tree/xilinx+gitAUTOINC+b7466bbeee-r0/temp/log.do_compile.25146
Log data follows:
| DEBUG: Executing shell function do_compile
| Error: /home/peter/opt/xilinx/petalinux/projects/zybo-hello-2/build/tmp/work/plnx_zynq7-xilinx-linux-gnueabi/device-tree/xilinx+gitAUTOINC+b7466bbeee-r0/system-user.dtsi:54.1-9 Label or path amba_pl not found
| Error: /home/peter/opt/xilinx/petalinux/projects/zybo-hello-2/build/tmp/work/plnx_zynq7-xilinx-linux-gnueabi/device-tree/xilinx+gitAUTOINC+b7466bbeee-r0/system-user.dtsi:76.1-14 Label or path axi_dynclk_0 not found
| Error: /home/peter/opt/xilinx/petalinux/projects/zybo-hello-2/build/tmp/work/plnx_zynq7-xilinx-linux-gnueabi/device-tree/xilinx+gitAUTOINC+b7466bbeee-r0/system-user.dtsi:81.1-12 Label or path axi_vdma_0 not found
| Error: /home/peter/opt/xilinx/petalinux/projects/zybo-hello-2/build/tmp/work/plnx_zynq7-xilinx-linux-gnueabi/device-tree/xilinx+gitAUTOINC+b7466bbeee-r0/system-user.dtsi:84.1-10 Label or path v_tc_out not found
| Error: /home/peter/opt/xilinx/petalinux/projects/zybo-hello-2/build/tmp/work/plnx_zynq7-xilinx-linux-gnueabi/device-tree/xilinx+gitAUTOINC+b7466bbeee-r0/system-user.dtsi:88.1-15 Label or path axi_gpio_hdmi not found
| Error: /home/peter/opt/xilinx/petalinux/projects/zybo-hello-2/build/tmp/work/plnx_zynq7-xilinx-linux-gnueabi/device-tree/xilinx+gitAUTOINC+b7466bbeee-r0/system-user.dtsi:93.1-9 Label or path amba_pl not found
| Error: /home/peter/opt/xilinx/petalinux/projects/zybo-hello-2/build/tmp/work/plnx_zynq7-xilinx-linux-gnueabi/device-tree/xilinx+gitAUTOINC+b7466bbeee-r0/system-user.dtsi:127.1-15 Label or path axi_i2s_adi_0 not found
| Error: /home/peter/opt/xilinx/petalinux/projects/zybo-hello-2/build/tmp/work/plnx_zynq7-xilinx-linux-gnueabi/device-tree/xilinx+gitAUTOINC+b7466bbeee-r0/system-user.dtsi:149.1-14 Label or path axi_gpio_led not found
| Error: /home/peter/opt/xilinx/petalinux/projects/zybo-hello-2/build/tmp/work/plnx_zynq7-xilinx-linux-gnueabi/device-tree/xilinx+gitAUTOINC+b7466bbeee-r0/system-user.dtsi:154.1-17 Label or path axi_gpio_sw_btn not found
| FATAL ERROR: Syntax error parsing input tree
| WARNING: /home/peter/opt/xilinx/petalinux/projects/zybo-hello-2/build/tmp/work/plnx_zynq7-xilinx-linux-gnueabi/device-tree/xilinx+gitAUTOINC+b7466bbeee-r0/temp/run.do_compile.25146:1 exit 1 from 'dtc -I dts -O dtb -R 8 -p 0x1000 -b 0 -i /home/peter/opt/xilinx/petalinux/projects/zybo-hello-2/build/../components/plnx_workspace/device-tree/device-tree -i /home/peter/opt/xilinx/petalinux/projects/zybo-hello-2/build/tmp/work-shared/plnx-zynq7/kernel-source/include -i /home/peter/opt/xilinx/petalinux/projects/zybo-hello-2/build/tmp/work-shared/plnx-zynq7/kernel-source/include -i /home/peter/opt/xilinx/petalinux/projects/zybo-hello-2/build/tmp/work/plnx_zynq7-xilinx-linux-gnueabi/device-tree/xilinx+gitAUTOINC+b7466bbeee-r0 -o ${DTS_NAME}.dtb `basename ${DTS_FILE}`.pp'
| ERROR: Function failed: do_compile (log file is located at /home/peter/opt/xilinx/petalinux/projects/zybo-hello-2/build/tmp/work/plnx_zynq7-xilinx-linux-gnueabi/device-tree/xilinx+gitAUTOINC+b7466bbeee-r0/temp/log.do_compile.25146)
ERROR: Task (/home/peter/opt/xilinx/petalinux/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 2491 tasks of which 2489 didn't need to be rerun and 1 failed.

Summary: 1 task failed:
  /home/peter/opt/xilinx/petalinux/components/yocto/source/arm/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.

 

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

Your HW doesn’t match the device tree. If you are using the BSP, then your hw design in vivado would need to match the one used in the bsp. This is why you are seeing issues in DTC.

Is there a vivado project in the BSP? If so, open this in 2018.3, and the tools will ramp this for you.

 

 

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

@stephenm, I am wondering that I already have added the board files in Vivado and my Vivado project is board aware. I have included the bit file when exporting to SDK. This means that the SDK program is also board aware.  

Is it possible to generate and export the BSP from SDK that I can latter use to create a project in Petalinux ? 

 

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

The SDK BSP (a baremetal collection of drivers and libraries) is not the same as a Petalinux BSP (a pre canned Petalinux project for a target board)

You  don't need to use the BSP for Petalinux. It is just easier. 

The devicetree generator will create the devicetree for you. However, you will need to add the nodes that are external to the chip.  Such as the phy, or devices on your i2c. Use the BSP as reference.

I suggest you try boot the image created in Petalinux using the template and HDF used in petalinux-config and go from there. 

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

@stephenm,  if I create a project using template and HDF then how would I add board information.

I guess the HDF contain chip level details and the BSP contain board related details and is independed of the chip configuration, right ?  If we change the PS configuration or make any change in PL then the new HDF file has to be over written in the Petalinux project and this will be only chip level update. The BSP should be included in the project somehow in the start and might night need any update or change even if the chip configuration is change. 

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

You will need to add the devicetree nodes for the devices external to the chip Manually.

If you make changes to HW, you will need to re-run the petalinux-config --get-hw-description.

The bsp in Petalinux is a pre-built project that has some config specific to a board, and a devicetree for the board. That is all. 

 

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

@stephenm 

I have replaced all the contents of the file "system-user.dtsi" in v2018.3 project directory: zybo-hello-2/project-spec/meta-user/recipes-bsp/device-tree/files/system-user.dtsi with the same file located in unzip "Petalinux-Zybo-2017.4-1.bsp". I guess the device tree contains the information about on-board components outside the chip. It should be same in v2017.4 project and can be used in v2018.3. Which file contains device tree node details, "system-user.dtsi" or any other file ? 

I also have tried another approach. I have downloaded v2017.4 project and tired to open and run in v2018.3 . I am not able to run config and build commands. 

https://github.com/Digilent/Petalinux-Zybo-Z7-20

 

 

peter@peter:~/opt/xilinx/petalinux/projects/Petalinux-Zybo-Z7-20-master/Zybo-Z7-20$ petalinux-config -c kernel
WARNING: Your PetaLinux project was last modified by PetaLinux SDK version "2017.4",
WARNING: however, you are using PetaLinux SDK version "2018.3".
Please input "y" to continue. Otherwise it will exit![n]y
[INFO] generating Kconfig for project
[INFO] sourcing bitbake
[INFO] generating plnxtool conf
[INFO] generating meta-plnx-generated layer
[INFO] configuring: kernel
[INFO] generating kernel configuration files
[INFO] bitbake virtual/kernel -c menuconfig
WARNING: You have included the meta-virtualization layer, but 'virtualization' has not been enabled in your DISTRO_FEATURES. Some bbappend files may not take effect. See the meta-virtualization README for details on enabling virtualization support.
ERROR:  OE-core's config sanity checker detected a potential misconfiguration.
    Either fix the cause of this error or at your own risk disable the checker (see sanity.conf).
    Following is the list of potential problems / advisories:

    Please set a MACHINE in your local.conf or environment


Summary: There was 1 WARNING message shown.
Summary: There was 1 ERROR message shown, returning a non-zero exit code.
ERROR: bitbake failed to cleansstate kernel
ERROR: Failed to config kernel.
peter@peter:~/opt/xilinx/petalinux/projects/Petalinux-Zybo-Z7-20-master/Zybo-Z7-20$ petalinux-build
[INFO] building project
[INFO] sourcing bitbake
[INFO] generating kconfig for Rootfs
Traceback (most recent call last):
  File "rootfs_config.py", line 315, in <module>
    parse_args(sys.argv[1:])
  File "rootfs_config.py", line 290, in parse_args
    extract_packages_dot(packages_user)
  File "rootfs_config.py", line 257, in extract_packages_dot
    with open(packages_dot,'r') as fp:
IOError: [Errno 2] No such file or directory: '/home/peter/opt/xilinx/petalinux/projects/Petalinux-Zybo-Z7-20-master/Zybo-Z7-20/project-spec/meta-user/recipes-core/images/petalinux-image-full.bbappend'
ERROR: Failed to generate rootfs /home/peter/opt/xilinx/petalinux/projects/Petalinux-Zybo-Z7-20-master/Zybo-Z7-20/build/misc/rootfs_config/Kconfig.user
ERROR: Failed to build project

 

 

 

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

The error is given here:

 Please set a MACHINE in your local.conf or environment

go to petalinux-config -> yocto settings and enter the machine name:

zybo-zynq7

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

@stephenm This means that the Machine Name was missing in the v2017.4 project that I have downloaded from  

https://github.com/Digilent/Petalinux-Zybo-Z7-20

I have looked at the page 24 of UG1144 (v2018.3). The text is also copied below. 

1. petalinux-config--get-hw-description=<PATH-TO-HDF/DSA-DIRECTORY>
2. Set CONFIG_SUBSYSTEM_MACHINE_NAME as required.
a. The possible values are: ac701-full, ac701-lite, kc705-full, kc705-lite, kcu105,
zc1254-reva, zc1275-reva, zc1275-revb, zc1751-dc1, zc1751-dc2, zc702 zc706,
avnet-ultra96-rev1, zcu100-reva zcu100-revb, zcu100-revc zcu102-rev1.0,
zcu102-reva, zcu102-revb, zcu104-reva, zcu104-revc, zcu106-reva, zcu111-reva,
zedboard.
b. In petalinux-config DTG Settings ---> (template) MACHINE_NAME, change the
template to any of the above mentioned possible value.

I don't find the command to set the machine name. Even I don't find the machine name for ZYBO in UG1144 (v2018.3) but I guess it is "zybo-zynq7". How to set the machine name ? Which command to run ? 

 

peter@peter:~/opt/xilinx/petalinux/projects/zybo-hello-2$ petalinux-config --> Yocto-settings --> zybo-zynq7
ERROR: Invalid options: --

 

 

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

I have not used this Zybo board. So, I gave it a go on my end.

Building Hardware:

I downloaded the board files from here:

git clone https://github.com/Digilent/vivado-boards

I then launched Vivado, and in the TCL console I added this board:

  • set_param board.repoPaths ./vivado-boards/new/board_files/zybo/B.4

I created a simple BD with just the Zynq PS in it for testing. I generated the output products,

created the HDL wrapper, and generate bitstream, and exported to SDK

Building Software:

  • petalinux-create -t project --template zynq -n zybo_image
  • cd zybo_image
  • petalinux-config --get-hw-description=<path to HDF file> --silentconfig
    • Note: The Yocto Settings -> YOCTO_MACHINE_NAME is set to plnx_zynq7
    • Note: The DTG Settings ->  MACHINE_NAME is only for Xilinx boards. You will need to leave this as template
  • petalinux-build
  • cd images/linux
  • petalinux-package --boot --fpga system.bit --u-boot

View solution in original post

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

Note: I don't have this board. So, I tested the Linux kernel boot in QEMU

  • cd zybo_image
  • petalinux-boot --qemu --kernel

zybo_boot.PNG

To quit Ctrl A + x

 

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

Also, I didn't have the PHY node added. We can see this if we boot uboot:

  • petalinux-boot --qemu --u-boot

zybo_uboot_no_phy.PNG

So, I added this node to the system-user.dtsi:

 

&gem0 {
	phy-handle = <&ethernet_phy>;
/*	phy-reset-gpio = <&axi_gpio_eth 0 0>;
	phy-reset-active-low;	
	phy-reset-duration = <10>; */
	ethernet_phy: ethernet-phy@1 { /* rtl8211e-vl */
		reg = <1>;
		device_type = "ethernet-phy";
	};
};

 

If I add this, and rebuild and reboot

  • petalinux-build
  • petalinux-boot --qemu --u-boot

zybo_uboot_with_phy.PNG

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

@stephenm, Thanks a lot. It's good to see that it is possible to open and run v2017.4 project in v2018.3. I will also try this. 

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

I created the project in vivado from scratch in 2018.3

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

Also, can you mark this as solved. This will help others targeting this board

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

@stephenm, I confirm that it works. I am also able to build the project and launch QEMU. Thanks for help. 

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

Great

0 Kudos