cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
joseer
Voyager
Voyager
1,580 Views
Registered: ‎07-06-2016

Petalinux 2010.1 boot error - No partition table - mmc 1

Jump to solution

Hello,

I'm trying to port my petalinux 2019.2 project to 2020.1, for a Zynq Ultrascale+ device. I have not bsp for the third party dev board I'm using so I followed next steps:

- Created a petalinux 2020.1 blank project based on the zynqMP template.

- Import Vivado 2020.1 generated hardware config.

- Copy system-user.dtsi from 2019.2.

- Build and package images.

All good till the booting point where I've got a few errors and one of them is No partition table - mmc 1 which I don't understand because there's partition table in the SD card, i.e with same SD card petalinux 2019.2 boots without problems.

The boot log is:

Xilinx Zynq MP First Stage Boot Loader
Release 2020.1   Sep  8 2020  -  10:38:03
NOTICE:  ATF running on XCZU5EV/silicon v4/RTL5.1 at 0xfffea000
NOTICE:  BL31: v2.2(release):v1.1-5588-g5918e656e
NOTICE:  BL31: Built : 14:13:45, Sep  8 2020


U-Boot 2020.01 (Sep 09 2020 - 08:41:26 +0000)

Board: Xilinx ZynqMP
DRAM:  2 GiB
PMUFW:  v1.1
EL Level:       EL2
Chip ID:        zu5ev
NAND:  0 MiB
MMC:   mmc@ff160000: 0, mmc@ff170000: 1
In:    serial@ff000000
Out:   serial@ff000000
Err:   serial@ff000000
Bootmode: SD_MODE1
Reset reason:   SOFT
Net:
ZYNQ GEM: ff0e0000, mdio bus ff0e0000, phyaddr 1, interface rgmii-id

Warning: ethernet@ff0e0000 using MAC address from DT
eth0: ethernet@ff0e0000
Hit any key to stop autoboot:  0
switch to partitions #0, OK
mmc1 is current device
** No partition table - mmc 1 **
## Executing script at 20000000
Wrong image format for "source" command
SCRIPT FAILED: continuing...
switch to partitions #0, OK
mmc0(part 0) is current device
** No partition table - mmc 0 **
switch to partitions #0, OK
mmc1 is current device
** No partition table - mmc 1 **
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...
Bus dwc3@fe200000: Register 2000440 NbrPorts 2
Starting the controller
USB XHCI 1.00
scanning bus dwc3@fe200000 for devices... 3 USB Device(s) found
       scanning usb for storage devices... 0 Storage Device(s) found

Device 0: unknown device

Device 1: unknown device
scanning bus for devices...
SATA link 0 timeout.
SATA link 1 timeout.
AHCI 0001.0301 32 slots 2 ports 6 Gbps 0x3 impl SATA mode
flags: 64bit ncq pm clo only pmp fbss pio slum part ccc apst

Device 0: unknown device
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
ZynqMP>

Any ideas about what I could be missing?

Thanks in advance.

0 Kudos
1 Solution

Accepted Solutions
patocarr
Teacher
Teacher
1,117 Views
Registered: ‎01-28-2008

Hi @joseer 

  How was the SD card partitioned? I recently had trouble with an eMMC card being partitioned in a way that worked as a mounted drive, but it would not boot from it. The memory was partitioned in Linux, i.e. /dev/mmcblk0 then formatted it as FAT32. The key to fix it was to format (mkfs.vfat) the actual partition /dev/mmcblk0p1 instead. It was U-Boot that had trouble reading from the memory and reported having no partition, though the message was different iirc. This is the post with details Boot-from-QSPI-load-image-ub-from-MMC 

  At this point I would try re-formatting the SD card in a different way. See the formatting details in the solution in the above post.

 

Thanks,

-Pat

 

Give kudos if helpful. Accept as solution if it solves your problem.
https://tuxengineering.com/blog

View solution in original post

0 Kudos
17 Replies
jrhtech
Voyager
Voyager
1,548 Views
Registered: ‎10-04-2017
Did you copy boot.scr onto the SD card FAT partition? I think that's what 'Wrong image format for "source" command' is telling you.

jeff
0 Kudos
joseer
Voyager
Voyager
1,543 Views
Registered: ‎07-06-2016

Hi @jrhtech ,

Thanks for your answer, yes I did, in the SD card there're the next files: BOOT.BIN, image.ub and boot.scr

