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.

AM5728: Uboot Booting from EMMC Error Upgrading from UBoot 2017.01 to 2019.01

Part Number: AM5728

Hello, 

I have a custom AM5728 board with a 2GB EMMC that worked fine when booting from U-boot 2017.1. The custom board also does not have an EEPROM.

I'm in the process of upgrading to U-boot to 2019.01, and I receive this error during an EMMC boot: 

U-Boot SPL 2019.01-g332c5765ff-dirty (May 14 2020 - 23:21:12 -0700)
DRA752-GP ES2.0
Card did not respond to voltage select!
Firmware loading failed
Trying to boot from MMC2_2
Loading Environment from FAT... Card did not respond to voltage select!
Loading Environment from MMC... *** Warning - bad CRC, using default environment

** Partition 1 not valid on device 1 **
spl_register_fat_device: fat register err - -1
spl_load_image_fat_buf: error reading image u-boot.img, err - -1
Loading Environment from FAT... Card did not respond to voltage select!
Loading Environment from MMC... *** Warning - bad CRC, using default environment

spl: no partition table found
SPL: failed to boot from all boot devices
### ERROR ### Please RESET the board ###

I have verified the MLO and uboot-img works when booting from an SD card. However after copying the uboot files from SD card to EMMC(/run/media/mmcblk1p1) and power cycling without the SD card, I see the above error. 

I am using the ti-processor-sdk-linux-am57xx-evm-06.02.00.81 SDK.

  • Hi David,

    I am looking at the ti-processor-sdk-linux-am57xx-evm-06.02.00.81 SDK u-boot commits.

    I do not see any commit: 332c5765ff

    1) Do you have some custom commits on top of the default u-boot of SDK? just check if those additional commits are ported from 2017.01 to 2019.01
    2) Can you please add this below diff and share the complete logs for 2019 failure:

    diff --git a/include/configs/am57xx_evm.h b/include/configs/am57xx_evm.h
    index 3db1c1b6d8..9c342ba58c 100644
    --- a/include/configs/am57xx_evm.h
    +++ b/include/configs/am57xx_evm.h
    @@ -16,6 +16,8 @@
     
     #define CONFIG_IODELAY_RECALIBRATION
     
    +#define CONFIG_MMC_TRACE
    +
     /* MMC ENV related defines */
     #define CONFIG_SYS_MMC_ENV_DEV         1               /* eMMC */
     #define CONFIG_SYS_MMC_ENV_PART                0

    3) Also share 2017.01 success logs.


    Regards,
    Keerthy




  • Hello, 

    Yes, I do have custom commits on top of the default U-boot commits. The reason is they are mostly to get uart8 working as a console output and some pinmuxing. 

    I've added in the line CONFIG_MMC_TRACE. 

    I have also attached git patches of all the changes I've made compared to the original branch from downloading fro uboot 2017 and 2019! 

    TI_Logs.zip

  • Hello, 

    I've been scouring the forums for EMMC boot-up issues and looks like there are some common commands that I've seen people use to debug with the SD card bootup and in uboot CLI. 

    => fatls mmc 0:0
    ** Unrecognized filesystem type **
    => fatls mmc 1:0
    ** Unrecognized filesystem type **


    => fatls mmc 0:1 (SD Card)
    157991 MLO
    1444488 u-boot.img
    1520 uEnv.txt
    6884184 dra7-ipu1-fw.xem4
    System Volume Information/
    1 .psdk_setup

    5 file(s), 1 dir(s)

    => fatls mmc 1:1 (eMMC)
    1444488 u-boot.img
    157991 MLO
    6884184 dra7-ipu1-fw.xem4
    1520 uEnv.txt
    1 .psdk_setup

    5 file(s), 0 dir(s)

    _______________________________________________________

    => mmc dev 0
    switch to partitions #0, OK
    mmc0 is current device


    => mmc info
    Device: OMAP SD/MMC
    Manufacturer ID: 3
    OEM: 5344
    Name: SL16G
    Bus Speed: 48000000
    Mode : SD High Speed (50MHz)
    Rd Block Len: 512
    SD version 3.0
    High Capacity: Yes
    Capacity: 14.8 GiB
    Bus Width: 4-bit
    Erase Group Size: 512 Bytes

    _______________________________________________________


    => mmc dev 1
    switch to partitions #0, OK
    mmc1(part 0) is current device


    => mmc info
    Device: OMAP SD/MMC
    Manufacturer ID: 13
    OEM: 14e
    Name: Q2J54
    Bus Speed: 48000000
    Mode : MMC DDR52 (52MHz)
    Rd Block Len: 512
    MMC version 5.0
    High Capacity: Yes
    Capacity: 3.6 GiB
    Bus Width: 8-bit DDR
    Erase Group Size: 512 KiB
    HC WP Group Size: 8 MiB
    User Capacity: 3.6 GiB WRREL
    Boot Capacity: 2 MiB ENH
    RPMB Capacity: 512 KiB ENH

    As far as I know, this all looks correct? I've also attached my printenv log as well! 

    arch=arm
    args_mmc=run finduuid;setenv bootargs console=${console} ${optargs} root=PARTUUID=${uuid} rw rootfstype=${mmcrootfstype}
    baudrate=115200
    board=am57xx
    board_name=beagle_x15
    boot_fdt=try
    boot_fit=0
    bootargs=androidboot.serialno=${serial#} console=ttyS7,115200 androidboot.console=ttyS7 androidboot.hardware=beagle_x15board
    bootcmd=if test ${dofastboot} -eq 1; then echo Boot fastboot requested, resetting dofastboot ...;setenv dofastboot 0; saveenv;echo Booting into fastboot ...; fastboot 1; fi;if test ${boot_fit} -eq 1; then run update_to_fit;fi;run findfdt; run envboot; run mmcboot;run emmc_linux_boot; run emmc_android_boot; run setconsole;
    bootdelay=2
    bootdir=/boot
    bootenvfile=uEnv.txt
    bootfile=zImage
    bootm_size=0x10000000
    bootpart=0:2
    bootscript=echo Running bootscript from mmc${mmcdev} ...; source ${loadaddr}
    console=ttyS7,115200n8
    cpu=armv7
    dfu_alt_info_emmc=rawemmc raw 0 3751936;boot part 1 1;rootfs part 1 2;MLO fat 1 1;MLO.raw raw 0x100 0x200;u-boot.img.raw raw 0x300 0x1000;u-env.raw raw 0x1300 0x200;spl-os-args.raw raw 0x1500 0x200;spl-os-image.raw raw 0x1700 0x6900;spl-os-args fat 1 1;spl-os-image fat 1 1;u-boot.img fat 1 1;uEnv.txt fat 1 1
    dfu_alt_info_mmc=boot part 0 1;rootfs part 0 2;MLO fat 0 1;MLO.raw raw 0x100 0x200;u-boot.img.raw raw 0x300 0x1000;u-env.raw raw 0x1300 0x200;spl-os-args.raw raw 0x1500 0x200;spl-os-image.raw raw 0x1700 0x6900;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_qspi=MLO raw 0x0 0x040000;u-boot.img raw 0x040000 0x0100000;u-boot-spl-os raw 0x140000 0x080000;u-boot-env raw 0x1C0000 0x010000;u-boot-env.backup raw 0x1D0000 0x010000;kernel raw 0x1E0000 0x800000
    dfu_alt_info_ram=kernel ram 0x80200000 0x4000000;fdt ram 0x80f80000 0x80000;ramdisk ram 0x81000000 0x4000000
    dfu_bufsiz=0x10000
    dofastboot=0
    emmc_android_boot=echo Trying to boot Android from eMMC ...; run update_to_fit; setenv eval_bootargs setenv bootargs $bootargs; run eval_bootargs; setenv mmcdev 1; setenv machid fe6; mmc dev $mmcdev; mmc rescan; part start mmc ${mmcdev} boot boot_start; part size mmc ${mmcdev} boot boot_size; mmc read ${loadaddr} ${boot_start} ${boot_size}; bootm ${loadaddr}#${fdtfile};
    emmc_linux_boot=echo Trying to boot Linux from eMMC ...; setenv mmcdev 1; setenv bootpart 1:2; setenv mmcroot /dev/mmcblk0p2 rw; run mmcboot;
    envboot=mmc dev ${mmcdev}; if mmc rescan; then echo SD/MMC found on device ${mmcdev};if run loadbootscript; then run bootscript;else if run loadbootenv; then echo Loaded env from ${bootenvfile};run importbootenv;fi;if test -n $uenvcmd; then echo Running uenvcmd ...;run uenvcmd;fi;fi;fi;
    ethact=ethernet@48484000
    ethaddr=fc:69:47:f1:86:f2
    fastboot.cpu=DRA752
    fastboot.secure=GP
    fdt_addr_r=0x88000000
    fdtaddr=0x88000000
    fdtcontroladdr=fdf22088
    findfdt=if test $board_name = omap5_uevm; then setenv fdtfile omap5-uevm.dtb; fi; if test $board_name = dra7xx; then setenv fdtfile dra7-evm.dtb; fi;if test $board_name = dra72x-revc; then setenv fdtfile dra72-evm-revc.dtb; fi;if test $board_name = dra72x; then setenv fdtfile dra72-evm.dtb; fi;if test $board_name = dra71x && test $boot_nand = 1; then setenv fdtfile dra71-evm-nand.dtb; fi;if test $board_name = dra71x && test $boot_nand = 0; then setenv fdtfile dra71-evm.dtb; fi;if test $board_name = dra76x_acd; then setenv fdtfile dra76-evm.dtb; fi;if test $board_name = beagle_x15; then setenv fdtfile am57xx-beagle-x15.dtb; fi;if test $board_name = beagle_x15_revb1; then setenv fdtfile am57xx-beagle-x15-revb1.dtb; fi;if test $board_name = beagle_x15_revc; then setenv fdtfile am57xx-beagle-x15-revc.dtb; fi;if test $board_name = am5729_beagleboneai; then setenv fdtfile am5729-beagleboneai.dtb; fi;if test $board_name = am572x_idk && test $idk_lcd = no; then setenv fdtfile am572x-idk.dtb; fi;if test $board_name = am572x_idk && test $idk_lcd = osd101t2045; then setenv fdtfile am572x-idk-lcd-osd101t2045.dtb; fi;if test $board_name = am572x_idk && test $idk_lcd = osd101t2587; then setenv fdtfile am572x-idk-lcd-osd101t2587.dtb; fi;if test $board_name = am574x_idk && test $idk_lcd = no; then setenv fdtfile am574x-idk.dtb; fi;if test $board_name = am574x_idk && test $idk_lcd = osd101t2587; then setenv fdtfile am574x-idk-lcd-osd101t2587.dtb; fi;if test $board_name = am57xx_evm; then setenv fdtfile am57xx-evm.dtb; fi;if test $board_name = am57xx_evm_reva3; then setenv fdtfile am57xx-evm-reva3.dtb; fi;if test $board_name = am571x_idk && test $idk_lcd = no; then setenv fdtfile am571x-idk.dtb; fi;if test $board_name = am571x_idk && test $idk_lcd = osd101t2045; then setenv fdtfile am571x-idk-lcd-osd101t2045.dtb; fi;if test $board_name = am571x_idk && test $idk_lcd = osd101t2587; then setenv fdtfile am571x-idk-lcd-osd101t2587.dtb; fi;if test $fdtfile = undefined; then echo WARNING: Could not determine device tree to use; fi;
    finduuid=part uuid mmc ${bootpart} uuid
    fit_bootfile=fitImage
    fit_loadaddr=0x90000000
    get_overlaystring=for overlay in $overlay_files;do;setenv overlaystring ${overlaystring}'#'${overlay};done;
    idk_lcd=no
    importbootenv=echo Importing environment from mmc${mmcdev} ...; env import -t ${loadaddr} ${filesize}
    kernel_addr_r=0x82000000
    loadaddr=0x82000000
    loadbootenv=fatload mmc ${mmcdev} ${loadaddr} ${bootenvfile}
    loadbootscript=load mmc ${mmcdev} ${loadaddr} boot.scr
    loadfdt=load ${devtype} ${bootpart} ${fdtaddr} ${bootdir}/${fdtfile}
    loadfit=run args_mmc; run run_fit;
    loadimage=load ${devtype} ${bootpart} ${loadaddr} ${bootdir}/${bootfile}
    mmcboot=mmc dev ${mmcdev}; setenv devnum ${mmcdev}; setenv devtype mmc; if mmc rescan; then echo SD/MMC found on device ${mmcdev};if run loadimage; then if test ${boot_fit} -eq 1; then run loadfit; else run mmcloados;fi;fi;fi;
    mmcdev=0
    mmcloados=run args_mmc; if test ${boot_fdt} = yes || test ${boot_fdt} = try; then if run loadfdt; then bootz ${loadaddr} - ${fdtaddr}; else if test ${boot_fdt} = try; then bootz; else echo WARN: Cannot load the DT; fi; fi; else bootz; fi;
    mmcrootfstype=ext4 rootwait
    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; run netloadimage; run netloadfdt; run netargs; bootz ${loadaddr} - ${fdtaddr}
    netloadfdt=tftp ${fdtaddr} ${fdtfile}
    netloadimage=tftp ${loadaddr} ${bootfile}
    nfsopts=nolock
    partitions=uuid_disk=${uuid_gpt_disk};name=bootloader,start=384K,size=1792K,uuid=${uuid_gpt_bootloader};name=rootfs,start=2688K,size=-,uuid=${uuid_gpt_rootfs}
    partitions_android=uuid_disk=${uuid_gpt_disk};name=xloader,start=128K,size=256K,uuid=${uuid_gpt_xloader};name=bootloader,size=2048K,uuid=${uuid_gpt_bootloader};name=uboot-env,start=2432K,size=256K,uuid=${uuid_gpt_reserved};name=misc,size=128K,uuid=${uuid_gpt_misc};name=recovery,size=40M,uuid=${uuid_gpt_recovery};name=boot,size=10M,uuid=${uuid_gpt_boot};name=system,size=1024M,uuid=${uuid_gpt_system};name=vendor,size=256M,uuid=${uuid_gpt_vendor};name=userdata,size=-,uuid=${uuid_gpt_userdata}
    pxefile_addr_r=0x80100000
    ramdisk_addr_r=0x88080000
    rdaddr=0x88080000
    rootpath=/export/rootfs
    run_fit=bootm ${fit_loadaddr}#${fdtfile}${overlaystring}
    scriptaddr=0x80000000
    serial#=080100123a1602a2
    setconsole=if $board_name=am5729_beaglebonai;then setenv console ttyS0,115200; fi;fdtfile=undefined
    soc=omap5
    static_ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}::off
    stderr=serial@48422000
    stdin=serial@48422000
    stdout=serial@48422000
    update_to_fit=setenv loadaddr ${fit_loadaddr}; setenv bootfile ${fit_bootfile}
    usbtty=cdc_acm
    vendor=ti
    ver=U-Boot 2019.01-gc4ba0f3d3d-dirty (May 18 2020 - 13:44:32 -0700)
    vram=16M
    
    Environment size: 7606/131067 bytes

  • Hi David,

    We analyzed the eMMC boot traces. It seems like the very first command itself is failing on your 2019.01
    Based u-boot. We suspect basic voltage supply issues or some pinmuxing issues. Can you share
    the device tree files for u-boot based on 2019.01?

    Regards,
    Keerthy

  • Hey Keerthy, 

    Thanks for getting back to me! 

    I've attached u-boot device tree files, am57xx_evm_defconfig, and mux_data.h in <uboot>/board/ti/am57xx. 

    0066.device_tree.zip

  • Hi David,

    When you switch between u-boot versions, it's always better to reset environment settings from old u-boot.

    => env default -f -a
    => env save

    Could you also share the output of "part list mmc 1" command?


    Regards,
    Vishal

  • Hi all, 

    I've managed to resolve the issue. It looks like I didn't comment out reading the EEPROM when booting up in EMMC mode. Here are the changes I've made to get U-boot to work without an EEPROM on our custom board: 

    1.) Comment out all ti_i2c_eeprom_am_get() and and ti_emmc_boardid_get() in <uboot>/board/ti/am57xx/board.c around lines 512 and 536.  

    At this point, you should be able to get past the voltage error I posted above, but that's still not good enough because it's going to have troubles getting the device tree file need to boot the kernel. This was done using the EEPROM, so now we have to manually set it. 

    2.) Proceed to file <uboot>/include/configs/ti_omap5_common.h and remove the define DEFAULT_FDT_TI_ARGS as this flag is used to detect what device tree file to use in later uboot code. 

    3.) Navigate to <uboot>/include/environment/ti/boot.h and you'll see what I'm talking about for DEFAULT_FDT_TI_ARGS. Look in the define 

    DEFAULT_COMMON_BOOT_TI_ARGS, and you'll see a line for fdtfile="undefined\0". Replace that line with the device tree name that's in your linux kernel /boot directory you wish you use. Not to confuse it with the device trees you see in the uboot.
    For my particular case, I'm using the am57xx-beagle-x15.dtb so I have it as:  "fdtfile=am57xx-beagle-x15.dtb\0" \
    After making all these changes, I was able to boot into the linux kernel!