Showing results for 
Show  only  | Search instead for 
Did you mean: 
Registered: ‎12-03-2019

Running vitis from windows using sysroot exported from petalinux

vitis (or xsdk) integration with petalinux is all over the place.
A couple of questions:

  1. What is the recommended way to setup a linux domain and app project in Vitis (running on Windows) using sysroot exported from petalinux (running on VM)?
    Yes, I can copy the sysroot folder to Windows, but do I have to manually setup the configuration in vitis eclipse to be like the generated environment-setup-cortexa9t2hf-neon-xilinx-linux-gnueabi shell script?
  2. If there is no recommended way, does that mean that windows users need another copy of vitis in their linux VM (this is over 50GB) if they want to use the IDE?
    Does xilinx forces windows users to have another copy of vitis on a linux machine for doing linux development?
Tags (2)
0 Kudos
13 Replies
Xilinx Employee
Xilinx Employee
Registered: ‎09-12-2007

You need the set th XILINX_XRT param. This can be done in the script manually

0 Kudos
Registered: ‎12-03-2019

I believe you are referring to accelerated applications development.

I'm asking about cross-compiling applications from a windows machine to the cortex-a9 running linux.

Mostly, I want to know if there is a convenient way to setup a vitis linux application project with all the gcc/g++ flags on a windows machine?

0 Kudos
Registered: ‎12-11-2018


I am trying to do the same thing. Did you manage to find a solution ?

I tried doing it with Ext1-2-3-4 reader programs, but they don't really make it possible to mount/use the sysroot of an usb.

0 Kudos
Registered: ‎12-03-2019

Yes, but not in the most elegant way.
My VM was in Virtualbox. I created a shared folder between the host and the VM and copied the entire sysroot/cortexa9t2hf-neon-xilinx-linux-gnueabi folder to it (making sure to de-reference symbolic links -L). It is then available for you in Windows. In theory, you don't need the entire thing, just the include and bin folders. A small number of files failed to copy (I forget how many) which probably happened since there was a different file in the directory with the same name but different casing (allowed in Linux, but not in Windows). If you happen to require to include any of these files in your application, you can probably rename them (making sure that any other headers using them take that into account).

0 Kudos
Registered: ‎01-05-2020

The following summary describes the tool setup and use process (based on my experience). It applies to MPSOC/RFSOC and the ZCU111 target, however I believe that it may be useful with other targets as well.


I) General
Xilinx supports several software development flows for the MPSOC/RFSOC, as follows:
- Linux running on the A53 cores (in SMP mode)
- Free RTOS or "bare metal" software running on the A53 and/or R5 cores (it is
possible that different cores run different types of software).

In addition to Linux kernel and application software also need several software
packages for the system to start, as follows:
- PMU firmware
- ATF (ARM trusted firmware)
- FSBL (first-stage boot loader)
- SSBL (second-stage boot loader) - usually U-Boot

Xilinx provides two software development environments, as follows:
a) PetaLinux tools - this environment is necessary for preparing a bootable Linux
image. Specifically, it allows preparing an image containing the various
bootloaders, the Linux image and (optionally) application code.

It follows that any custom drivers that are linked to the kernel must be added to
the system using this flow.

PetaLinux tools are only supported on Linux.

b) Vitis development environment - this environment supports development of all
design flows mentioned above except for bootable Linux kernel preparation (which
necessitates PetaLinux tools).

Vitis can run on Windows or on Linux.

Application software running under Linux (on the A53 cores in SMP mode) can be
developed in two ways:
a) Using PetaLinux tools - the application is added to the bootable image.
b) Using Vitis - creating a separate executable (ELF) which can be downloaded to the
target and run separately (once Linux is up).

In the latter case, need to export target libraries, BSP data, device tree, etc.
from the PetaLinux environment to the Vitis environment. This data is known as the

In general, software development under PetaLinux is quite user-unfriendly. In
particular, there is no GUI-based IDE for building and debugging. Vitis does provide
a graphical IDE (based on Eclipse) which facilitates a reasonably convenient build
and debug flow.

