This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Booting off eMMC u-boot issues

Dear TI Community,

One of our products is an embedded system that uses an AM335x processor with two MMC devices.
Everything on the system works correctly except getting u-boot to correctly boot off of the eMMC device on MMC1.

I have no issues booting off of MMC0 which has an SD card. The boot config is 11100 set to try MMC1, then MMC0 but I change it to boot to MMC0. I edited the SD card kernel with board-am335xevm.c and I am able to see and access the MMC1 eMMC device while I am booted on the SD card. I can create partitions, read/write data and I copied MLO, u-boot and uImage. When I then remove the SD card and power cycle the device it does find the boot partition on the eMMC and try to load u-boot but fails to proceed. Here is the output:

U-Boot SPL 2013.01.01 (Apr 16 2014 - 11:53:24)
musb-hdrc: ConfigData=0xde (UTMI-8, dyn FIFOs, bulk combine, bulk split, HB-ISO Rx, HB-ISO Tx, SoftConn)
musb-hdrc: MHDRC RTL version 2.0
musb-hdrc: setup fifo_mode 4
musb-hdrc: 28/31 max ep, 16384/16384 memory
USB Peripheral mode controller at 47401000 using PIO, IRQ 0
musb-hdrc: ConfigData=0xde (UTMI-8, dyn FIFOs, bulk combine, bulk split, HB-ISO Rx, HB-ISO Tx, SoftConn)
musb-hdrc: MHDRC RTL version 2.0
musb-hdrc: setup fifo_mode 4
musb-hdrc: 28/31 max ep, 16384/16384 memory
USB Host mode controller at 47401800 using PIO, IRQ 0
OMAP SD/MMC: 0
spl: fat register err - -1
### ERROR ### Please RESET the board ###

I have tried changing the settings in the u-boot config file include/configs/am335x_evm.h

mmcroot=/dev/mmcblk0p2 to mmcroot=/dev/mmcblk1p2

mmcdev=0 to mmcdev=1

but it has not helped. I have tried both 0 and 1. I also tried changing the section

/* USB Device Firmware Update support */ to match these but with no luck.

I am using Sitara SDK 6  as I could not get the kernel to work correctly from SDK 7 on the SD card.

Some more details: we are using:

U7,V7,R8,T8,U8,V8,R9,T9 for MMC1 DAT0-7 MUX2 and

U9,V9 for MMC1 CLK MUX0 MMC CMD MUX0

and V17 GPIO1_27 is being used for MMC1 Reset (nothing special just has to be low)

and the eMMC chip we are using is Micron 2G MTFC2GMDEA

Does using MUX0 and MUX2 for MMC1 have any potential problems?

Also, I understand one can customize the pinmux for the kernel build, but does this also apply in any way to u-boot?

Any help or a point in the right direction is much appreciated. Thank you for your time!

Regards,