0 Kudos
patocarr
Teacher
Teacher
1,533 Views
Registered: ‎01-28-2008

Hi @joseer 

  Can you access the mmc from U-Boot? i.e. using the 'mmc' command.

 

Thanks,

-Pat

Give kudos if helpful. Accept as solution if it solves your problem.
https://tuxengineering.com/blog

0 Kudos
joseer
Voyager
Voyager
1,525 Views
Registered: ‎07-06-2016

Hi @patocarr,

Thanks for your answer,

Yes I can access, I've got the next output:

ZynqMP> fatls mmc 1
  9055520   BOOT.BIN
 47929844   image.ub
     2007   boot.scr
            System Volume Information/

 

0 Kudos
patocarr
Teacher
Teacher
1,507 Views
Registered: ‎01-28-2008

@joseer 

  So it looks like the mmc is fine, hardware-wise. The partition related message may be because it expects the mmc/SD to have more partitions and there may be just one partition.

  The issue then narrows down to the boot.scr script, which is suspect. Let's try to manually load it from U-Boot, and then execute it:

ZynqMP> load mmc 1:0 0x200000 boot.scr
ZynqMP> source 0x200000

  I suspect this would throw the same error message, pointing to the boot.scr being somewhat malformed/corrupted.

 

Thanks,

-Pat

Give kudos if helpful. Accept as solution if it solves your problem.
https://tuxengineering.com/blog

0 Kudos
jrhtech
Voyager
Voyager
1,491 Views
Registered: ‎10-04-2017

Did you edit the boot.scr manually?  This will break it also.

It sounds like the boot.scr is wrong.  From u-boot, you can run make sure the boot script is getting passed the correct args by setting boot_targets to mmc1 and then run bootcmd_mmc1

 

jeff

0 Kudos
joseer
Voyager
Voyager
1,446 Views
Registered: ‎07-06-2016

Hi @jrhtech @patocarr , thanks for your answers, it looks like the issue could be around boot.scr...

I tried the commands as suggested and I've got:

ZynqMP> load mmc 1:0 0x200000 boot.scr
2007 bytes read in 18 ms (108.4 KiB/s)
ZynqMP> source 0x200000
## Executing script at 00200000
** No partition table - mmc 0 **
** No partition table - mmc 0 **
** No partition table - mmc 0 **
** No partition table - mmc 0 **
Bad Linux ARM64 Image magic!

@patocarr are those errors what you suspected? ....after loading it into mmc1  I was expecting to see the errors in mmc1 not in mmc0...not sure what's going on

is there any petalinux config I'm missing?

0 Kudos
joseer
Voyager
Voyager
1,411 Views
Registered: ‎07-06-2016

The boot.src content is:

# 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

 Any ideas?

Thanks!

0 Kudos
patocarr
Teacher
Teacher
1,401 Views
Registered: ‎01-28-2008

Hi @joseer 

  The boot.scr contents look okay, but the file has a binary header that's not present in your post. That header is important and may be the reason U-Boot complains about not being a proper script.

  The boot.scr is generated under the ./images/linux directory and shouldn't be edited before copying it to flash.

Thanks,

-Pat

 

Give kudos if helpful. Accept as solution if it solves your problem.
https://tuxengineering.com/blog

0 Kudos
joseer
Voyager
Voyager
1,395 Views
Registered: ‎07-06-2016

Hi @patocarr , 

Thanks for your reply,

What binary header file?, could you please expand that a bit?