Both the PetaLinux environment and the Vitis environment use custom design
details exported from Vivado (these are files with .xsa extension).

II) PetaLinux environment setup (for PetaLinux 2019.2)
1. Setting up the Linux virtual machine
a) PetaLinux development tools need to run under Linux. Per UG1144 I installed
Ubuntu 18.04.02 (64-bit). It subsequently updated itself to 18.04.4.

b) I am running Ubuntu in a VirtualBox VM. Specifically, I am using VirtualBox 6.1
(had some problems with 6.1.2).

c) Specified 200 GB disk size for the VM (the PetaLinux tools are extremely disk-

d) Needed to enable 3D acceleration, or else the display did not function very well.
Note: even now occasionally there are transient problems with rendering which are
worked around by minimizing and maximizing the VM.

e) Specified a shared folder with all permissions. Also enabled clipboard sharing.

2, Changes in Linux setup after installation
a) Changed the shell from dash to bash (sudo dpkg-reconfigure dash and select the
option not to use /bin/dash as the default shell).

b) sudo apt-get update

c) Per UG1144 installed various packages:
- Used the list provided in 2019.2_PetaLinux_Package_List.xlsx (found at
- Afterwards went over the list using sudo apt-get install commands and almost
everything was installed correctly except for pyhton-pip.
- Used the sudo apt-get install sequence from here:
- sudo apt-get install tftpd-hpa and configured it to allow client uploads as
well (this is all probably unnecessary).

d) Installed PetaLinux 2019.2 per UG1144.
Note: before doing that, issued the following command:
sudo chown beni-falk:beni-falk /opt/
Note: had to chmod the installer (.run file) to 755, or else it would not run
(UG1144 specifically says not to do that, but I had no choice).

e) After installing PetaLinux:
- Added the following to ~/.bashrc:
source /opt/pkg/petalinux/2019.2/ > /dev/null
(this last one was necessary since otherwise it wouldn't find bootgen)

- petalinux-util --webtalk off

3. Additional changes to Linux setup for the sake of compatibility, convenience, etc.
a) Using the Tweaks application (from the dock):
a1) Enabled Ubuntu app indicators.
a2) Enabled Windows-like behavior for numeric keypad keys:
Keyboard and Mouse->Additional Layout Options->
Miscellaneous compatibility options->Num Lock on: digits; Shift for arrow
keys. NumLock off: arrow keys (as in Windows)

b) Disabled screen saver (Settings->Power) since it caused the VM to misbehave.

III) Using the PetaLinux development environment (in conjunction with ZCU111 EVB)

1. ZCU111 BSP can be downloaded from here:

Another option which also comprises rftool source code is here:

2. Following the tutorial provided here:

a) petalinux-create -t project -s rfsoc_petalinux_bsp.bsp
cd rfsoc_petalinux_bsp

b) Applying the modifications as provided on that page (some of them were
unnecessary - they were already there in the 2019.2 BSP; I wasn't able to
perform the step calling for adding an entry to

c) For each of nonmts, mts, ssr:
petalinux-config --get-hw-description=$DCET_HOME/pl/<design_path>/pre-built/rfsoc_trd/
cd pre-built/linux/images
./dtc -O dtb -o pl.dtbo -b 0 -@ pl_<design type>.dtsi
bootgen -image bitstream.bif -arch zynqmp -o zcu111_rfsoc_trd_wrapper.bit.bin -w
<copy pl.dtbo and zcu111_rfsoc_trd_wrapper.bit.bin to appropriate esdcard directory>
cd $DCET_HOME/apu/rfsoc_petalinux_bsp/images/linux
petalinux-package --force --boot --fsbl zynqmp_fsbl.elf --pmufw pmufw.elf --u-boot u-boot.elf
<copy BOOT.BIN and image.ub to sdcard directory>

