UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Visitor ttxs
Visitor
9,117 Views
Registered: ‎11-10-2015

Some general questions about the embeded design flow

Jump to solution

I am new in this field and really confused by the following design flow. Especially, what is the "Petalinux" tool used for? I understand that "Petalinux tools" and "Vivado SDK" are 2 independent tools. But I am not sure about the relationship between them.

 

To my understanding, Vivado generates the hardware design, and its output is .bit file.  Then Xilinx SDK handles the sofware part. For the cross-compile of linux for ARM processor,  the Xilinx SDK provides something called "arm-linux-eabi-gcc".  Therefore, with the device-tree-xlnx, dtc, linux-xlnx and u-boot-xlnx, we can use "arm-linux-eabi-gcc" to generate the compiled Linux OS for ARM.

 

Then what does the "Petalinux" do in this situation? 

petalinux-flow-201310-v6.jpg

0 Kudos
1 Solution

Accepted Solutions
Highlighted
Xilinx Employee
Xilinx Employee
17,347 Views
Registered: ‎09-10-2008

Re: Some general questions about the embeded design flow

Jump to solution

Hi,

 

You've got it right that Vivado produces the h/w bitstream and a file that describes the system.

 

From there you can do Linux 2 different ways with Xilinx tools. Both ways assume you have a Linux host to build the system.

 

The first way that is easiest out of the box is to use Petalinux, a set of tools to build a Linux system.  It will take the handoff file from Vivado that describes the system (an hdf file exported from Vivado) and generate a device tree, the FSBL, u-boot, and a Linux kernel/rootfs that will boot on a Xilinx board.  Prebuilt BSPs for Xilinx boards even make this easier as they have prebuilt images.

 

The 2nd way, for those with more Linux experience, is to go on your own using the cross tools provided in the SDK to build your own Linux system.  The SDK will not build u-boot or the kernel, but only the device tree and Linux apps. The Xilinx Wiki describes this path also and there are prebuilt images for this path also on the wiki for Xilinx boards. You need to know how to get source code from the GIT repos and build everything manually.

 

Hope that helps,

John

8 Replies
Highlighted
Xilinx Employee
Xilinx Employee
17,348 Views
Registered: ‎09-10-2008

Re: Some general questions about the embeded design flow

Jump to solution

Hi,

 

You've got it right that Vivado produces the h/w bitstream and a file that describes the system.

 

From there you can do Linux 2 different ways with Xilinx tools. Both ways assume you have a Linux host to build the system.

 

The first way that is easiest out of the box is to use Petalinux, a set of tools to build a Linux system.  It will take the handoff file from Vivado that describes the system (an hdf file exported from Vivado) and generate a device tree, the FSBL, u-boot, and a Linux kernel/rootfs that will boot on a Xilinx board.  Prebuilt BSPs for Xilinx boards even make this easier as they have prebuilt images.

 

The 2nd way, for those with more Linux experience, is to go on your own using the cross tools provided in the SDK to build your own Linux system.  The SDK will not build u-boot or the kernel, but only the device tree and Linux apps. The Xilinx Wiki describes this path also and there are prebuilt images for this path also on the wiki for Xilinx boards. You need to know how to get source code from the GIT repos and build everything manually.

 

Hope that helps,

John

Explorer
Explorer
9,082 Views
Registered: ‎07-17-2014

Re: Some general questions about the embeded design flow

Jump to solution
I've been using the petalinux commandline tools reasonably well as the SDK crashes regularly and randomly on my CentOS (6.7) system. You definitely want to start with the Petalinux tools though. -Ben
Visitor ttxs
Visitor
9,064 Views
Registered: ‎11-10-2015

Re: Some general questions about the embeded design flow

Jump to solution

petalinux-create --type project --template zynq --name Our1stlab  (no error)

petalinux-config --get-hw-description -p Our1stlab  (we saw the menuconfig gui then got the following errors)

 