(Just to clarify, the boot.scr is as is created by petalinux it hasn't been edited)

0 Kudos
patocarr
Teacher
Teacher
1,383 Views
Registered: ‎01-28-2008

Hi @joseer 

  So to recap, from your first post U-Boot selects the mmc1 and attempts to read the boot.scr:

mmc1 is current device
** No partition table - mmc 1 **
## Executing script at 20000000
Wrong image format for "source" command

  But when you do it manually, it does read it. But when it executes it, it tries to load files from mmc0:

ZynqMP> load mmc 1:0 0x200000 boot.scr
2007 bytes read in 18 ms (108.4 KiB/s)
ZynqMP> source 0x200000
## Executing script at 00200000
** No partition table - mmc 0 **
** No partition table - mmc 0 **
** No partition table - mmc 0 **
** No partition table - mmc 0 **
Bad Linux ARM64 Image magic!

  It looks like the device selected to boot from changes to mmc0:

	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

  In U-Boot, try printing the values of these variables:

ZynqMP> printenv boot_targets
ZynqMP> printenv devtype ZynqMP> printenv devnum ZynqMP> printenv distro_bootpart

  My suspicion is that devnum is switching to mmc0 somehow when run manually. But still can't explain why the bad partition messages are coming up.

 

Thanks,

-Pat

Give kudos if helpful. Accept as solution if it solves your problem.
https://tuxengineering.com/blog

0 Kudos
joseer
Voyager
Voyager
1,213 Views
Registered: ‎07-06-2016

Hi @patocarr ,

Thanks again for your help,

Yes, it is very weird it looks like always it is trying to boot from mmc0 even if I force it to do it from mmc1, and the the partition is fine I don't understand that error..till now upgrading Petalinux versions has been relatively straight forward but 2020.1 is being very challenging.....

I've printed the variables and I've got:

ZynqMP> printenv boot_targets
boot_targets=mmc1 jtag mmc1 mmc0 qspi0 nand0 usb0 usb1 scsi0 pxe dhcp
ZynqMP> printenv devtype
## Error: "devtype" not defined
ZynqMP> printenv devnum
## Error: "devnum" not defined
ZynqMP> printenv distro_bootpart
## Error: "distro_bootpart" not defined

Any ideas what is going on with those variables which are not defined?

I've got the impression something is missing in the config....?

0 Kudos
patocarr
Teacher
Teacher
1,210 Views
Registered: ‎01-28-2008

Hi @joseer 

  Something is wrong with the u-boot configuration then; those variables should have been defined.

  When doing petalinux-config, the "u-boot configuration -> U-boot config" should be set to "other" and the target should be "xilinx_zynqmp_virt_defconfig". Also, in the "Autoconfig settings", make sure u-boot is set to _not_ autoconfig (i.e. unchecked).

 

Thanks,

-Pat

 

Give kudos if helpful. Accept as solution if it solves your problem.
https://tuxengineering.com/blog

0 Kudos
jrhtech
Voyager
Voyager
1,181 Views
Registered: ‎10-04-2017
@patocarr I would disagree with the vars, only boot_targets should be set, the others
are determined when running

@joseer I would try running like this so you can see if you uboot is doing the right thing
setenv boot_targets mmc1
run bootcmd_mmc1

you can also modify boot.cmd.default.initrd in u-boot/u-boot-zynq-scr/ and add echos to the boot.scr.

jeff
0 Kudos
joseer
Voyager
Voyager
1,146 Views
Registered: ‎07-06-2016

Thanks for the answers,

@patocarr ,  the petalinux-config looks ok, same setting as you're suggesting (I think it is default config)...

@jrhtech, I ran the commands and the only error is:

ZynqMP> setenv boot_targets mmc1
ZynqMP> run bootcmd_mmc1
switch to partitions #0, OK
mmc1 is current device
** No partition table - mmc 1 **

However the partition table is ok and the files are there:

ZynqMP> fatls mmc 1
            System Volume Information/
 47891180   image.ub
     2007   boot.scr
  9042028   BOOT.BIN

3 file(s), 1 dir(s)

I'm lost with this, any clues would be much appreciated...

0 Kudos
jrhtech
Voyager
Voyager
1,132 Views
Registered: ‎10-04-2017

Hello,

  it’s like it doesn’t even see the boot script.   I would try putting in the echos to see if you can get any info.

  I would also try a different SD and make sure to set the boot flag in fdisk.   I don’t actually know why this does I just know I set it based on some Xilinx document.

  And the of course, look at the uboot source and try to figure out what is happening.

 

jeff 

0 Kudos
patocarr
Teacher
Teacher
1,118 Views
Registered: ‎01-28-2008

Hi @joseer 

  How was the SD card partitioned? I recently had trouble with an eMMC card being partitioned in a way that worked as a mounted drive, but it would not boot from it. The memory was partitioned in Linux, i.e. /dev/mmcblk0 then formatted it as FAT32. The key to fix it was to format (mkfs.vfat) the actual partition /dev/mmcblk0p1 instead. It was U-Boot that had trouble reading from the memory and reported having no partition, though the message was different iirc. This is the post with details Boot-from-QSPI-load-image-ub-from-MMC 

  At this point I would try re-formatting the SD card in a different way. See the formatting details in the solution in the above post.

 

Thanks,

-Pat

 

Give kudos if helpful. Accept as solution if it solves your problem.
https://tuxengineering.com/blog

View solution in original post

0 Kudos