element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Avnet Boards Forums
  • Products
  • Dev Tools
  • Avnet Boards Community
  • Avnet Boards Forums
  • More
  • Cancel
Avnet Boards Forums
Ultrazed Hardware Design Boot Ultrazed From eMMC
  • Forum
  • Documents
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Avnet Boards Forums to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • Replies 5 replies
  • Subscribers 324 subscribers
  • Views 2470 views
  • Users 0 members are here
  • ultrazed
Related

Boot Ultrazed From eMMC

oleb0n
oleb0n over 5 years ago

I am trying to make my Ultrazed EG boot from eMMC. It looks like I am missing something, because it does not work yet. These are the steps I make:

 

1. Build a simple Vivado project (2019.2) with BRAM and AXI UART just to add something

2. Create a petalinux project based on Ultrazed IOOC BSP with following options:

     - sys console PS UART0

     -rootfs mmcblk1p2 to boot from SD (to be changed later)

     - kernel, dev tree and image all stored on SD

3. petalinux-build and "petalinux-package --boot --fsbl images/linux/zynqmp_fsbl.elf --u-boot images/linux/u-boot.elf --pmufw images/linux/pmufw.elf --fpga images/linux/system.bit --force"

3.(A) Create similar set of system files with rootfs location  mmcblk0p2

4.Format SD card and write three system files to BOOT partition fat32 and rsync existing rootfs Ubuntu to ext4 partition.

5. Boot Ultrazed from the SD card

6. Use fdisk to create BOOT and rootfs on /dev/mmcblk0 (eMMC)

7. Copy additional set of three system files (ones showing location of rootfs as /dev/mmcblk0p2) to /dev/mmcblk0p1 and use rsync to copy rootfs from /dev/mmcblk1p2 to /dev/mmcblk1p2

8. Change boot mode switch on Ultrazed to 1001 and reboot

9 See the output below. It stops at uboot and cannot move further.

10. I also tried to create a uEnv.txt with the line "root=/dev/mmcblk0p2"  in the eMMC boot partition, it does not make any difference. I can very easily boot Ubuntu from SD but not from eMMC, please help!

 

 

 

Xilinx Zynq MP First Stage Boot Loader

Release 2019.2   Jul 17 2020  -  18:15:03

NOTICE:  ATF running on XCZU3EG/silicon v4/RTL5.1 at 0xfffea000

NOTICE:  BL31: Secure code at 0x0

NOTICE:  BL31: Non secure code at 0x8000000

NOTICE:  BL31: v2.0(release):xilinx-v2019.1-12-g713dace9

NOTICE:  BL31: Built : 18:11:52, Jul 17 2020

PMUFW:  v1.1

 

 

U-Boot 2019.01 (Jul 17 2020 - 18:12:51 +0000)

 

Board: Xilinx ZynqMP

DRAM:  2 GiB

EL Level:       EL2

Chip ID:        zu3eg

MMC:   mmc@ff160000: 0, mmc@ff170000: 1

Loading Environment from SPI Flash... SF: Detected n25q256a with page size 512 Bytes, erase size 128 KiB, total 64 MiB

*** Warning - bad CRC, using default environment

 

In:    serial@ff000000

Out:   serial@ff000000

Err:   serial@ff000000

Board: Xilinx ZynqMP

Bootmode: EMMC_MODE

Reset reason:   EXTERNAL

Net:   ZYNQ GEM: ff0e0000, phyaddr 9, interface rgmii-id

eth0: ethernet@ff0e0000

U-BOOT for uz3eg-iocc-2019-2

 

ethernet@ff0e0000 Waiting for PHY auto negotiation to complete...... done

BOOTP broadcast 1

BOOTP broadcast 2

BOOTP broadcast 3

BOOTP broadcast 4

BOOTP broadcast 5

DHCP client bound to address 172.16.20.46 (3755 ms)

Hit any key to stop autoboot:  0

Device: mmc@ff160000

Manufacturer ID: 13

OEM: 14e

Name: Q2J55

Bus Speed: 50000000

Mode : MMC High Speed (52MHz)

Rd Block Len: 512

MMC version 5.0

High Capacity: Yes

Capacity: 7.1 GiB

Bus Width: 4-bit

Erase Group Size: 512 KiB

HC WP Group Size: 8 MiB

User Capacity: 7.1 GiB WRREL

Boot Capacity: 16 MiB ENH

RPMB Capacity: 4 MiB ENH

MMC: no card present

  • Sign in to reply
  • Cancel
