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.

MLO is not booting from eMMC

Other Parts Discussed in Thread: AM3356

Hi,

We are using eMMC (4GB) connected on MMC0 port of AM3356. 

SDK version : ti-processor-sdk-linux-am335x-evm-01.00.00.00 and  Kernel : 3.14.26.

I am using following link for flashing eMMC for two partition.

http://processors.wiki.ti.com/index.php/Sitara_Uniflash_Flash_Programming_with_Linux

It was flashing properly and working fine with two partitions on MMC0 port.

Now I have changed script to make 9 partitions (custom requirement) and copied every thing in place (MLO, UBOOT , KERNEL and dtb files to boot partition (1st partition)). 

 But when I try to boot from eMMC it shows CCCCCC means RBL could not find MLO. Although MLO is copied to BOOT partition and it was verified multiple times. (eMMC is connected on same MMC0 port.)

My assumption is that MBR is not created  properly, so that it can not find MLO from partition.

I am using following script to make partition, please find the commands :

device="/dev/mmcblk0"

dd if=/dev/zero of=$device bs=1024 count=1024

# get the partition information.
total_size=`fdisk -l $device | grep Disk | awk '{print $5}'`
total_cyln=`echo $total_size/255/63/512 | bc`

# start of BOOT partition
pc1_start=63
pc1_end=9

# start of ROOTFS partition
pc2_start=$(($pc1_start + $pc1_end))
pc2_end=50

# start of BOOT_BACKUP partition
pc3_start=$(($pc2_start + pc2_end))
pc3_end=10

# start of ROOTFS_BACKUP partition
pc4_start=$(($pc3_start + $pc3_end))
pc4_end=50

# start of CONFIG partition
pc5_start=$(($pc4_start + pc4_end))
pc5_end=3

# start of CONFIG_BACKUP partition
pc6_start=$(($pc5_start + pc5_end))
pc6_end=3

# start of LOG partition
pc7_start=$(($pc6_start + pc6_end))
pc7_end=10

# start of DATA partition
pc8_start=$(($pc7_start + pc7_end))

sfdisk -D -H 255 -S 63 -C $total_cyln $device << EOF
$pc1_start,$pc1_end,0x0C,*
$pc2_start,$pc2_end,L
$pc3_start,$pc3_end,L
$pc4_start,,E
$pc4_start,$pc4_end,L
$pc5_start,$pc5_end,L
$pc6_start,$pc6_end,L
$pc7_start,$pc7_end,L
,,L
EOF

if [ $? -ne 0 ]; then
echo ERROR
exit 1;
fi

echo "Formating ${device}p1 ..."
mkfs.vfat -F 32 -n "BOOT" ${device}p1
echo "Formating ${device}p2 ..."
mkfs.ext4 -j -L "ROOTFS" ${device}p2
echo "Formating ${device}p3 ..."
mkfs.vfat -F 32 -n "BOOT_BACKUP" ${device}p3
echo "Formating ${device}p5 ..."
mkfs.ext4 -j -L "ROOTFS_BACKUP" ${device}p5
echo "Formating ${device}p6 ..."
mkfs.ext4 -j -L "CONFIG" ${device}p6
echo "Formating ${device}p7 ..."
mkfs.ext4 -j -L "CONFIG_BACKUP" ${device}p7
echo "Formating ${device}p8 ..."
mkfs.ext4 -j -L "LOG" ${device}p8
echo "Formating ${device}p9 ..."
mkfs.ext4 -j -L "DATA" ${device}p9

We are using filesystem provided from above eMMC flashing link.

Version used for sfdisk and fdisk is util-linux 2.21.2.

What we are missing? Need to add/change any more commands or need any other support in Kernel?

Note : Observation is  when we run same script from Ubuntu 14.04, its flashing eMMC properly and eMMC is working fine on same MMC0 port.

Please guide us.