ln@ln-PC:~/PetaLinux_Project/Lab1$ petalinux-config --get-hw-description -p Our1stlab/
INFO: Checking component...
INFO: Getting hardware description...
cp: omitting directory ‘/home/ln/PetaLinux_Project/Lab1/Our1stlab’
INFO: Rename system_wrapper.hdf to system.hdf

****** hsi v (64-bit)
  **** SW Build 1266856 on Fri Jun 26 16:35:25 MDT 2015
    ** Copyright 1986-2015 Xilinx, Inc. All Rights Reserved.

source /home/ln/PetaLinux_Project/Lab1/Our1stlab/build/linux/hw-description/hw-description.tcl -notrace
INFO: [Common 17-206] Exiting hsi at Fri Nov 13 16:03:42 2015...
INFO: Config linux
[INFO ] oldconfig linux
ERROR: Failed to oldconfig linux!
ERROR: Failed to config subsystem linux.
/bin/sh: 1: pushd: not found
/bin/sh: 1: popd: not found
make: *** [oldconfig] Error 127

Could you please give me some hints here what is going on?

0 Kudos
Xilinx Employee
Xilinx Employee
9,058 Views
Registered: ‎03-13-2012

Re: Some general questions about the embeded design flow

Jump to solution

My guess: What is /bin/sh on your system? PetaLinux requires it to be bash.

Explorer
Explorer
9,032 Views
Registered: ‎07-17-2014

Re: Some general questions about the embeded design flow

Jump to solution
IIRC, Xilinx's tools use something specific in BASH that got fixed/changed/something after version 4.1.2-33.el6 (if you're using RedHat or CentOS or Scientific Linux) like I am. Stick to bash 4.1.2-33.el6. I'm using an older version of Petalinux as well (2014.2) and when I upgrade, I'll check to make sure it still works. But there's an issue with version of bash that burned me too. -Ben
Visitor ttxs
Visitor
9,024 Views
Registered: ‎11-10-2015

Re: Some general questions about the embeded design flow

Jump to solution

The error disappears after I followed the instructions in  http://www.xilinx.com/support/answers/63033.html

0 Kudos
Visitor ttxs
Visitor
9,020 Views
Registered: ‎11-10-2015

Re: Some general questions about the embeded design flow

Jump to solution

But now I came across some new problem. That is, when I typed in "petalinux-build" in the project folder, I got the following error:

INFO: Checking component...
INFO: Generating make files and build linux
INFO: Generating make files for the subcomponents of linux
INFO: Building linux
[INFO ] pre-build linux/rootfs/fwupgrade
[INFO ] pre-build linux/rootfs/peekpoke
[INFO ] pre-build linux/rootfs/uWeb
[INFO ] build system.dtb
[INFO ] build linux/kernel
[INFO ] update linux/u-boot source
[INFO ] generate linux/u-boot configuration files
[INFO ] build linux/u-boot
[INFO ] build zynq_fsbl
[INFO ] Setting up stage config
[INFO ] Setting up rootfs config
[INFO ] Updating for cortexa9-vfp-neon
[INFO ] Updating package manager
[INFO ] Expanding stagefs
[INFO ] build linux/rootfs/fwupgrade
[INFO ] build linux/rootfs/peekpoke
[INFO ] build linux/rootfs/uWeb
[INFO ] build kernel in-tree modules
[INFO ] modules linux/kernel
[INFO ] post-build linux/rootfs/fwupgrade
[INFO ] post-build linux/rootfs/peekpoke
[INFO ] post-build linux/rootfs/uWeb
[INFO ] pre-install linux/rootfs/fwupgrade
[INFO ] pre-install linux/rootfs/peekpoke
[INFO ] pre-install linux/rootfs/uWeb
[INFO ] install system.dtb
[INFO ] install linux/kernel
[INFO ] update linux/u-boot source
[INFO ] generate linux/u-boot configuration files
[INFO ] build linux/u-boot
[INFO ] install linux/u-boot
[INFO ] Expanding rootfs
[INFO ] install sys_init
[INFO ] install linux/rootfs/fwupgrade
[INFO ] install linux/rootfs/peekpoke
[INFO ] install linux/rootfs/uWeb
[INFO ] install kernel in-tree modules
[INFO ] modules_install linux/kernel
[INFO ] post-install linux/rootfs/fwupgrade
[INFO ] post-install linux/rootfs/peekpoke
[INFO ] post-install linux/rootfs/uWeb
[INFO ] package rootfs.cpio to /home/ln/PetaLinux_Project/Lab1/Our1stlab/images/linux
[INFO ] Update and install vmlinux image
[INFO ] vmlinux linux/kernel
[INFO ] install linux/kernel
[INFO ] package zImage
[INFO ] zImage linux/kernel
[INFO ] install linux/kernel
[INFO ] Package HDF bitstream
[INFO ] Failed to copy images to TFTPBOOT /tftpboot

