cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
cakmakhasankaan
Visitor
Visitor
719 Views
Registered: ‎10-06-2019

How Petalinux choose hardware between BSP and get-hw-description ?

Jump to solution

Hello everyone,

I am using zcu104 board and I am trying to create a project with petalinux which is compatible with board. I tried to open a project with zcu104 official BSP and then implementing my hardware design with petalinux-config --get-hw-description command. When I build that, the PL part of my project didn't show up in Device Tree and the ip drivers didn't builded properly as well. How should I use BSP to create my project ?

0 Kudos
1 Solution

Accepted Solutions
sabankocal
Voyager
Voyager
599 Views
Registered: ‎08-02-2019

Hi @cakmakhasankaan ,

We can go step by step:

  • every petalinux project can have max. 1 hardware design. If you copy-paste your design into hwdef folder and call petalinux-config with it, your petalinux builds according to your new copied hardware definition.
  • cp /.../xapp1078_2018.2/design/work/project_1/project_1.sdk/design_1_wrapper.hdf ../hwdef
    petalinux-config --get-hw-description=../hwdef
    petalinux-build
  • If you don't touch hwdef folder, it uses initial hw design. (Vivado bit file converted to .hdf file)
  • If you dont use SDK, software and you want to only use Vivado design on your board then you need to call
  • ll images/linux/
    petalinux-package --boot --fsbl images/linux/zynq_fsbl.elf --fpga /..../xapp1078_2018.2/design/work/project_1/project_1.runs/impl_1/design_1_wrapper.bit --u-boot --force
    ll images/linux/
    It generates a bin file, that contains no software on CPUs.
  • If you want to get also Software parts, you need to generate your bin file differently by using Xilinx SDK.
  • for example: My design has CPU0 as Petalinux and CPU1 as Bare Metal. To integrate CPU1 bare metal code into your BOOT.BIN file you need to create it by addind CPU1 software into creation script. To define it Xilinx SDK uses bif files. As an example, my bif file looks like:
  • //arch = zynq; split = false; format = BIN
    the_ROM_image:
    {
    	[bootloader]/home/..../xapp1078_2018.2/design/work/project_1/project_1.sdk/fsbl/Debug/fsbl.elf
    	/home/..../xapp1078_2018.2/design/work/project_1/project_1.sdk/design_1_wrapper_hw_platform_0/design_1_wrapper.bit
    	/opt/Petalinux/xapp1078_2014.4/plnx-project/images/linux/u-boot.elf
    	/home/..../xapp1078_2018.2/design/work/project_1/project_1.sdk/app_cpu1/Debug/app_cpu1.elf
    }
    Last of them shows your app_cpu1 software.
  • /home/..../xapp1078_2018.2/design/work/project_1/project_1.sdk/design_1_wrapper_hw_platform_0/design_1_wrapper.bit --> indicates which hardware definition you want to use. In your question it is BSP's bit file.
  • As an example video on youtube:
  • https://www.youtube.com/watch?v=bGgPLgnntRk

Saban

<--- If reply is helpful, please feel free to give Kudos, and close if it answers your question --->

View solution in original post

3 Replies
sabankocal
Voyager
Voyager
616 Views
Registered: ‎08-02-2019

Hi @cakmakhasankaan ,

I'm using Xapp1078 to get a design, CPU0 is Petalinux and CPU1 is Bare Metal.

I can share Xilinx's documantation about how you create petalinux project. It uses Vivado 2014, but you can replace it by your version. It does not metter.

At the end you can check your ips in pl.dtsi file by searching in your petalinux folders.

