cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Explorer
Explorer
8,665 Views
Registered: ‎09-27-2011

Launching QEMU from SDK

Jump to solution

Hello.  I am trying to run QEMU from the SDK.

SDK: Release Version: 2015.1 

PetaLinux: version 2014.4

OS: CentOS 7 3.10.0-229.4.2.el7.x86_64

 

When I created the SDK project I set the

rootfs to : /home/user/peta-projects/test-project/mz-7z010/build/linux/rootfs/stage

and toolchain path to: /opt/pkg/petalinux-v2014.4-final/tools/linux-i386

 

as instructed by http://forums.xilinx.com/t5/Embedded-Development-Tools/SDK-Windows-Development/td-p/553169

 

The following settings are set under Xilinx Tools->Configure QEMU Settings

QEMU executable path: /opt/pkg/petalinux-v2014.4-final/tools/linux-i386/petalinux/bin/qemu-system-arm

Device Tree path: /home/user/peta-projects/ugpp-microzed/mz-7z010/build/linux/device-tree/system.dtb

 

When I try to launch QEMU from the SDK I get the following error in the console panel:

-dtb only allowed with -kernel option

 

Here is the complete output in the console panel:

/opt/pkg/petalinux-v2014.4-final/tools/linux-i386/petalinux/bin/qemu-system-arm -nographic \
-M arm-generic-fdt -dtb \
/home/user/peta-projects/ugpp-microzed/mz-7z010/build/linux/device-tree/system.dtb -gdb \
tcp::1137 -S
tcfgdbclient -s tcp::1138 -S
-dtb only allowed with -kernel option
Server-Properties: {"Name":"TCF Agent","OSName":"Linux 3.10.0-229.4.2.el7.x86_64","UserName":"user","AgentID":"5571f59f-3932-4e74-8735-467a59f67af8","TransportName":"TCP","Port":"1138","ServiceManagerID":"5571f59f-3932-4e74-8735-467a59f67af8-0"}

 

As there are multiple device trees and kernel images in the PetaLinux project, I'm not exactly sure which one to use.  It looked like the corresponding kernel to go along with the device tree blob chosen had this path:

/home/user/peta-projects/ugpp-microzed/mz-7z010/build/linux/kernel/xlnx-3.17/vmlinux

 

How do I instruct the SDK to supply this kernel option to QEMU?

0 Kudos
Reply
1 Solution

Accepted Solutions
Explorer
Explorer
15,157 Views
Registered: ‎09-27-2011

I wasn't able to launch QEMU from the SDK, but I did finish the PetaLinux tutorial which externally launches QEMU and then connects the SDK's debugger to the already running instance and this worked.

 

http://www.xilinx.com/support/documentation/sw_manuals/petalinux2014_2/ug981-petalinux-application-development-debug.pdf

View solution in original post

0 Kudos
Reply
4 Replies
Explorer
Explorer
8,653 Views
Registered: ‎09-27-2011

Update:

According to page 5 of ug982 http://www.xilinx.com/support/documentation/sw_manuals/petalinux2014_2/ug982-petalinux-system-simulation.pdf the kernel is supposed to be <project-root>/images/linux/zImage.  This insinuated to me that the propper device tree is the one in the same folder:

/home/user/peta-projects/ugpp-microzed/mz-7z010/images/linux/system.dtb

 

I had found a way to supply the -kernel argument to qemu by wrapping the executuable with a bash script, but that was making it panic:

qemu-system-arm: /build/petalinux/plgx_src/Petalinux-v2014.4/qemu-arm-microblazeel/hw/core/qdev.c:324: qdev_get_gpio_in: Assertion `n >= 0 && n < dev->num_gpio_in' failed.

 

Without supplying a -kernel simply switching the device tree to system.dtb under the images folder got rid of all the error messages.  The complete output at this time looks like this:


/opt/pkg/petalinux-v2014.4-final/tools/linux-i386/petalinux/bin/qemu-system-arm -nographic \
-M arm-generic-fdt -dtb \
/home/user/peta-projects/ugpp-microzed/mz-7z010/images/linux/system.dtb -gdb tcp::1137 -S

tcfgdbclient -s tcp::1138 -S
Server-Properties: {"Name":"TCF Agent","OSName":"Linux 3.10.0-229.4.2.el7.x86_64","UserName":"user","AgentID":"5575da0e-e6a8-421a-866d-748a05058aa7","TransportName":"TCP","Port":"1138","ServiceManagerID":"5575da0e-e6a8-421a-866d-748a05058aa7-0"}

 

Unfortionetly the launch never finshes.  The SDK just sits there waiting on it.  I suppose it is waiting on the debugger to connect.

0 Kudos
Reply
Explorer
Explorer
15,158 Views
Registered: ‎09-27-2011

I wasn't able to launch QEMU from the SDK, but I did finish the PetaLinux tutorial which externally launches QEMU and then connects the SDK's debugger to the already running instance and this worked.

 

http://www.xilinx.com/support/documentation/sw_manuals/petalinux2014_2/ug981-petalinux-application-development-debug.pdf

View solution in original post

0 Kudos
Reply
Visitor
Visitor
8,195 Views
Registered: ‎07-22-2015

hello,

I am trying to do the same, launching QEMU from petalinux and connect tcf in SDK but I receive always the error "no route to host" .

my target has ip addr set to 192.168.22.70, I launch QEMU with the following arguments:

petalinux-boot --qemu --kernel --root --subnet 192.168.22.1/24 --qemu-args "-redir tcp:1534::1534"

 

but SDK can't find the target.

 

what is wrong in my configuration?
 

0 Kudos
Reply
Explorer
Explorer
5,893 Views
Registered: ‎09-27-2011

Here are my self-notes from that day perhaps it will help you or someone else.

 

petalinux-create -t apps --template c++ --name myapp
Then I changed in the configuration that the app would be included.
petalinux-config -c rootfs
Then I changed in the configuration that the tcf-agent should be included.
Then I changed in the configuration that the apps should be built with debug info
Then I made it recompile.
petalinux-build
Then I booted qemu.
petalinux-boot --qemu --kernel --qemu-args "-redir tcp:1534::1534"

I also noted on that day that if you run it as root you get a real IP address from your DHCP, if not then the redirect port forwards a port from your local machine to the qemu one.

0 Kudos
Reply