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!

AR# 71231

2017.1-2019.1 Zynq-7000: Cannot boot Zynq-7000 PetaLinux images individually in legacy flow

Description

On Zynq-7000 devices I cannot boot the Zynq-7000 PetaLinux generated uImage, system.dtb, and rootfs.cpio.gz.u-boot files.

When I boot these images using tftpboot or SD it returns the errors below.

U-Boot 2017.01 (Jun 06 2018 - 12:42:12 -0600)

Model: Zynq ZC702 Development Board
Board: Xilinx Zynq
I2C:   ready
DRAM:  ECC disabled 1 GiB
MMC:   sdhci@e0100000: 0 (SD)
SF: Detected n25q128a with page size 256 Bytes, erase size 64 KiB, total 16 MiB
In:    serial@e0001000
Out:   serial@e0001000
Err:   serial@e0001000
Net:   ZYNQ GEM: e000b000, phyaddr 7, interface rgmii-id
eth0: ethernet@e000b000
Hit any key to stop autoboot:  0
Zynq>
Zynq> mmc dev 0 && mmcinfo && load mmc 0 0x2080000 uImage && load mmc 0 0x2000000 system.dtb && load mmc 0 0x4000000 rootfs.cpio.gz.u-boot && bootm 0x2080000 0x4000000 0x2000000
switch to partitions #0, OK
mmc0 is current device
Device: sdhci@e0100000
Manufacturer ID: 3
OEM: 5344
Name: SL16G
Tran Speed: 50000000
Rd Block Len: 512
SD version 3.0
High Capacity: Yes
Capacity: 14.8 GiB
Bus Width: 4-bit
Erase Group Size: 512 Bytes
reading uImage
9454344 bytes read in 796 ms (11.3 MiB/s)
reading system.dtb
20291 bytes read in 15 ms (1.3 MiB/s)
reading rootfs.cpio.gz.u-boot
5728093 bytes read in 490 ms (11.1 MiB/s)
Wrong Image Format for bootm command
ERROR: can't get kernel image!
Zynq>

Solution

To work around this issue, follow the steps below.

  1. First copy the Extra U-boot env settings from <proj-proj-root>/project-spec/meta-plnx-generated/recipes-bsp/u-boot/configs/platform-auto.h to <proj-proj-root>/project-spec/meta-user/recipes-bsp/u-boot/files/platform-top.h
  2. Add the highlighted config variables shown below and then rebuild PetaLinux u-boot:

