top of page
  • Zach Pfeffer

Create, Build and Test a PetaLinux Tools 2017.4 Project


This post lists the commands to create, configure and test a PetaLinux Tools project using PetaLinux Tools 2017.4.

Before you Start

If you haven't installed PetaLinux Tools 2017.4 go through Download and Install Xilinx's 2017.4 PetaLinux Tools.

This write up connects to a hw_server to test the build. It uses a COM port to see output from the unit.

Steps

1. Create a directory for all PetaLinux projects

2. Copy an HDF to it

3. Set Up the Environment

You should see:

4. Create your project

You should see:

5. Configure it with an HDF

You should see:

6. Build it

You should see after a few minutes:

7. Test it

7.1 Connect to your COM port via minicom

Note: type Control-A then type X to quit

-o: skip init code

-w: turns line-wrap on at startup by default

-C filename: open capture at start up

Note from minicom man:

Minicom keeps it's configuration files in one directory, usually /var/lib/minicom, /usr/local/etc or /etc. To find out what default directory minicom has compiled in, issue the command minicom -h.

Here's the output on my machine:

7.2 Test the build via jtag with

Note: even though it says --kernel, this command downloads the following binaries:

PMUFW, FSBL, A Linux FIT image, the Device Tree Binary, a "light boot loader," compiled by PetaLinux (called linux-boot.elf) and Arm Trusted Firmware (called bl31.elf).

You should see a kernel dmesg output on the com port and a log in prompt:

Log in with root, password is root.

8. Fix JTAG Boot a second, third, fourth time...

The jtag boot command only works once for me. To build something a little more robust I created the following.

8.1 Output the XSCT TCL commands that PetaLinux Tools uses

This will output:

Change the script to the following:

8.2 Boot with

8.3 If things still don't work, you get an error about cores being powered down, then run xsct and paste in each command.

Suggestions to Xilinx

1. Fix needing to set DISPLAY=dummy for xsct to run from the command line

You should not need to set a DISPLAY variable to run a command line tool:

The work around is presented at: https://www.xilinx.com/support/answers/67132.html "XSCT 2016 - Error: Xvfb is only supported on Linux"

Please fix this ASAP.

References

  • Tux from link (found via Google image search)

  • PetaLinux Tools Documentation Reference Guide UG1144 (v2017.4)

  • PetaLinux Tools Documentation Workflow Tutorial UG1156 (v2017.4)

bottom of page