3. Prepare a FAT-formatted SD card containing BOOT.bin and image.ub in the root
directory (along with optional It should also contain three
subdirectories containing nonmts, mts and ssr data, respectively. This SD card
should be able to boot the ZCU111. If is provided - it can be used
to automatically set IP address (ifconfig) and start the rftool application.
Note: should be placed at the root of the SD card.


ifconfig -a | grep eth0
if [ $RESULT -eq 0 ]; then
ifconfig eth0

4. Exporting sysroot data in order to allow building and debugging the rftool
application as a standalone application (under Linux) using Vitis is done per the

petalinux-build --sdk
petalinux-package --sysroot

The above build takes a very long time (~45 minutes).

The outputs from this process that need to be conveyed to Vitis reside in the
following folder: <plnx-project>/images/linux/sdk/sysroots/aarch64-xilinx-linux

IV) (Optional) project tweaks in the PetaLinux environment
1, Addition of Midnight Commander to target image -

2. Adding auto-login (user root, password root) - this is taken from UG1144:
a) Change to the root directory of your PetaLinux project -
cd <plnx-proj-root>
b) Run petalinux-config
c) Select Yocto-settings and enable debug-tweaks
d) Save the configuration and exit
e) Run petalinux-build

V) Vitis environment setup and use (for Vitis 2019.2.1)
The following assumes that Vitis (installed on Windows) is used for developing
applications that will run on the target under Linux on the A53 cores (in SMP mode).

1. Copy sysroot data from the Linux VM - it turns out that many of the files
comprised by the sysroot are actually links to other files. When copying this
file structure to Windows need to convert each such link to the actual file.
This is done as follows (on the Linux machine):
cp -R -L <plnx-project>images/linux/sdk/sysroots/aarch64-xilinx-linux <shared_folder>
The contents of <shared_folder> can now be used under Windows.

2. Copy the images directory from the Linux machine
(<plnx-project>/images/linux - not including the sdk subdirectory).

3. Define a platform project in Vitis:
a) File->New->Platform Project->Create from hardware specification (XSA)
Browse to the appropriate .xsa file (it needs to be copied from the Linux
machine - these files are located under the pl directory, e.g.
Set Operating system to linux and Processor to psu_cortexa53

b) In the platform editor view left-click the top-most item. On the right uncheck
'Generate boot components'.

c) In the platform editor view left-click 'linux on psu_cortexa53'. Specify
additional details as follows:
- Bif File: path to BIF file (see below)
- Boot Components Directory: path to where have copied the images directory
- Linux Image Directory: ditto
- Sysroot Directory: path to where have copied sysroot data
QEMU-related fields can be left blank

d) Create a BIF (boot image format) file similar to the following:

/* linux */
[fsbl_config] a53_x64
[bootloader] <zynqmp_fsbl.elf>
[pmufw_image] <pmufw.elf>
[destination_device=pl] <bitstream>
[destination_cpu=a53-0, exception_level=el-3, trustzone] <bl31.elf>
[destination_cpu=a53-0, exception_level=el-2] <u-boot.elf>

This assumes that the BIF file resides in the images directory.

4. Build the platform project - in the Assistant view right-click the newly created
platform project and then click 'Build'.

5. Create and build an application project in Vitis:
a) File->New->Application Project
Set System project to Create New...
Select the platform, provide sysroot path
Select Linux Hello World Application

b) In the Assistant view right-click the application (the relevant
configuration - Debug or Release) and then click 'Build'.

The above generates an .elf file that can be downloaded to the target and
executed there.

6. Application (cross-)debugging using Vitis:
a) Create a target connection - on the toolbar click 'Launch Target Connections'.
Open 'Linux TCF Agent' and click 'Add new target connection'. Specify the
target's IP address (under Host). Leave the default port number (1534). Click
'Test Connection' to test the connection.

b) In the Assistant view right-click the application (the relevant
configuration) and then click Debug-> Launch on Hardware (Single Application
Debug). This starts the debug session.

c) To edit the debug configuration - in the Assistant view right-click the
application (the relevant configuration) and then click Debug->
Debug Configurations...
In the Main tab select the proper connection.
In the Application tab make sure that 'Disconnect when last debug context
exits' is checked.