Anthony

  • Not sure if it's relevant at all, but using SDK 5.7 I was able to get the following output :

    U-Boot SPL 2013.01.01 (Apr 24 2014 - 15:14:39)
    musb-hdrc: ConfigData=0xde (UTMI-8, dyn FIFOs, bulk combine, bulk split, HB-ISO Rx, HB-ISO Tx, SoftConn)
    musb-hdrc: MHDRC RTL version 2.0
    musb-hdrc: setup fifo_mode 4
    musb-hdrc: 28/31 max ep, 16384/16384 memory
    USB Peripheral mode controller at 47401000 using PIO, IRQ 0
    musb-hdrc: ConfigData=0xde (UTMI-8, dyn FIFOs, bulk combine, bulk split, HB-ISO Rx, HB-ISO Tx, SoftConn)
    musb-hdrc: MHDRC RTL version 2.0
    musb-hdrc: setup fifo_mode 4
    musb-hdrc: 28/31 max ep, 16384/16384 memory
    USB Host mode controller at 47401800 using PIO, IRQ 0
    OMAP SD/MMC: 0
    mmc_send_cmd : timeout: No status update
    reading u-boot.img
    spl: error reading image u-boot.img, err - -1
    ### ERROR ### Please RESET the board ###

  • When booting off the SD card, if I enter U-boot there I tried the following commands:

    U-Boot# mmc list
    OMAP SD/MMC: 0
     OMAP SD/MMC: 1
    U-Boot# mmc dev
    mmc0 is current device
    U-Boot# mmc dev 1
    Card did not respond to voltage select!
    mmc1(part 0) is current device

    U-boot# mmc part

    ##Unknown partition table

  • Hi Anthony,

    The pins you use for MMC1 boot are correct. These pins are initialized by the ROM code when MMC1 boot mode is selected. Does booting start from the eMMC (MLO stage) or nothing happens at all?

  • Thank you Biser,

    It does seem that MLO is being found on the boot partition I created. The output is as follows:

    U-Boot SPL 2013.01.01 (Apr 16 2014 - 11:53:24)
    musb-hdrc: ConfigData=0xde (UTMI-8, dyn FIFOs, bulk combine, bulk split, HB-ISO Rx, HB-ISO Tx, SoftConn)
    musb-hdrc: MHDRC RTL version 2.0
    musb-hdrc: setup fifo_mode 4
    musb-hdrc: 28/31 max ep, 16384/16384 memory
    USB Peripheral mode controller at 47401000 using PIO, IRQ 0
    musb-hdrc: ConfigData=0xde (UTMI-8, dyn FIFOs, bulk combine, bulk split, HB-ISO Rx, HB-ISO Tx, SoftConn)
    musb-hdrc: MHDRC RTL version 2.0
    musb-hdrc: setup fifo_mode 4
    musb-hdrc: 28/31 max ep, 16384/16384 memory
    USB Host mode controller at 47401800 using PIO, IRQ 0
    OMAP SD/MMC: 0
    spl: fat register err - -1
    ### ERROR ### Please RESET the board ###


    Using a different MLO I have also gotten it to say it is finding u-boot but never does..

  • And just to clarify, that is the output when I have no SD card in and the system is booting of the eMMC

  • Hi Anthony,

    Please let us know how you partitioned the eMMC.

    Best regards,
    Miroslav

  • Thank you for your help Miroslav .

    On this eMMC there are 3 devices that show up. There is /dev/mmcblk1

    /dev/mmcblk1boot0 and

    /dev/mmcblk1boot1

    Both boot devices are only 1 mb. At first I did not touch them and write 3 partitions to /dev/mmcblk1, one of them being 74.03 MB for the boot partition in fat 32 lba and the other two being ext3. The then tried compiling u-boot MLO and uImage and copying them into the boot partition and power cycled the unit and that is how I got the output I posted.

  • Anthony, I haven't tried with SDK version 06.00.00.00, but I verified that the following steps work with SDK version 07.00.00.00:

    1. Boot the device from the SD card.

    2. ssh into the board:
    # ssh root@<your_device_ip_address>

    3. The eMMC is /dev/mmcblk1. Format it this way:
    3.01. fdisk /dev/mmcblk1
    3.02. o - this clears the existing partitions
    3.03. p - this lists all partition tables on the card (there should be none)
    3.04. n - create a new partition
    3.05. p - primary partition
    3.06. 1 - partition number
    3.07. 2048 - default value for the first sector
    3.08. +16M - last sector / partition size
    3.09. t - change the partition type (select partition 1)
    3.10. e - change tha partition type to "W95 FAT16 (LBA)"
    3.11. a - set the bootable flag for the selected partition (1)
    3.12. n - create a new partition
    3.13. p - primary partition
    3.14. 2 - partition number
    3.15. hit Enter to choose the default (next available) value for the first sector
    3.16. hit Enter to choose the default (last) value for the last sector
    3.17. p - this lists all partition tables on the card (there should be two)
    3.18. w - write all the above changes to disk
    3.19. umount /dev/mmcblk1p1; mkfs.vfat -F 16 /dev/mmcblk1p1 - format the first partition
    3.20. umount /dev/mmcblk1p2; mkfs.ext4 /dev/mmcblk1p2 - format the second partition

    4. Copy the {MLO,u-boot.img,uEnv.txt} files to the first partition:
    # mkdir boot
    # mount /dev/mmcblk1p1 boot
    # cp {MLO,u-boot.img,uEnv.txt} boot
    # umount boot

    5. Copy the root file system to the second partition:
    # mkdir root
    # mount /dev/mmcblk1p2 root
    # tar -xf tisdk-rootfs-image-am335x-evm.tar.gz -C root
    # umount root

    6. Shutdown the BBB, remove the SD card and start it from the eMMC.

    I assume this would be almost the same with SDK 06.00.00.00, except that maybe you should write your custom uEnv.txt file with a custom uenvcmd command. Please let me know about your progress.

    Best regards,
    Miroslav

  • Thank you Miroslav. I went through the steps you posted exactly and power cycled the unit. I used the same MLO u-boot as before and I ended up getting the same exact output as above. I'm guessing that means its just a matter of correctly compiling u-boot and the kernel then?

    I have a beaglebone around so I decided to try to use its MLO and u-boot files to see if I would get different results. It seems to correctly identify the eMMC and if I stop autoboot I can do

    mmc dev 1

    mmc part

    and it lists the two partitions correctly. I went into SDK 7 and compiled the default u-boot configuration (from top directory "make u-boot-spl"), then compiled the default kernel and copied them into the eMMC boot partition the same way you described. This is the output, hanging at  starting kernel.

    U-boot output:

    U-Boot 2013.10 (Apr 29 2014 - 12:46:59)

    I2C:   ready
    DRAM:  256 MiB
    NAND:  0 MiB
    MMC:   OMAP SD/MMC: 0, OMAP SD/MMC: 1
    *** Error - No Valid Environment Area found
    *** Warning - bad CRC, using default environment

    Net:   <ethaddr> not set. Validating first E-fuse MAC
    cpsw, usb_ether
    Hit any key to stop autoboot:  0
    mmc0 is current device
    Scanning mmc 0...
    ** File not found /boot/zImage **
    mmc0 is current device
    SD/MMC found on device 0
    reading uEnv.txt
    ** Unable to read file uEnv.txt **
    ** File not found /boot/zImage **
    mmc1(part 0) is current device
    SD/MMC found on device 1
    reading uEnv.txt
    ** Unable to read file uEnv.txt **
    4117616 bytes read in 590 ms (6.7 MiB/s)
    ** File not found /boot/undefined **
    Kernel image @ 0x80200000 [ 0x000000 - 0x3ed470 ]

    Starting kernel
    ...


    I will try to use SDK 6 as I had the same "starting kernel" hanging when I used an SD card with a kernel from SDK 7.

    Does u-boot getting this far mean that my partitioning is correct? I figure since it has to be finding MLO and u-boot it must be in the right direction..

  • Anthony Jarmolowicz said:
    Does u-boot getting this far mean that my partitioning is correct? I figure since it has to be finding MLO and u-boot it must be in the right direction..

    Yes, your system does load the MLO, u-boot.img and zImage files, so it seems like the partitioning is OK.

    Why is the uEnv.txt file not found? Is it not present?

    Please post your U-Boot variables.

    Also please let me know if you have the device tree file your board need inside <rootfs_partition>/boot/ (this is relevant only for SDK 07.00.00.00).

    Best regards,
    Miroslav

  • Yes I was not putting a uEnv.txt on the boot partition. I was not using one on the SD card so I thought it's not needed but now I created one. Also, I extracted the SDK 7 filesystem tarball on  (copied from /filesystem/tisdk-rootfs-image-am335x-evm.tar.gz) and looked under boot directory, it appears the device tree files are there:

    am335x-bone.dtb
    am335x-boneblack.dtb
    am335x-evm.dtb
    am335x-evmsk.dtb
    devicetree-zImage-am335x-bone.dtb
    devicetree-zImage-am335x-boneblack.dtb
    devicetree-zImage-am335x-evm.dtb
    devicetree-zImage-am335x-evmsk.dtb
    vmlinux-3.12.10-ti2013.12.01
    zImage

    This is the uEnv.txt file I created based on the default one in the u-boot wiki:

    mmcrootfstype=ext3 rootwait                                          
    bootargs=console=ttyO0,115200n8 root=/dev/mmcblk1p2 mem=256M rootwait
    bootcmd=mmc rescan; fatload mmc 1 0x82000000 zImage; bootm 0x82000000
    uenvcmd=boot

    Upon which I get the following output on power cycle:

    U-Boot 2013.10 (Apr 29 2014 - 16:32:09)

    I2C:   ready
    DRAM:  256 MiB
    NAND:  0 MiB
    MMC:   OMAP SD/MMC: 0, OMAP SD/MMC: 1
    *** Error - No Valid Environment Area found
    *** Warning - bad CRC, using default environment

    Net:   <ethaddr> not set. Validating first E-fuse MAC
    cpsw, usb_ether
    Hit any key to stop autoboot:  0
    mmc0 is current device
    Scanning mmc 0...
    ** File not found /boot/zImage **
    mmc1(part 0) is current device
    SD/MMC found on device 1
    reading uEnv.txt
    181 bytes read in 4 ms (43.9 KiB/s)
    Loaded environment from uEnv.txt
    Importing environment from mmc ...
    Running uenvcmd ...
    reading zImage
    3987344 bytes read in 526 ms (7.2 MiB/s)
    Wrong Image Format for bootm command
    ERROR: can't get kernel image!
    mmc1(part 0) is current device
    SD/MMC found on device 1
    reading uEnv.txt
    181 bytes read in 3 ms (58.6 KiB/s)
    Loaded environment from uEnv.txt
    Importing environment from mmc ...
    Running uenvcmd ...
    reading zImage
    3987344 bytes read in 526 ms (7.2 MiB/s)
    Wrong Image Format for bootm command
    ERROR: can't get kernel image!
    Booting from nand ...

    no devices available

    no devices available
    Bad Linux ARM zImage magic!
    U-Boot#

    Here is the results of printenv:

    arch=arm
    baudrate=115200
    board=am335x
    board_name=A335BONE
    board_rev=00A6
    boot_fdt=try
    boot_targets= mmc0 nand
    bootargs=console=ttyO0,115200n8 root=ubi0:rootfs rw ubi.mtd=NAND.file-system,2048 rootfstype=ubifs rootwait=1
    bootcmd=mmc rescan; fatload mmc 1 0x82000000 zImage; bootm 0x82000000
    bootcmd_mmc0=setenv devnum 0; setenv rootpart 2; run mmc_boot;
    bootcmd_nand=run nandboot;
    bootcmd_usb=setenv devnum 0; run usb_boot;
    bootdelay=3
    bootdir=/boot
    bootenv=uEnv.txt
    bootfile=zImage
    bootpart=1:2
    console=ttyO0,115200n8
    cpu=armv7
    devnum=0
    devtype=mmc
    dfu_alt_info_emmc=rawemmc mmc 0 3751936
    dfu_alt_info_mmc=boot part 0 1;rootfs part 0 2;MLO fat 0 1;MLO.raw mmc 100 100;u-boot.img.raw mmc 300 400;spl-os-args.raw mmc 80 80;spl
    -os-image.raw mmc 900 2000;spl-os-args fat 0 1;spl-os-image fat 0 1;u-boot.img fat 0 1;uEnv.txt fat 0 1
    dfu_alt_info_nand=NAND.SPL part 0 1;NAND.SPL.backup1 part 0 2;NAND.SPL.backup2 part 0 3;NAND.SPL.backup3 part 0 4;NAND.u-boot-spl-os pa
    rt 0 5;NAND.u-boot part 0 6;NAND.u-boot-env part 0 7;NAND.u-boot-env.backup1 part 0 8;NAND.kernel part 0 9;NAND.rootfs part 0 10
    dfu_alt_info_ram=kernel ram 0x80200000 0xD80000;fdt ram 0x80F80000 0x80000;ramdisk ram 0x81000000 0x4000000
    eth1addr=c4:ed:ba:85:80:cf
    ethact=cpsw
    ethaddr=c4:ed:ba:85:80:ce
    fdt_high=0xa0000000
    fdtaddr=0x80F80000
    fdtfile=undefined
    filesize=3cd790
    findfdt=if test $board_name = A335BONE; then setenv fdtfile am335x-bone.dtb; fi; if test $board_name = A335BNLT; then setenv fdtfile am
    335x-boneblack.dtb; fi; if test $board_name = A33515BB; then setenv fdtfile am335x-evm.dtb; fi; if test $board_name = A335X_SK; then se
    tenv fdtfile am335x-evmsk.dtb; fi; if test $fdtfile = undefined; then echo WARNING: Could not determine device tree to use; fi;
    importbootenv=echo Importing environment from mmc ...; env import -t $loadaddr $filesize
    loadaddr=0x80200000
    loadbootenv=load mmc ${mmcdev} ${loadaddr} ${bootenv}
    loadfdt=load mmc ${bootpart} ${fdtaddr} ${bootdir}/${fdtfile}
    loadimage=load mmc ${bootpart} ${loadaddr} ${bootdir}/${bootfile}
    loadramdisk=load mmc ${mmcdev} ${rdaddr} ramdisk.gz
    mmc_boot=setenv devtype mmc; if mmc dev ${devnum}; then run mmcargs;run scan_boot; run mmcboot;setenv mmcdev 1; setenv bootpart 1:2; ru
    n mmcboot;fi
    mmcargs=setenv bootargs console=${console} ${optargs} root=${mmcroot} rootfstype=${mmcrootfstype}
    mmcboot=mmc dev ${mmcdev}; if mmc rescan; then echo SD/MMC found on device ${mmcdev};if run loadbootenv; then echo Loaded environment f
    rom ${bootenv};run importbootenv;fi;if test -n $uenvcmd; then echo Running uenvcmd ...;run uenvcmd;fi;if run loadimage; then run mmcloa
    dos;fi;fi;
    mmcdev=1
    mmcloados=run mmcargs; if test ${boot_fdt} = yes || test ${boot_fdt} = try; then if run loadfdt; then bootz ${loadaddr} - ${fdtaddr}; e
    lse if test ${boot_fdt} = try; then bootz; else echo WARN: Cannot load the DT; fi; fi; else bootz; fi;
    mmcroot=/dev/mmcblk1p2 ro
    mmcrootfstype=ext3 rootwait
    mtdids=nand0=nand.0
    mtdparts=mtdparts=nand.0:128k(NAND.SPL),128k(NAND.SPL.backup1),128k(NAND.SPL.backup2),128k(NAND.SPL.backup3),256k(NAND.u-boot-spl-os),1
    m(NAND.u-boot),128k(NAND.u-boot-env),128k(NAND.u-boot-env.backup1),8m(NAND.kernel),-(NAND.rootfs)
    nandargs=setenv bootargs console=${console} ${optargs} root=${nandroot} rootfstype=${nandrootfstype}
    nandboot=echo Booting from nand ...; run nandargs; nand read ${fdtaddr} NAND.u-boot-spl-os; nand read ${loadaddr} NAND.kernel; bootz ${
    loadaddr} - ${fdtaddr}
    nandroot=ubi0:rootfs rw ubi.mtd=NAND.file-system,2048
    nandrootfstype=ubifs rootwait=1
    netargs=setenv bootargs console=${console} ${optargs} root=/dev/nfs nfsroot=${serverip}:${rootpath},${nfsopts} rw ip=dhcp
    netboot=echo Booting from network ...; setenv autoload no; dhcp; tftp ${loadaddr} ${bootfile}; tftp ${fdtaddr} ${fdtfile}; run netargs;
     bootz ${loadaddr} - ${fdtaddr}
    nfsopts=nolock
    partitions=uuid_disk=${uuid_gpt_disk};name=rootfs,start=2MiB,size=-,uuid=${uuid_gpt_rootfs}
    ramargs=setenv bootargs console=${console} ${optargs} root=${ramroot} rootfstype=${ramrootfstype}
    ramboot=echo Booting from ramdisk ...; run ramargs; bootz ${loadaddr} ${rdaddr} ${fdtaddr}
    ramroot=/dev/ram0 rw ramdisk_size=65536 initrd=${rdaddr},64M
    ramrootfstype=ext2
    rdaddr=0x81000000
    rootpart=2
    rootpath=/export/rootfs
    scan_boot=echo Scanning ${devtype} ${devnum}...; for prefix in ${bootdir}; do for script in ${bootfile}; do run script_boot; done; done
    ;
    script_boot=if load ${devtype} ${devnum}:${rootpart} ${loadaddr} ${bootdir}/${bootfile}; then run findfdt; load ${devtype} ${devnum}:${
    rootpart} ${fdtaddr} ${bootdir}/${fdtfile};fi;
    soc=am33xx
    spiargs=setenv bootargs console=${console} ${optargs} root=${spiroot} rootfstype=${spirootfstype}
    spiboot=echo Booting from spi ...; run spiargs; sf probe ${spibusno}:0; sf read ${loadaddr} ${spisrcaddr} ${spiimgsize}; bootz ${loadad
    dr}
    spibusno=0
    spiimgsize=0x362000
    spiroot=/dev/mtdblock4 rw
    spirootfstype=jffs2
    spisrcaddr=0xe0000
    static_ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}::off
    stderr=serial
    stdin=serial
    stdout=serial
    uenvcmd=boot
    usb_boot=setenv devtype usb; run usb_init; if usb dev 0; then run usbargs;run scan_boot; bootz ${loadaddr} - ${fdtaddr}; fi
    usb_init=usb start 0;
    usbargs=setenv bootargs console=${console} ${optargs} root=${usbroot} rootfstype=${usbrootfstype}
    usbnet_devaddr=c4:ed:ba:85:80:cf
    usbroot=/dev/sda2 rw
    usbrootfstype=ext3 rootwait
    vendor=ti
    ver=U-Boot 2013.10 (Apr 29 2014 - 16:32:09)

    Environment size: 5568/131067 bytes
    U-Boot#

  • Just to be clear I am still trying everything in SDK 7.

    After doing some searching, I found this thread which suggests I could just need to compile my kernel with a loadaddress header

    http://e2e.ti.com/support/dsp/omap_applications_processors/f/42/t/309128.aspx

    I used the command

    make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- LOADADDR=0x82000000 zImage

    with both 82000000 and 80008000 which was the value in the kernel wiki.. but no luck, still the same result    

  • hi All,

    any luck ?

    i am facing same probelm

    here is my log

    SD/MMC found on device 1
    reading uEnv.txt
    71 bytes read in 3 ms (22.5 KiB/s)
    Loaded environment from uEnv.txt
    Importing environment from mmc ...
    4117600 bytes read in 237 ms (16.6 MiB/s)
    ** File not found /boot/undefined **
    Kernel image @ 0x80200000 [ 0x000000 - 0x3ed460 ]

    Starting kernel ...

    regards

    Nagendra

  • Nagendra - in your case, you are not getting the name of the device tree file. The environment variable fdtfile is set to 'undefined' until you 'run findfdt'. After that fdtfile should have a valid value.

    Steve K.

  • So this kind of went on the backburner for a while, but I returned to it and now the eMMC is working correctly.

    If anyone else runs into this problem, you can follow the steps here:

    http://eewiki.net/display/linuxonarm/BeagleBone+Black#BeagleBoneBlack-eMMC

    Note: since arago doesn't have rsync the scripts wont work on it. I ended up just building debian and doing the other steps.

    Basically I did not have uInitrd which I guess is needed and a corresponding uEnv.txt entry. If you study Robert Nelson's scripts I'm sure one could adapt it to Arago.

  • Any error related to

    ** File not found /boot/undefined **

    indicates that this file has been mentioned in the uEnv.txt in /media/boot partition of the SD card.

    This file is required in the file system partition in the /media/rootfs and in the folder "boot" inside this partition on the SD card.

    This is relevant to any file error you get on the u-boot console. Solution is to copy the file mentioned in error to the respective location.

    Else the error could be in the mapping of SD card partition address specified in the loadaddr in uEnv.txt for /media/boot partition. This is rare as the settings are inside closed git repository, unless tweaked.

    Note: There is another uEnv.txt file present in the /boot directory of the /media/rootfs partition. Which is quite confusing.

  • Hi Anthony,

    Can you please explain as to how did you exactly write those 3 partitions.

    What commands did you use. I have the same tyrpe of paritions but fdisk just hangs.

    Regards,

    Preetam