cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
willhaward
Visitor
Visitor
562 Views
Registered: ‎11-03-2020

Booting SW_EMU for Platform Creation tutorial failed: "Wrong Image format for "source" command"

Hello

 

I am following the github platform creation tutorials for Vitis, and I am trying to load the vadd example design in software Emulation. The build is successful as far as I can see. I am using the same version for every tool in the toolchain, 2020.1. 

I dont know how to debug this. All the files suggested by other forum posts are present and accounted for, but it just wont work. Help would be much appreciated. 

When I go to launch the emulator I get the following output

Current working dir /home/will/workspace/vadd/Emulation-SW/package
Required emulation files like qemu_args exists
Running SW Emulation
INFO :  [LAUNCH_EMULATOR] pl_sim_dir option is not provided.


Starting QEMU
 - Press <Ctrl-a h> for help 
Waiting for QEMU to start. qemu_port 7958
Qemu_pids 11238 11240
qemu-system-aarch64: -chardev socket,path=/tmp/11184/qemu-rport-_pmu@0,server,id=pmu-apu-rp: info: QEMU waiting for connection on: disconnected:unix:/tmp/11184/qemu-rport-_pmu@0,server

QEMU started. qemu_pid=11238.
Waiting for PMU to start. Qemu_pids 11242 11243
qemu-system-aarch64: -chardev socket,id=pl-rp,host=127.0.0.1,port=9138,server: info: QEMU waiting for connection on: disconnected:tcp:127.0.0.1:9138,server

PMC started. pmc_pid=11242
Starting PL simulation.Generating PLLauncher commandline
running PLL Launcher
qemu-system-aarch64: warning: hub 0 is not connected to host network

PMU Firmware 2020.1	Jan  7 2021   17:37:12
PMU_ROM Version: xpbr-v8.1.0-0
NOTICE:  ATF running on XCZUUNKN/QEMU v4/RTL0.0 at 0xfffea000
NOTICE:  BL31: v2.2(release):v1.1-5588-g5918e656e
NOTICE:  BL31: Built : 17:38:03, Jan  7 2021


U-Boot 2020.01 (Jan 07 2021 - 17:35:25 +0000)

Model: "XXXXXXXXXX Development board"
Board: Xilinx ZynqMP
DRAM:  8 GiB
usb dr_mode not found
PMUFW:	v1.1
EL Level:	EL2
Chip ID:	unknown
NAND:  0 MiB
MMC:   mmc@ff160000: 0
In:    serial@ff000000
Out:   serial@ff000000
Err:   serial@ff000000
Bootmode: SD_MODE
Reset reason:	
Net:   
ZYNQ GEM: ff0c0000, mdio bus ff0c0000, phyaddr -1, interface rgmii-id

Warning: ethernet@ff0c0000 using MAC address from DT
eth0: ethernet@ff0c0000
ZYNQ GEM: ff0e0000, mdio bus ff0e0000, phyaddr -1, interface rgmii-id

Warning: ethernet@ff0e0000 (eth1) using random MAC address - 62:1a:ba:4f:16:36
, eth1: ethernet@ff0e0000
Hit any key to stop autoboot:  2  1  0 
MMC: no card present
## Executing script at 20000000
Wrong image format for "source" command
SCRIPT FAILED: continuing...
MMC: no card present
MMC Device 1 not found
no mmc device at slot 1
Warning: SPI speed fallback to 100 kHz
SF: Detected n25q512a with page size 512 Bytes, erase size 128 KiB, total 128 MiB
device 0 offset 0x3e80000, size 0x80000
SF: 524288 bytes @ 0x3e80000 Read: OK
## Executing script at 20000000
Wrong image format for "source" command
SCRIPT FAILED: continuing...


no devices available
SCRIPT FAILED: continuing...
starting USB...
No working controllers found
USB is stopped. Please issue 'usb start' first.
starting USB...
No working controllers found
USB is stopped. Please issue 'usb start' first.
scanning bus for devices...
SATA link 0 timeout.
SATA link 1 timeout.
AHCI 0001.0000 32 slots 2 ports 1.5 Gbps 0x3 impl SATA mode
flags: 64bit ncq only 