Thanks in advance.

  • Hi,

    I will forward this to the Linux team.
  • Hi,

    Are you using the correct target configuration, when you build your u-boot? Refer to:
    processors.wiki.ti.com/.../Sitara_Uniflash_Flash_Programming_with_Linux

    I'd recommend using a custom build & not the prebuilt images in the Sitara SDK.

    Best Regards,
    Yordan
  • Hi Yordan,

    We are using custom MLO and U-boot with correct target configuration. As mentioned in NOTE it works fine when we flash it from ubuntu 14.04 machine.

    So, there is not problem of MLO and u-boot images.

    Thanks,

    Nilesh

  • Hello Nilesh,

    The start point passed by the sfdisk should be 0, so change your code respectively.

    sfdisk -D -H 255 -S 63 -C $total_cyln $device << EOF
    0,$pc1_end,0x0C,*
    $pc2_start,$pc2_end,L

    Best regards,
    Kemal

  • Hi Kemal,

    Thanks for your reply.

    I tried your mentioned thing (putting 0  at start point) but it still not works and it shows  CCCCCC on console. Same thing works well when i flash eMMC through PC.

    Please help me.

    Regards,

    Nilesh

  • Could you post the output of these two commands sfdisk -l and fdisk -l ?

  • Hi Kemal,

    My output are as below.

    ---------------------------------------------------------------------------------------------
    root@am335x-evm:/# sfdisk -l

    Disk /dev/mmcblk0: 116736 cylinders, 4 heads, 16 sectors/track
    sfdisk: Warning: extended partition does not start at a cylinder boundary.
    DOS and Linux will interpret the contents differently.

    sfdisk: Warning: The partition table looks like it was made
    for C/H/S=*/255/63 (instead of 116736/4/16).
    For this listing I'll assume that geometry.

    Units = cylinders of 8225280 bytes, blocks of 1024 bytes, counting from 0

    Device Boot Start End #cyls #blocks Id System
    /dev/mmcblk0p1 * 0+ 2 3- 24066 c W95 FAT32 (LBA)
    /dev/mmcblk0p2 3 27 25 200812+ 83 Linux
    /dev/mmcblk0p3 28 30 3 24097+ 83 Linux
    /dev/mmcblk0p4 31 464 434 3486105 5 Extended
    /dev/mmcblk0p5 31+ 55 25- 200781 83 Linux
    /dev/mmcblk0p6 56+ 58 3- 24066 83 Linux
    /dev/mmcblk0p7 59+ 61 3- 24066 83 Linux
    /dev/mmcblk0p8 62+ 71 10- 80293+ 83 Linux
    /dev/mmcblk0p9 72+ 464 393- 3156741 83 Linux

    Disk /dev/mmcblk0boot1: 128 cylinders, 4 heads, 16 sectors/track

    sfdisk: ERROR: sector 0 does not have an msdos signature
    sfdisk: /dev/mmcblk0boot1: unrecognized partition table type

    sfdisk: No partitions found


    Disk /dev/mmcblk0boot0: 128 cylinders, 4 heads, 16 sectors/track

    sfdisk: ERROR: sector 0 does not have an msdos signature
    sfdisk: /dev/mmcblk0boot0: unrecognized partition table type

    sfdisk: No partitions found

    ---------------------------------------------------------------------------------------------

    root@am335x-evm:/# fdisk -l

    Disk /dev/mmcblk0: 3825 MB, 3825205248 bytes
    255 heads, 63 sectors/track, 465 cylinders, total 7471104 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disk identifier: 0x00000000

    Device Boot Start End Blocks Id System
    /dev/mmcblk0p1 * 63 48194 24066 c W95 FAT32 (LBA)
    /dev/mmcblk0p2 48195 449819 200812+ 83 Linux
    /dev/mmcblk0p3 449820 498014 24097+ 83 Linux
    /dev/mmcblk0p4 498015 7470224 3486105 5 Extended
    /dev/mmcblk0p5 498078 899639 200781 83 Linux
    /dev/mmcblk0p6 899703 947834 24066 83 Linux
    /dev/mmcblk0p7 947898 996029 24066 83 Linux
    /dev/mmcblk0p8 996093 1156679 80293+ 83 Linux
    /dev/mmcblk0p9 1156743 7470224 3156741 83 Linux

    Disk /dev/mmcblk0boot1: 4 MB, 4194304 bytes
    4 heads, 16 sectors/track, 128 cylinders, total 8192 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes


    Disk /dev/mmcblk0boot0: 4 MB, 4194304 bytes
    4 heads, 16 sectors/track, 128 cylinders, total 8192 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes

    root@am335x-evm:/#

    ---------------------------------------------------------------------------------------------

    Previously i was used starting sector 63. Now as per your suggestion i changed it to 0. But still in fdisk -l it shows 63. Also i have formated eMMC before changing starting point from 63 to 0.

    Please give your inputs.

    Thanks,
    Nilesh
  • nilesh kadivar said:

    Device Boot Start End #cyls #blocks Id System
    /dev/mmcblk0p1 * 0+ 2 3- 24066 c W95 FAT32 (LBA)
    /dev/mmcblk0p2 3 27 25 200812+ 83 Linux



    Here the #cyls value should be 9, check how sfdisk treats the $pc1_end.

  • Hi Kemal,

    Thanks for your reply.

    As per your suggestion by changing #cyls to 9 with $pc1_start=0 and $pc1_end=9 it is working.                                                                                             


    However eMMC flashing through AM335x USB slave mode for  #cyls to 9 with $pc1_start=63 and $pc1_end=9 is not working. While the same eMMC flashing through PC is working ($pc1_start=63 and $pc1_end=9).


    Finally as per experiment one upto this below things comes into picture.

    $pc1_start=63 and $pc1_end=9 (eMMC flashing through PC working
                                  eMMC flashing through AM335x not working)

    $pc1_start=0 and $pc1_end=3 (eMMC flashing through PC working
                                  eMMC flashing through AM335x not working)

    $pc1_start=0 and $pc1_end=9 (eMMC flashing through PC working
                                  eMMC flashing through AM335x working)

    Can you please help us on this?


    Regards,

    Nilesh

  • Hi Nilesh,

    I am not sure what can cause this, but it may be due to the difference in the system shell bash/sh which may interpret the commands/variables differently, difference in the version or configuration of sfdisk/fdisk is also a variant.

    Best regards,
    Kemal