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!

cancel
Showing results for 
Search instead for 
Did you mean: 
Visitor hduhxc
Visitor
438 Views
Registered: ‎06-22-2018

Linux image running in QEMU can not connect to built-in tftp server

I am trying to build a linux image by buildroot, using kernel config copied from PetaLinux.

 

When I boot this image with the following instruction, I can download corresponding images through tftp service provided by U-boot.

 

qemu-system-aarch64 -M arm-generic-fdt -nographic -m 4G \
-global xlnx,zynqmp-boot.cpu-num=0 -global xlnx,zynqmp-boot.use-pmufw=true \
-device loader,file=qemu/bl31.elf,cpu-num=0 \
-device loader,file=qemu/u-boot.elf \
-hw-dtb qemu/zcu102-arm.dtb \
-machine-path qemu/tmp \
-net nic -net nic -net nic -net nic -net user,tftp=.

 

The eth0 device does not enable automatically,  but I can enable it manually:

ifconfig eth0 up
ifconfig eth0 10.0.2.15 netmask 255.255.255.0

 Unfortunately, when I ping 10.0.2.2, it is unreachable. I also tried to use udhcpc to get an IP address, but failed.

 

It is so weird that when I boot my Image on ZCU102 development board, everything seems OK.  Similarly, the pre-built image of PetaLinux running in qemu works correctly.

 

Could anyone give me an advice? Thanks in advance.

0 Kudos
3 Replies
Moderator
Moderator
376 Views
Registered: ‎12-04-2016

Re: Linux image running in QEMU can not connect to built-in tftp server

Hi @hduhxc

 

If it is working fine in Petalinux flow, may I know the difference? Did you make any modifications to rootfs? 

 

 

Best Regards

Shabbir

0 Kudos
Visitor hduhxc
Visitor
372 Views
Registered: ‎06-22-2018

Re: Linux image running in QEMU can not connect to built-in tftp server

Since the network connection on real hardware works well, is there any option that is related to QEMU?

0 Kudos
Moderator
Moderator
364 Views
Registered: ‎12-04-2016

Re: Linux image running in QEMU can not connect to built-in tftp server

Hi @hduhxc

 

Can you try something like this:

petalinux-boot --qemu --u-boot --qemu-args "-net nic -net nic -net nic -net nic -net user,tftp=./images/linux/,hostfwd=tcp:127.0.0.1:2222-10.0.2.15:22,hostfwd=tcp:127.0.0.1:2322-10.0.2.16:22"

 

 

 

0 Kudos