What does the "Failed to copy images to TFTPBOOT /tftpboot" mean? 

In my /images/linux folder, I got these generated files.  Not sure it is successful or not.

drwxrwxr-x 2 ln ln     4096 Nov 15 13:19 ./
drwxrwxr-x 3 ln ln     4096 Nov 15 13:07 ../
-rwxrwxr-x 1 ln ln 10474640 Nov 15 13:19 image.elf*
-rw-rw-r-- 1 ln ln  6902968 Nov 15 13:19 image.ub
-rw-rw-r-- 1 ln ln  7812608 Nov 15 13:19 rootfs.cpio
-rw-rw-r-- 1 ln ln  3445075 Nov 15 13:19 rootfs.cpio.gz
-rw-rw-r-- 1 ln ln    13476 Nov 15 13:19 system.dtb
-rw-rw-r-- 1 ln ln  1884839 Nov 15 13:19 System.map.linux
-rw-rw-r-- 1 ln ln 13321514 Nov 12 17:14 system_wrapper.bit
-rwxrwxr-x 1 ln ln   296496 Nov 15 13:19 u-boot.bin*
-rwxrwxr-x 1 ln ln  1816602 Nov 15 13:19 u-boot.elf*
-rwxrwxr-x 1 ln ln   296496 Nov 15 13:19 u-boot-s.bin*
-rwxrwxr-x 1 ln ln  1816602 Nov 15 13:19 u-boot-s.elf*
-rwxrwxr-x 1 ln ln   852516 Nov 15 13:19 u-boot.srec*
-rwxrwxr-x 1 ln ln   852558 Nov 15 13:19 u-boot-s.srec*
-rw-rw-r-- 1 ln ln  3445139 Nov 15 13:19 urootfs.cpio.gz
-rwxrwxr-x 1 ln ln 13801987 Nov 15 13:19 vmlinux*
-rwxrwxr-x 1 ln ln  6904736 Nov 15 13:19 zImage*
-rwxrwxr-x 1 ln ln   288494 Nov 15 13:19 zynq_fsbl.elf*
0 Kudos
Explorer
Explorer
9,013 Views
Registered: ‎07-17-2014

Re: Some general questions about the embeded design flow

Jump to solution
You should have a tftpboot directory in your root. Typically it's created when you have a tftp server installed on the system. The install script usually makes it. But the perms are usually set for superusers. (from the last items, it's really important that you specify which distro you're using... which we've indirectly gleaned by one of your posts is Ubuntu -- but your original post should state such from now on) Your user should have write access to that directory. If not -- chmod the directory to allow your user to write there. But be careful about the visibility of this machine on the internet. read up on TFTP to understand what kind of service it is -- as it's not password protected. Additional Tip: You can soft link it from someplace with more storage. (my root dir is rather slim and I put things mostly in my /d1 which is a RAID5 array. From there, /tftpboot is a softlink to /d1/tftpboot) Cheers, -Ben