Trenz Electronic GmbH Support Forum

Trenz Electronic Products => Trenz Electronic FPGA Modules => Topic started by: Fady on April 21, 2015, 09:45:49 AM

Title: Boot a PetaLinux Image on QEMU
Post by: Fady on April 21, 2015, 09:45:49 AM
Hello
i'm using Petalinux 2014.4 and Vivado 2014.4 on rhel 6 and im trying to boot Petalinux image on QEMU but it didn't work.

[fa245588@is005306 TE0720-02-refplnx]$ petalinux-boot --qemu --kernel
INFO: The image provided is a zImage
INFO: TCP PORT is free
INFO: Starting arm QEMU
INFO:  qemu-system-arm -L /local/is005306/Software/petalinux-v2014.4-final/etc/qemu -M arm-generic-fdt -smp 2 -machine linux=on   --serial mon:stdio --serial /dev/null --nographic -kernel /tmp/tmp.8JUAAgPW03 -gdb tcp::9005 -dtb /local/is005306/fa245588/PetaLinux/TE0720-02-refplnx/images/linux/system.dtb

Vivado
1-download-unzip TE0720-02.zip ref design package from http://www.trenz-electronic.de/download/d0/Trenz_Electronic/d1/TE0720-GigaZee/d2/reference_designs.html
2-vivado -mode batch -source make_project.tcl
3-vivado -mode batch -source run_one.tcl
4-vivado -mode batch -source make_image.tcl
5-open vivado and extract hardware to create .hdf file

Petalinux
1- download TE0720-02-refplnx.bsp from http://www.trenz-electronic.de/download/d0/Trenz_Electronic/d1/TE0720-GigaZee/d2/reference_designs.html
2-$ petalinux-create -t project -s <path-to-bsp>
3-$ petalinux-config --get-hw-description=<path-to-directory-which-contains-hardware-description-file>
4-$ petalinux-build
5-$ petalinux-config
6-$ petalinux-boot --qemu --kernel

Regards,
Title: Re: Boot a PetaLinux Image on QEMU
Post by: Antti Lukats on April 21, 2015, 10:12:41 AM
Hi

are you sure the qemu problem is related to TE0720?
Do all other petalinux projects start correctly in qemu?

Title: Re: Boot a PetaLinux Image on QEMU
Post by: Fady on April 21, 2015, 11:58:12 AM
Hi,

I'm not sure what is the problem.
This is the first petalinux project that i'm tryin to boot on qemu.
Title: Re: Boot a PetaLinux Image on QEMU
Post by: Antti Lukats on April 21, 2015, 03:09:28 PM
Try with plain zynq template design first.
Title: Re: Boot a PetaLinux Image on QEMU
Post by: Fady on April 21, 2015, 03:32:45 PM
Hi,

Can u send me the link where i can find the plain zynq template design?
I'm using trenz TE0720 + TE0701.
Title: Re: Boot a PetaLinux Image on QEMU
Post by: Antti Lukats on April 21, 2015, 04:09:46 PM
www.xilinx.com, downloads petalinux...

then please type:

petalinux-create --help

and follow the Instructions, it will create just plain empty petalinux project for you, start from there.
Title: Re: Boot a PetaLinux Image on QEMU
Post by: Fady on April 21, 2015, 04:32:26 PM
i did the following:
1-$ petalinux-create --type project --template zynq --name test_1
2-$ petalinux-config --get-hw-description=<path-to-directory-which-contains-hardware-description-file>
(i used the .hdf file created from TE0720-02.zip ref design package download-unzip
http://www.trenz-electronic.de/download/d0/Trenz_Electronic/d1/TE0720-GigaZee/d2/reference_designs.html)
3-$ petalinux-build
and i got an  ERROR: Failed to build linux

[fa245588@is005306 test_1]$ petalinux-build             
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
ERROR: Failed to build linux

Title: Re: Boot a PetaLinux Image on QEMU
Post by: Antti Lukats on April 21, 2015, 04:58:49 PM
I asked you to make empty template project, this is REALLY REALLY VERY SIMPLE:

petalinux-create --type project --template zynq --name qemu_test
cd qemu_test
petalinux-config
<< hit enter 2 times!
petalinux-build
<< wait
petalinux-boot --qemu --kernel

I get error>>>

INFO: The image provided is a zImage
petalinux-boot: line 1443: xxd: command not found
WARNING: The QEMU subnet settings is 192.168.10.1/255.255.255.0. It is different from the one configured in PetaLinux /
WARNING: To enable the network of the QEMU MicroBlaze system. Please change the Network settings of PetaLinux and rebuild it or manually configure the network when the QEMU MicroBlaze system is boot
WARNING: Do you want to contine? (y/n)
y
INFO: TCP PORT is free
INFO: Starting arm QEMU
INFO:  qemu-system-arm -L /root/petalinux-v2014.4-final/etc/qemu -M arm-generic-fdt -smp 2 -machine linux=on   --serial /dev/null --serial mon:stdio --nographic -kernel /tmp/tmp.wCp1FVb6QN -gdb tcp::9000 -dtb /root/qemu_test/images/linux/system.dtb 
Failed to allocate 1073741824 B: Cannot allocate memory
petalinux-qemu-boot: line 594: 16534 Aborted                 $QEMU_DEBUG ${qemu_cmd} -L "${PETALINUX}/etc/qemu" ${qemu_mach} ${nic_list} ${qemu_serial} ${qemu_display} -kernel "${tmpimg}" -gdb tcp::${start_port} ${dtb_option} ${slirp_option} ${extra_args}
[root@localhost qemu_test]#

If you have questions related to petalinux and qemu, they can be answered there
http://forums.xilinx.com/t5/Embedded-Linux/bd-p/ELINUX

Title: Re: Boot a PetaLinux Image on QEMU
Post by: Fady on April 21, 2015, 05:39:23 PM
i made an empty template project as u told me now and i got the same error while buildin petalinux.
Title: Re: Boot a PetaLinux Image on QEMU
Post by: Antti Lukats on April 21, 2015, 06:23:43 PM
I am sorry, it all works here as explained to you.
qemu is not starting, it never has, but all the rest works without any issues.