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!

AR# 67427

Zynq UltraScale - How can I debug a Linux application running on a Zynq UltraScale QEMU

Description

How can I debug a Linux application running on a Zynq UltraScale QEMU?

Solution

This Answer Record details all the steps needed to achieve this.

Note: This Answer Record assumes that PetaLinux is pre-installed.

  • Download the 2016.x ZCU102 BSP here
  • Use the Petalinux commands below to build the Linux image:
    • petalinux-create -t project -s Xilinx-ZCU102-v2016.1-final.bsp
    • cd Xilinx-ZCU102-v2016.1-final
    • petalinux-config -c rootfs
      • Select Filesystem Packages -> base -> tcf-agent -> [*] tcf-agent
    • petalinux-build
  • Launch QEMU using the command below:
    • petalinux-boot --qemu --kernel --qemu-args "-redir tcp:1540:10.0.2.15:1534"
  • Launch SDK, and create a new Linux application
  • Select File -> New -> Application Project
    • OS Platform: Linux
    • Processor Type: psu_cortexa53
  • Click Next, Select the Linux Hello World template and then Finish.
  • Under the target connections, select Linux TCF Agent -> Linux Agent:
    • Target Name: Linux Agent
    • Host: This should be the same network as the one running QEMU. Run ipconfig to find this IP address.
    • Port: 1540
  • Next, right click on the Linux application and select Debug As -> Debug Configurations.
    Double click on the Xilinx C/C++ application (System Debugger) to create a new debug configuration.
    • Under the Target Setup tab, set the following:
      • Debug Type: Linux Application Debug
      • Connection: Linux Agent
    • On the Application tab:
      • Under Project Name, browse to the Linux application created above
      • Under the Local File path, browse to the ELF of the Linux application created above.
      • Set the Remote File path to /tmp/test.elf
    • Select Apply, and debug to continue.
AR# 67427
Date Created 06/22/2016
Last Updated 06/27/2016
Status Active
Type General Article
Devices
  • Zynq UltraScale+ MPSoC
Tools
  • Vivado Design Suite - 2016.2
  • Vivado Design Suite - 2016.1