Device 0: unknown device
starting USB...
No working controllers found
BOOTP broadcast 1
BOOTP broadcast 2
BOOTP broadcast 3
BOOTP broadcast 4
BOOTP broadcast 5
BOOTP broadcast 6
BOOTP broadcast 7
BOOTP broadcast 8
BOOTP broadcast 9
BOOTP broadcast 10
BOOTP broadcast 11
BOOTP broadcast 12
BOOTP broadcast 13
BOOTP broadcast 14
BOOTP broadcast 15
BOOTP broadcast 16
BOOTP broadcast 17

Retry time exceeded; starting again
missing environment variable: pxeuuid
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/01-00-0a-35-00-22-01
*** ERROR: `serverip' not set
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/00000000
*** ERROR: `serverip' not set
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/0000000
*** ERROR: `serverip' not set
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/000000
*** ERROR: `serverip' not set
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/00000
*** ERROR: `serverip' not set
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/0000
*** ERROR: `serverip' not set
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/000
*** ERROR: `serverip' not set
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/00
*** ERROR: `serverip' not set
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/0
*** ERROR: `serverip' not set
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/default-arm-zynqmp-zynqmp
*** ERROR: `serverip' not set
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/default-arm-zynqmp
*** ERROR: `serverip' not set
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/default-arm
*** ERROR: `serverip' not set
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/default
*** ERROR: `serverip' not set
Config file not found
starting USB...
No working controllers found
BOOTP broadcast 1
BOOTP broadcast 2
BOOTP broadcast 3
BOOTP broadcast 4
BOOTP broadcast 5
BOOTP broadcast 6
BOOTP broadcast 7
BOOTP broadcast 8
BOOTP broadcast 9
BOOTP broadcast 10
qemu-system-microblazeel: /pmu@0: Disconnected clk=68544484393 ns

/home/will/workspace/vadd/Emulation-SW/package/emu_qemu_scripts/start_qemu.sh: line 3: 11239 Killed                  $QEMU_GDB_COMMAND /tools/Xilinx/Vitis/2020.1/data/emulation/qemu/unified_qemu_v4_2/sysroots/x86_64-petalinux-linux/usr/bin/qemu-system-aarch64 -M "arm-generic-fdt" -serial "mon:stdio" -global "xlnx,zynqmp-boot.cpu-num=0" -global "xlnx,zynqmp-boot.use-pmufw=true" -net "nic" -net "nic" -net "nic" -m "4G" -device "loader,file=/home/will/workspace/custom_platform/export/custom_platform/sw/custom_platform/qemu/bl31.elf,cpu-num=0" -device "loader,file=/home/will/workspace/custom_platform/export/custom_platform/sw/custom_platform/qemu/u-boot.elf" -boot "mode=3" -hw-dtb /tools/Xilinx/Vitis/2020.1/data/emulation/dtbs/zynqmp/zynqmp-arm-cosim.dtb -drive "file=/home/will/workspace/vadd/Emulation-SW/package/sd_card.img,if=sd,format=raw,index=1" -net "nic,netdev=net0" -netdev "user,id=net0,hostfwd=tcp::1440-:1534" -no-reboot -display "none" -machine-path "." -sync-quantum "4000000" -chardev "socket,path=/tmp/11184/qemu-rport-_pmu@0,server,id=pmu-apu-rp" -chardev "socket,id=pl-rp,host=127.0.0.1,port=9138,server"

 The build log is as follows:

17:13:53 **** Build of configuration Emulation-SW for project vadd_system ****
make all 
Running Package Step for the System Project.
/tools/Xilinx/Vitis/2020.1/bin/v++ --package --config package.cfg ../../vadd/Emulation-SW/binary_container_1.xclbin -o binary_container_1.xclbin
/tools/Xilinx/Vitis/2020.1/bin/v++ --package --config package.cfg  ../../vadd/Emulation-SW/binary_container_1.xclbin -o binary_container_1.xclbin
Option Map File Used: '/tools/Xilinx/Vitis/2020.1/data/vitis/vpp/optMap.xml'

****** v++ v2020.1 (64-bit)
  **** SW Build 2902540 on Wed May 27 19:54:35 MDT 2020
    ** Copyright 1986-2020 Xilinx, Inc. All Rights Reserved.

INFO: [v++ 60-1306] Additional information associated with this v++ package can be found at:
	Reports: /home/will/workspace/vadd_system/Emulation-SW/package.build/reports/package
	Log files: /home/will/workspace/vadd_system/Emulation-SW/package.build/logs/package
INFO: [v++ 60-1657] Initializing dispatch client.
Running Dispatch Server on port:39783
INFO: [v++ 60-1548] Creating build summary session with primary output /home/will/workspace/vadd_system/Emulation-SW/binary_container_1.xclbin.package_summary, at Fri Jan  8 17:14:16 2021
INFO: [v++ 60-1316] Initiating connection to rulecheck server, at Fri Jan  8 17:14:16 2021
Running Rule Check Server on fifo:/tmp/xrcmainfd97e2cc-22b3-4cb6-84a2-f6ce5cbf5ce1
INFO: [v++ 60-1315] Creating rulecheck session with output '/home/will/workspace/vadd_system/Emulation-SW/package.build/reports/package/v++_package_binary_container_1_guidance.html', at Fri Jan  8 17:14:32 2021
INFO: [v++ 60-895]   Target platform: /home/will/workspace/custom_platform/export/custom_platform/custom_platform.xpfm
INFO: [v++ 60-1578]   This platform contains Xilinx Shell Archive '/home/will/workspace/custom_platform/export/custom_platform/hw/system.xsa'
INFO: [v++ 60-2256] Packaging for software emulation
WARNING: [v++ 82-1097] Skipping boot image generation, since FSBL is directly loaded onto emulator
INFO: [v++ 82-1022] Generating /home/will/workspace/vadd_system/Emulation-SW/package/launch_sw_emu.sh
INFO: [v++ 82-1076] Deleting existing - /home/will/workspace/vadd_system/Emulation-SW/package/sd_card/image.ub
INFO: [v++ 82-1011] Creating sd_card directory
INFO: [v++ 82-1075] Deleting the existing directory /home/will/workspace/vadd_system/Emulation-SW/package/sd_card//data/emulation/unified
FATSIZE:1124
fat_start:63
fat_end:2096639
fat_sector:2096577
ext4_start:0
ext4_sector:3239156
EXT4SIZE:2048
TOTALSIZE:3172
dummy_ext4_sector:955148
sd_card_fat_start:2048
sd_card_ext4_start:2195456
dummy_ext4_start:5434612
2096577+0 records in
2096577+0 records out
1073447424 bytes (1.1 GB, 1.0 GiB) copied, 11.8331 s, 90.7 MB/s
3239156+0 records in
3239156+0 records out
1658447872 bytes (1.7 GB, 1.5 GiB) copied, 17.0327 s, 97.4 MB/s
955148+0 records in
955148+0 records out
489035776 bytes (489 MB, 466 MiB) copied, 5.12277 s, 95.5 MB/s
INFO: [v++ 60-2343] Use the vitis_analyzer tool to visualize and navigate the relevant reports. Run the following command. 
    vitis_analyzer /home/will/workspace/vadd_system/Emulation-SW/binary_container_1.xclbin.package_summary 
INFO: [v++ 60-791] Total elapsed time: 0h 23m 5s
INFO: [v++ 60-1653] Closing dispatch client.

17:37:12 Build Finished (took 23m:19s.214ms)

 

 

0 Kudos
10 Replies
akasat
Xilinx Employee
Xilinx Employee
490 Views
Registered: ‎08-28-2007

Seems like linux image may not be correct. Are you doing your own petalinux builds or are you using the pre-built linux image/rootfs, similar to how base platforms run. Can you confirm if you are able to run a simple hello_world example on the Xilinx base platform before trying it on your own custom platform? If possible, please also consider moving to 2020.2 release which has a good tutorial for custom platform creation.

0 Kudos
willhaward
Visitor
Visitor
460 Views
Registered: ‎11-03-2020

I'm doing my own petalinux build, following the tutorial part 2. Do you mean the configuration of the linux build is not correct? Which petalinux config menu should I be looking at to fix it? I don't see why an incorrect format would lead to the source format being incorrect. Surely an incorrect configuration of petalinux isn't built into a corrupted image format?

I have been successful in getting vadd to work on a ZCU104 board using everything prebuilt, its custom platforms that Im having no luck with.

Please could you direct me to the 2020.2 release tutorial for platform creation? Also, would upgrading to 2020.2 require me to update all the parts of the toolchain? or just Vitis?

Thanks

0 Kudos
stephenm
Moderator
Moderator
440 Views
Registered: ‎09-12-2007

Looks like you are missing the boot.scr in your platform. 

 

0 Kudos
willhaward
Visitor
Visitor
338 Views
Registered: ‎11-03-2020

Hi stephenm, boot.scr is present in both the platform image directory and the workspace packaged-for-SW sd_card directory Capture.PNG

 

 

'Vñ5ì§_÷GP  —        µJ] Boot script                           # This is a boot script for U-Boot
# Generate boot.scr:
# mkimage -c none -A arm -T script -d boot.cmd.default boot.scr
#
################


for boot_target in ${boot_targets};
do
	if test "${boot_target}" = "jtag" ; then
		booti 0x00200000 0x04000000 0x00100000
		exit;
	fi
	if test "${boot_target}" = "mmc0" || test "${boot_target}" = "mmc1" ; then
		if test -e ${devtype} ${devnum}:${distro_bootpart} /image.ub; then
			fatload ${devtype} ${devnum}:${distro_bootpart} 0x10000000 image.ub;
			bootm 0x10000000;
			exit;
                fi
		if test -e ${devtype} ${devnum}:${distro_bootpart} /Image; then
			fatload ${devtype} ${devnum}:${distro_bootpart} 0x00200000 Image;;
		fi
		if test -e ${devtype} ${devnum}:${distro_bootpart} /system.dtb; then
			fatload ${devtype} ${devnum}:${distro_bootpart} 0x00100000 system.dtb;
		fi
		if test -e ${devtype} ${devnum}:${distro_bootpart} /rootfs.cpio.gz.u-boot; then
			fatload ${devtype} ${devnum}:${distro_bootpart} 0x04000000 rootfs.cpio.gz.u-boot;
			booti 0x00200000 0x04000000 0x00100000
			exit;
		fi
		booti 0x00200000 - 0x00100000
		exit;
	fi
	if test "${boot_target}" = "xspi0" || test "${boot_target}" = "qspi" || test "${boot_target}" = "qspi0"; then
		sf probe 0 0 0;
		if test "image.ub" = "image.ub"; then
			sf read 0x10000000 0xF00000 0x6400000;
			bootm 0x10000000;
			exit;
		fi
		if test "image.ub" = "Image"; then
			sf read 0x00200000 0xF00000 0x1D00000;
			sf read 0x04000000 0x4000000 0x4000000
			booti 0x00200000 0x04000000 0x00100000
			exit;
		fi
		exit;
	fi
	if test "${boot_target}" = "nand" || test "${boot_target}" = "nand0"; then
		nand info
		if test "image.ub" = "image.ub"; then
			nand read 0x10000000 0x4100000 0x6400000;
			bootm 0x10000000;
			exit;
		fi
		if test "image.ub" = "Image"; then
			nand read 0x00200000 0x4100000 0x3200000;
			nand read 0x04000000 0x7800000  0x3200000;
			booti 0x00200000 0x04000000 0x00100000
			exit;
		fi
	fi
done

 

0 Kudos
willhaward
Visitor
Visitor
407 Views
Registered: ‎11-03-2020

Hi Stephenm, (apologies if this gets posted twice, I made a post and it disappeared)

Boot.scr is there, in the platform creation directory and the workspace where vadd has exported the sd_card

Capture.PNG

 

The boot.scr looks like:

'Vñ5ì§_÷GP  —        µJ] Boot script                           # This is a boot script for U-Boot
# Generate boot.scr:
# mkimage -c none -A arm -T script -d boot.cmd.default boot.scr
#
################


for boot_target in ${boot_targets};
do
	if test "${boot_target}" = "jtag" ; then
		booti 0x00200000 0x04000000 0x00100000
		exit;
	fi
	if test "${boot_target}" = "mmc0" || test "${boot_target}" = "mmc1" ; then
		if test -e ${devtype} ${devnum}:${distro_bootpart} /image.ub; then
			fatload ${devtype} ${devnum}:${distro_bootpart} 0x10000000 image.ub;
			bootm 0x10000000;
			exit;
                fi
		if test -e ${devtype} ${devnum}:${distro_bootpart} /Image; then
			fatload ${devtype} ${devnum}:${distro_bootpart} 0x00200000 Image;;
		fi
		if test -e ${devtype} ${devnum}:${distro_bootpart} /system.dtb; then
			fatload ${devtype} ${devnum}:${distro_bootpart} 0x00100000 system.dtb;
		fi
		if test -e ${devtype} ${devnum}:${distro_bootpart} /rootfs.cpio.gz.u-boot; then
			fatload ${devtype} ${devnum}:${distro_bootpart} 0x04000000 rootfs.cpio.gz.u-boot;
			booti 0x00200000 0x04000000 0x00100000
			exit;
		fi
		booti 0x00200000 - 0x00100000
		exit;
	fi
	if test "${boot_target}" = "xspi0" || test "${boot_target}" = "qspi" || test "${boot_target}" = "qspi0"; then
		sf probe 0 0 0;
		if test "image.ub" = "image.ub"; then
			sf read 0x10000000 0xF00000 0x6400000;
			bootm 0x10000000;
			exit;
		fi
		if test "image.ub" = "Image"; then
			sf read 0x00200000 0xF00000 0x1D00000;
			sf read 0x04000000 0x4000000 0x4000000
			booti 0x00200000 0x04000000 0x00100000
			exit;
		fi
		exit;
	fi
	if test "${boot_target}" = "nand" || test "${boot_target}" = "nand0"; then
		nand info
		if test "image.ub" = "image.ub"; then
			nand read 0x10000000 0x4100000 0x6400000;
			bootm 0x10000000;
			exit;
		fi
		if test "image.ub" = "Image"; then
			nand read 0x00200000 0x4100000 0x3200000;
			nand read 0x04000000 0x7800000  0x3200000;
			booti 0x00200000 0x04000000 0x00100000
			exit;
		fi
	fi
done
0 Kudos
stephenm
Moderator
Moderator
399 Views
Registered: ‎09-12-2007

Is this a custom platform? Can you stop in uboot and do a bootm? does this work?

Are the images in the locations mentioned in the boot.scr?

 

You can cross check this in petalinux-config

0 Kudos
willhaward
Visitor
Visitor
391 Views
Registered: ‎11-03-2020

Hi stephen, 
Yep it's a custom platform. 

bootm gives the following:

capture2.PNG

 

 

The boot.scr is in the same directory as the files it references. Is this correct?

willhaward_0-1610451170491.png

 

0 Kudos
akasat
Xilinx Employee
Xilinx Employee
354 Views
Registered: ‎08-28-2007

Plesse look at the platform creation tutorial here:

https://github.com/Xilinx/Vitis-In-Depth-Tutorial/tree/master/Vitis_Platform_Creation/Introduction 

Note that Xilinx also provides a pre-built petalinux image and rootfs which is tested on our base platform. While you will eventually need to build your own custom petalinux image, you can use the pre-built images for testing your custom platform at early stages in case the custom image is not qualified.

0 Kudos
willhaward
Visitor
Visitor
353 Views
Registered: ‎11-03-2020

Hi akasat, that is the exact tutorial I followed to generate petalinux for my custom platform.

How can I use the pre built images to test my custom platform? My goal is to develop a custom platform with a custom petalinux image

The problem with that tutorial is it does not tell you which are the parts that need custom design for your own platform.

0 Kudos
willhaward
Visitor
Visitor
342 Views
Registered: ‎11-03-2020

Inside uboot I queried the contents of the sd card in mmc 0. Does this look like the expected output?

willhaward_0-1610471871519.png

 

0 Kudos