Note: when debugging applications in this manner the application's standard I/O
is redirected to a console window in the debugger (TCF Debug Process

Note: It is --mandatory-- that the symbols on the host match the code running on
the embedded target (inclding user-level code, e.g. XRFDC driver and other
library code). If not, application ELF that the debugger attempts to run on
the target can terminate abnormally during execution (not necessarily
immediately). Symptoms include a message to the TCF console indicating a
failure to resolve a symbol.

Note: the debugger has trouble stepping into library code (in assembly mode, of
course). To work around this problem, can manually enter the address of the
library routine in the text box at the top of the Disassembly window and
set a breakpoint there. Then click F8 (resume).


Xilinx Employee
Xilinx Employee
Registered: ‎02-01-2008

It is unclear if you are using Vitis for an acceleration project or just to create linux apps.

If you are just creating linux apps, then you can do the following:

  1. Use petalinux on VM or linux box to build linux kernel and optionally the boot files
  2. Use petalinux on VM or linux to create sysroot (petalinux-build --sdk)
  3. Run generated to extract and create sysroot
  4. Copy the following directories from <sysroot directory>/aarch64-xilinx-linux to a directory on your windows system:
  5. In Vitis (or SDK for older versions of tools) create your linux application
  6. configure your app:  C/C++ Build Settings -> ARM v8 Linux gcc compiler -> Directories :: add include path: <path to windows sysroot>/usr/include
  7. If using RFDC driver, libmetal and math libraries:
    configure your app: C/C++ Build Settings -> ARM v8 Linux gcc linker -> libraries :: add following libraries
  8. configure your app: C/C++ Build Settings -> ARM v8 Linux gcc linker -> libraries :: add library search path: <path to windows sysroot>/usr/lib
  9. configure your app: C/C++ Build Settings -> ARM v8 Linux gcc linker -> Miscellaneous :: and set Linker Flags as follows but replace path with your windows path to sysroot (also include the double quotes)

Now you can use a Vitis debug configuration to download your app via ethernet and run/debug the app. Or, you can copy the Vitis Debug\your_app.elf to SD to run the app.

Registered: ‎01-05-2020

I am using Vitis to compile and debug Linux.applications.



0 Kudos
Registered: ‎07-29-2019

Hello @johnmcd ,

Thank you for this post because I am facing this problem.

I have vitis on windows 10

I have a Petalinux 2019.2 on VM ubuntu 18.04


I copied the sdk sysroot into a shared folder when vitis is linked as you described but 


How can I know which library to use ? I want to include 

#include "xparameters.h"
#include "xil_exception.h"
#include "xil_cache.h"
#include "xscugic.h"
#include "xipipsu.h"
#include "xipipsu_hw.h"


I have a A53 standalone app that I would like to move on custom Linux generated by petalinux 2019.2.

But maybe It is not possible....



Again thank you

0 Kudos
Registered: ‎07-29-2019

Well I probably have to dig to ug1186 (open AMP).
If I understand right the equivalent bareMetal ipi can be done with it...
0 Kudos
Registered: ‎02-10-2020


I have the same problem. We want to develop Apps with Vitis in Windows, so developers don't have to install a virtual machine.

I use the command suggested by @beni.falk  “cp -R -L <plnx-project>images/linux/sdk/sysroots/aarch64-xilinx-linux <shared_folder>”, to copy the files to the windows shared folder, but I get several errors of duplicate files.

I try to copy only the files suggested by @johnmcd  (lib, usr/include, usr/lib) but I get the same errors.


There isn’t a easy way to develop Apps in Vitis without a Linux Virtual Machine?

0 Kudos
Registered: ‎02-04-2021

I wrote a pretty extensive blog post on this using WSL and Git which you can find here. It has specific instructions for allowing the Vitis IDE on Windows access to the Petalinux build from WSL.

0 Kudos
Registered: ‎12-03-2019

This is great!

I found myself laughing a couple of times from your ironic additions.

It doesn't work with Vitis 2020, Xilinx, I'm surprised

0 Kudos
Registered: ‎02-04-2021

Glad you enjoyed, I spent a good while banging my head on the wall trying to get this all set up... ironic additions were the more PG way of expressing myself

0 Kudos