Create, configure & build Petalinux Project
  On a linux host machine that includes the Petalinux 2014.4 build environment, create the directory <xapp1078_2014.4>
  cd <xapp1078_2014.4>
  source </opt/petalinux-v2014.4-final>/settings.sh
    This command will setup the Petalinux environment. If Petalinux is not installed in the directory /opt/petalinux-v2014.4-final, then replace
    this part of the path with the location of your petalinux install
  petalinux-create -t project -n plnx-project
    This command creates a new petalinux project named plnx-project in the current directory
  cd plnx-project
  mkdir ../hwdef
    Create a directory that will contain the Vivado exported hdf file
  cp /home/saban/vivado/xapp1078_2014.4/design/work/project_1/project_1.sdk/design_1_wrapper.hdf ../hwdef
  
  source  /opt/Xilinx/PetaLinux/settings.sh
  cd /opt/Xilinx/PetaLinux/xapp1078_2018.2/plnx-project/
  cp ~/Desktop/Files_From_Windows_2018.2/zsys_wrapper.hdf ../hwdef
    This command copies the Vivado exported hdf file
  petalinux-config --get-hw-description=../hwdef
    This command configures petalinux to point to the directory that contains the hdf file
    A dts file is created in subsystems/linux/configs/device-tree. This dts file can be modified
  When the Linux System Configuration window appears:
    select Kernel Bootargs
    Deselect 'generate boot args automatically' by pressing 'n' 
    Select 'user set kernel bootargs' and press enter
    Enter the following: 
      console=ttyPS0,115200 earlyprintk maxcpus=1 mem=768M
    Select Ok
    Select Exit
    Select Exit
    Select Yes
      Saves the new configuration

Saban

 

<--- If reply is helpful, please feel free to give Kudos, and close if it answers your question --->
0 Kudos
cakmakhasankaan
Visitor
Visitor
609 Views
Registered: ‎10-06-2019

Thank you @sabankocal  for your answer but it does not answer that which hardware will be used on board when the project have 2 hardware design which come from both board support package and another hardware from get-hw-description command. To explain my problem further, I have a hardware design that I want to implement on the board but I lack of software part which comes from board support package. How can I take only the software from BSP and take hardware design from mine ?

0 Kudos
sabankocal
Voyager
Voyager
600 Views
Registered: ‎08-02-2019

Hi @cakmakhasankaan ,

We can go step by step:

  • every petalinux project can have max. 1 hardware design. If you copy-paste your design into hwdef folder and call petalinux-config with it, your petalinux builds according to your new copied hardware definition.
  • cp /.../xapp1078_2018.2/design/work/project_1/project_1.sdk/design_1_wrapper.hdf ../hwdef
    petalinux-config --get-hw-description=../hwdef
    petalinux-build
  • If you don't touch hwdef folder, it uses initial hw design. (Vivado bit file converted to .hdf file)
  • If you dont use SDK, software and you want to only use Vivado design on your board then you need to call
  • ll images/linux/
    petalinux-package --boot --fsbl images/linux/zynq_fsbl.elf --fpga /..../xapp1078_2018.2/design/work/project_1/project_1.runs/impl_1/design_1_wrapper.bit --u-boot --force
    ll images/linux/
    It generates a bin file, that contains no software on CPUs.
  • If you want to get also Software parts, you need to generate your bin file differently by using Xilinx SDK.
  • for example: My design has CPU0 as Petalinux and CPU1 as Bare Metal. To integrate CPU1 bare metal code into your BOOT.BIN file you need to create it by addind CPU1 software into creation script. To define it Xilinx SDK uses bif files. As an example, my bif file looks like:
  • //arch = zynq; split = false; format = BIN
    the_ROM_image:
    {
    	[bootloader]/home/..../xapp1078_2018.2/design/work/project_1/project_1.sdk/fsbl/Debug/fsbl.elf
    	/home/..../xapp1078_2018.2/design/work/project_1/project_1.sdk/design_1_wrapper_hw_platform_0/design_1_wrapper.bit
    	/opt/Petalinux/xapp1078_2014.4/plnx-project/images/linux/u-boot.elf
    	/home/..../xapp1078_2018.2/design/work/project_1/project_1.sdk/app_cpu1/Debug/app_cpu1.elf
    }
    Last of them shows your app_cpu1 software.
  • /home/..../xapp1078_2018.2/design/work/project_1/project_1.sdk/design_1_wrapper_hw_platform_0/design_1_wrapper.bit --> indicates which hardware definition you want to use. In your question it is BSP's bit file.
  • As an example video on youtube:
  • https://www.youtube.com/watch?v=bGgPLgnntRk

Saban

<--- If reply is helpful, please feel free to give Kudos, and close if it answers your question --->

View solution in original post