#define CONFIG_IMAGE_FORMAT_LEGACY
/* Extra U-Boot Env settings */
#define CONFIG_EXTRA_ENV_SETTINGS \
    SERIAL_MULTI \
    CONSOLE_ARG \
    DFU_ALT_INFO_RAM \
    DFU_ALT_INFO_MMC \
    PSSERIAL0 \
    "nc=setenv stdout nc;setenv stdin nc;\0" \
    "ethaddr=00:0a:35:00:1e:53\0" \
    "bootenv=uEnv.txt\0" \
    "importbootenv=echo \"Importing environment from SD ...\"; " \
        "env import -t ${loadbootenv_addr} $filesize\0" \
    "loadbootenv=load mmc $sdbootdev:$partid ${loadbootenv_addr} ${bootenv}\0" \
    "sd_uEnvtxt_existence_test=test -e mmc $sdbootdev:$partid /uEnv.txt\0" \
    "uenvboot=" \
        "if run sd_uEnvtxt_existence_test; then " \
            "run loadbootenv; " \
            "echo Loaded environment from ${bootenv}; " \
            "run importbootenv; " \
            "fi; " \
        "if test -n $uenvcmd; then " \
            "echo Running uenvcmd ...; " \
            "run uenvcmd; " \
        "fi\0" \
    "autoload=no\0" \
    "sdbootdev=0\0" \
    "clobstart=0x10000000\0" \
    "netstart=0x10000000\0" \
    "dtbnetstart=0x23fff000\0" \
    "loadaddr=0x10000000\0" \
    "boot_img=BOOT.BIN\0" \
    "load_boot=tftpboot ${clobstart} ${boot_img}\0" \
    "update_boot=setenv img boot; setenv psize ${bootsize}; setenv installcmd \"install_boot\"; run load_boot ${installcmd}; setenv img; setenv psize; setenv installcmd\0" \
    "install_boot=mmcinfo && fatwrite mmc ${sdbootdev} ${clobstart} ${boot_img} ${filesize}\0" \
    "bootenvsize=0x20000\0" \
    "bootenvstart=0x500000\0" \
    "eraseenv=sf probe 0 && sf erase ${bootenvstart} ${bootenvsize}\0" \
    "jffs2_img=rootfs.jffs2\0" \
    "load_jffs2=tftpboot ${clobstart} ${jffs2_img}\0" \
    "update_jffs2=setenv img jffs2; setenv psize ${jffs2size}; setenv installcmd \"install_jffs2\"; run load_jffs2 test_img; setenv img; setenv psize; setenv installcmd\0" \
    "sd_update_jffs2=echo Updating jffs2 from SD; mmcinfo && fatload mmc ${sdbootdev}:1 ${clobstart} ${jffs2_img} && run install_jffs2\0" \
    "install_jffs2=sf probe 0 && sf erase ${jffs2start} ${jffs2size} && " \
        "sf write ${clobstart} ${jffs2start} ${filesize}\0" \
    "kernel_img=image.ub\0" \
    "load_kernel=tftpboot ${clobstart} ${kernel_img}\0" \
    "update_kernel=setenv img kernel; setenv psize ${kernelsize}; setenv installcmd \"install_kernel\"; run load_kernel ${installcmd}; setenv img; setenv psize; setenv installcmd\0" \
    "install_kernel=mmcinfo && fatwrite mmc ${sdbootdev} ${clobstart} ${kernel_img} ${filesize}\0" \
    "cp_kernel2ram=mmcinfo && fatload mmc ${sdbootdev} ${netstart} ${kernel_img}\0" \
    "dtb_img=system.dtb\0" \
    "load_dtb=tftpboot ${clobstart} ${dtb_img}\0" \
    "update_dtb=setenv img dtb; setenv psize ${dtbsize}; setenv installcmd \"install_dtb\"; run load_dtb test_img; setenv img; setenv psize; setenv installcmd\0" \
    "sd_update_dtb=echo Updating dtb from SD; mmcinfo && fatload mmc ${sdbootdev}:1 ${clobstart} ${dtb_img} && run install_dtb\0" \
    "loadbootenv_addr=0x00100000\0" \
    "fault=echo ${img} image size is greater than allocated place - partition ${img} is NOT UPDATED\0" \
    "test_crc=if imi ${clobstart}; then run test_img; else echo ${img} Bad CRC - ${img} is NOT UPDATED; fi\0" \
    "test_img=setenv var \"if test ${filesize} -gt ${psize}\\; then run fault\\; else run ${installcmd}\\; fi\"; run var; setenv var\0" \
    "netboot=tftpboot ${netstart} ${kernel_img} && bootm\0" \
    "default_bootcmd=run uenvboot; run cp_kernel2ram && bootm ${netstart}\0" \
    "initrd_high=0x20000000\0" \
    "fdt_high=0x20000000\0" \

""


Note: On target, halt at the u-boot prompt and verify that the initrd_high and ftd_high values are set.

AR# 71231
Date 05/29/2019
Status Active
Type General Article
Devices
  • Zynq-7000
Tools
  • PetaLinux - 2017.1
  • PetaLinux - 2017.2
  • PetaLinux - 2017.3
  • More
  • PetaLinux - 2017.4
  • PetaLinux - 2018.1
  • PetaLinux - 2018.2
  • PetaLinux - 2018.3
  • PetaLinux - 2019.1
  • Less
Boards & Kits
  • Zynq-7000 SoC Boards and Kits
Page Bookmarked