Parents
  • narrucmot
    narrucmot over 5 years ago

    I suspect something is broken in your u-boot settings and/or Image Packaging Configuration settings.  Can you attach your <project>/project-spec/meta-user/recipes-bsp/u-boot/files/platform-top.h file here?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • oleb0n
    oleb0n over 5 years ago in reply to narrucmot

    Tom, I appreciate your very quick reply, thanks. The file contents is below:

     

    #include <configs/platform-auto.h>

     

    #define CONFIG_NR_DRAM_BANKS 3

     

    #define CONFIG_SYS_BOOTM_LEN 0xF000000

    #undef  CONFIG_SYS_BOOTMAPSZ

     

    #define DFU_ALT_INFO_RAM \

                    "dfu_ram_info=" \

            "setenv dfu_alt_info " \

            "image.ub ram $netstart 0x1e00000\0" \

            "dfu_ram=run dfu_ram_info && dfu 0 ram 0\0" \

            "thor_ram=run dfu_ram_info && thordown 0 ram 0\0"

     

    #define DFU_ALT_INFO_MMC \

            "dfu_mmc_info=" \

            "set dfu_alt_info " \

            "${kernel_image} fat 0 1\\\\;" \

            "dfu_mmc=run dfu_mmc_info && dfu 0 mmc 0\0" \

            "thor_mmc=run dfu_mmc_info && thordown 0 mmc 0\0"

     

    /*Required for uartless designs */

    #ifndef CONFIG_BAUDRATE

    #define CONFIG_BAUDRATE 115200

    #ifdef CONFIG_DEBUG_UART

    #undef CONFIG_DEBUG_UART

    #endif

    #endif

     

    /* Extra U-Boot Env settings */

    #define CONFIG_EXTRA_ENV_SETTINGS \

        SERIAL_MULTI \

        CONSOLE_ARG \

        PSSERIAL0 \

        "nc=setenv stdout nc;setenv stdin nc;\0" \

        "ethaddr=00:0a:35:00:22:01\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\0" \

        "sdboot=echo boot Petalinux; run uenvboot ; mmcinfo && fatload mmc 1 ${netstart} ${kernel_img} && bootm \0" \

        "autoload=no\0" \

        "clobstart=0x10000000\0" \

        "netstart=0x10000000\0" \

        "dtbnetstart=0x11800000\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 0 ${clobstart} ${boot_img} ${filesize}\0" \

        "bootenvsize=0x40000\0" \

        "bootenvstart=0x1360000\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 0: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 1 ${clobstart} ${kernel_img} ${filesize}\0" \

        "cp_kernel2ram=mmcinfo && fatload mmc 1 ${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 0:1 ${clobstart} ${dtb_img} && run install_dtb\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 cp_kernel2ram && bootm ${netstart}\0" \

    ""

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • oleb0n
    oleb0n over 5 years ago in reply to oleb0n

    After I found this post https://forums.xilinx.com/t5/Embedded-Linux/U-boot-How-to-set-the-default-mmc-device/m-p/777575#M20450  I could easily boot Ubuntu like this:

    ZynqMP> load mmc 0 0x10000000 image.ub

    18395704 bytes read in 1261 ms (13.9 MiB/s)

    ZynqMP> bootm

    ## Loading kernel from FIT Image at 10000000 ...

       Using 'conf@system-top.dtb' configuration

    ...

     

    However, the solution offered there is very ugly, so I simply run through platform-top.h and replaced all instances of "mmc 1 " with "mmc 0 " (but never touched "mmc 1:0" and it's booting now image

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • narrucmot
    narrucmot over 5 years ago in reply to oleb0n

    I noticed the "mmc 1" looked incorrect in the u-boot snipped you posted.  This is likely an artifact of the last-built boot method from our BSP build script, and was incompatible with eMMC boot.  I am glad you got it working!

     

    --Tom

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Reply
  • narrucmot
    narrucmot over 5 years ago in reply to oleb0n

    I noticed the "mmc 1" looked incorrect in the u-boot snipped you posted.  This is likely an artifact of the last-built boot method from our BSP build script, and was incompatible with eMMC boot.  I am glad you got it working!

     

    --Tom

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Children
  • oleb0n
    oleb0n over 5 years ago in reply to narrucmot

    A small detail, this is definitely not an artifact, because I just built my system from scratch and clearly showed that rootfs is on mmcblk0p2, but platform-top.h shows mmc 1:

    ""sdboot=echo boot Petalinux; run uenvboot ; mmcinfo && fatload mmc 1 ${netstart} ${kernel_img} && bootm \0" \ "

     

    I think BSP setings could have higher priority than user selected options.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube