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.

AM62L-PROCESSOR-SDK: AM62L PG1.1 CPU emmc boot error

Part Number: AM62L-PROCESSOR-SDK
Other Parts Discussed in Thread: AM62L

Tool/software:

Hi,

I am using the AM62L PG1.1 CPU, and TF booting is normal, but emmc booting reports the following error.

The phenomenon is the same when verified on the uboot source code of SDK11.00.15.

  • Hi, could you please clarify the method followed for flashing the images to the eMMC?

  • Hi,

    I use a script in the ramdisk to flash images.

    #!/bin/sh 
    echo update start... > /dev/ttyS0
    
    SD_ROOTDIR=/mnt/sd
    echo none > /sys/class/leds/heartbeat/trigger
    
    check_return()
    {
    	if [ $@ -ne 0 ];then
    		echo build failed
    		exit $@
    	fi
    }
    
    starttime=`date +'%Y-%m-%d %H:%M:%S'`
    if [ ! -d ${SD_ROOTDIR} ]
    then
    	mkdir -p  ${SD_ROOTDIR}
    fi
    echo "wait for mount" > /dev/ttyS0
    echo "wait for mount"
    sleep 3
    if [ -b /dev/mmcblk1p1 ]
    then
    	mount /dev/mmcblk1p1 ${SD_ROOTDIR}
    elif [ -b /dev/sda1 ]
    then
    	mount /dev/sda1 ${SD_ROOTDIR}
    else
    	echo "-------------------------------------------------"
    	echo "The first partition of the sd card was not found." > /dev/ttyS0
    	echo "-------------------------------------------------"
    	exit
    fi
    
    echo "cd ${SD_ROOTDIR}..." > /dev/ttyS0
    cd ${SD_ROOTDIR}
    echo 1 > /sys/class/leds/heartbeat/brightness 
    
    
    
    
    dd if=/dev/zero of=/dev/mmcblk0 bs=1024 count=1024
    check_return $?
    
    # clear uboot env
    dd if=/dev/zero of=/dev/mmcblk0 bs=1 count=131072 seek=65536 conv=fsync
    check_return $?
    echo "flash emmc boot..." > /dev/ttyS0
    echo 0 > /sys/block/mmcblk0boot0/force_ro
    dd if=/dev/zero of=/dev/mmcblk0boot0 bs=1M count=4 conv=fsync > /dev/ttyS0
    
    dd if=${SD_ROOTDIR}/tiboot3.bin of=/dev/mmcblk0boot0 seek=0 bs=512 > /dev/ttyS0
    dd if=${SD_ROOTDIR}/tispl.bin of=/dev/mmcblk0boot0 seek=1024 bs=512 > /dev/ttyS0
    dd if=${SD_ROOTDIR}/u-boot.img of=/dev/mmcblk0boot0 seek=5120 bs=512 > /dev/ttyS0
    
    mmc bootpart enable 1 1 /dev/mmcblk0
    mmc bootbus set single_backward x1 x8 /dev/mmcblk0
    mmc hwreset enable /dev/mmcblk0
    mmc extcsd read /dev/mmcblk0 | grep BOOT_BUS_CONDITIONS > /dev/ttyS0
    mmc extcsd read /dev/mmcblk0 | grep PARTITION_CONFIG > /dev/ttyS0
    mmc extcsd read /dev/mmcblk0 | grep RST_N_FUNCTION > /dev/ttyS0
    echo 1 > /sys/block/mmcblk0boot0/force_ro
    #mmc bootpart enable 0 0 /dev/mmcblk0
    
    systems=`ls ${SD_ROOTDIR}/ok62lxx-linux-fs.sdcard.a*`
    check_return $?
    
    offsets=0
    echo "flashing kernel and rootfs wait..." > /dev/ttyS0
    echo "flashing kernel and rootfs wait..."
    for img in $systems
    do
    	echo "$img $offsets" > /dev/ttyS0
    	echo "$img $offsets"
        dd if=$img of=/dev/mmcblk0 bs=256M seek=$offsets
        if [ "$?" == "1" ] ; then
            echo "sd/emmc flash error" > /dev/ttyS0
            exit
        fi
        echo "flash $img, done"  > /dev/ttyS0
        echo "flash $img, done"
        offsets=$(($offsets+8))
    done
    sync
    echo ">>>>>>>>>>>>>> Flashing successfully completed <<<<<<<<<<<<<<" > /dev/ttyS0
    echo ">>>>>>>>>>>>>> Flashing successfully completed <<<<<<<<<<<<<<"
    
    /sbin/fdisk /dev/mmcblk0 << EOF
    t
    1
    c
    a
    1
    w
    EOF
    
    /sbin/fdisk /dev/mmcblk0 << EOF
    d
    2
    n
    p
    2
    172416
    
    w
    EOF

    I use the following script to package the images.

    set -e
    
    BURNING_IMG=ok62lxx-linux-fs.sdcard
    SDK_PATH=$1
    DESTDIR=$2
    
    FS_SIZE=$(du -s -k $DESTDIR | grep -o "^[0-9]*" | tail  -n 1)
    # uboot size 8*1024 KB
    rawsize=1024
    # boot partition 120 * 1024 KB
    fatsize=85184
    # rootfs partition
    ext4size=$(((($FS_SIZE) + $FS_SIZE / 8) & ~(32-1)))
    totalsize=`expr $rawsize + $fatsize + $ext4size + 1`
    echo totalsize $totalsize
    
    # pack boot
    if [ -e $SDK_PATH/images/boot.img ];then
    	rm $SDK_PATH/images/boot.img
    fi
    mkfs.vfat -n "Boot" -S 512 -C $SDK_PATH/images/boot.img $fatsize
    mcopy -i $SDK_PATH/images/boot.img $SDK_PATH/images/tiboot3.bin ::/tiboot3.bin
    mcopy -i $SDK_PATH/images/boot.img $SDK_PATH/images/tispl.bin ::/tispl.bin
    mcopy -i $SDK_PATH/images/boot.img $SDK_PATH/images/u-boot.img ::/u-boot.img
    
    # pack rootfs
    if [ -e $SDK_PATH/images/rootfs.ext4 ];then
    	rm $SDK_PATH/images/rootfs.ext4
    fi
    dd if=/dev/zero of=$SDK_PATH/images/rootfs.ext4 bs=1K count=0 seek=$ext4size
    #chown -h -R 0:0 $DESTDIR
    #find $DESTDIR -name .gitignore -exec rm {} \;
    mkfs.ext4 -F -i 4096 $SDK_PATH/images/rootfs.ext4 -d $DESTDIR
    fsck.ext4 -pvfD $SDK_PATH/images/rootfs.ext4
    
    # create burning image
    fatstart=$rawsize
    fatend=`expr $rawsize + $fatsize`
    ext4start=`expr $fatend`
    ext4end=`expr $fatend + $ext4size`
    echo ext4end $ext4end
    
    dd if=/dev/zero of=$SDK_PATH/images/$BURNING_IMG bs=1K count=0 seek=$totalsize
    parted -s $SDK_PATH/images/$BURNING_IMG mklabel msdos
    parted -s $SDK_PATH/images/$BURNING_IMG unit KiB mkpart primary fat32 $fatstart $fatend
    parted -s $SDK_PATH/images/$BURNING_IMG unit KiB mkpart primary $ext4start $ext4end
    parted $SDK_PATH/images/$BURNING_IMG unit B print
    
    # pack uboot kernel rootfs to burning img
    dd if=$SDK_PATH/images/boot.img of=$SDK_PATH/images/$BURNING_IMG bs=1K seek=$fatstart conv=notrunc,fsync
    dd if=$SDK_PATH/images/rootfs.ext4 of=$SDK_PATH/images/$BURNING_IMG bs=1K seek=$ext4start conv=notrunc,fsync
    split -b 2G $SDK_PATH/images/$BURNING_IMG $SDK_PATH/images/${BURNING_IMG}.
    rm -rf $SDK_PATH/images/boot.img
    rm -rf $SDK_PATH/images/rootfs.ext4
    rm -rf $SDK_PATH/images/$BURNING_IMG
    

  • Hello,

    The phenomenon is the same when verified on the uboot source code of SDK11.00.15.

    The currently available AM62L SDKs doesn't have the support for booting from the eMMC boot partitions. After the fixes in AM62L SR1.1, the support is recently added in the U-Boot.

    Please see the following response:

    https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1556647/am62l-emmc-boot-failure-in-reduced-pin-mode/6002719

    Please checkout the tag "11.01.12" as mentioned in this response and try booting.

    Thanks!