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.

AM335x can't boot from SD card after I changed the size of SD card boot partition

I have changed mk3PartSDCard.sh in the sdk.

#! /bin/sh
# mk3PartSDCard.sh v0.3
# Licensed under terms of GPLv2
DRIVE=$1
dd if=/dev/zero of=$DRIVE bs=1024 count=1024
SIZE=`fdisk -l $DRIVE | grep Disk | awk '{print $5}'`
echo DISK SIZE - $SIZE bytes
CYLINDERS=`echo $SIZE/255/63/512 | bc`
sfdisk -D -H 255 -S 63 -C $CYLINDERS $DRIVE << EOF
,10,0x0C,*
11,115,,-
127,,,-
EOF
mkfs.vfat -F 32 -n "boot" ${DRIVE}1
umount ${DRIVE}1
mkfs.ext3 -L "rootfs" ${DRIVE}2
umount ${DRIVE}2
mkfs.ext3 -L "START_HERE" ${DRIVE}3

then ,sd crad boot partition has been changed from 74mb to 82mb.

when I used the sd card to boot my AM335x EVM I got 'ccccccccc' from the terminal.

Is this means I can,t changed the size of sd card partition?

If the size can be changed how to do it.

  • Hi,

    I don't think the ROM code expects the boot partition to always be 9 cylinders in size. I guess the ROM code first reads the partition descriptors in the MBR and then knows what to expect regarding the sizes of the different partitions.

    I don't really think this is causing the problem, but keep in mind that the "sfdisk" command is totally capable of calculating the "start" field of the next partition, so you don't need to specify it as this is error prone.

    I checked your script code and I couldn't find any mistakes, but I may have missed something, so please check this guide, where you will find a complete script to format/partition your SD card for OMAP based devices: http://omappedia.org/wiki/Minimal-FS_SD_Configuration

    Also, since you mentioned you are using the AM335x EVM, can you please double check your SYSBOOT pins configuration? The correct SYSBOOT configuration for SD card boot is shown here: http://processors.wiki.ti.com/index.php/AM335x_U-Boot_User%27s_Guide#SD Please also note that the SYSBOOT switches on the AM335x EVM are marked wrong. ON is on the wrong side of the switch.

    Best regards,
    Miroslav

  • I've created a number of different SD cards with different sized partitions and been able to boot from them. Certainly the size of the card or the size of the partition has not been a factor in my experience. However, I've certainly seen that the ROM bootloader is very finicky about exactly how the card is formatted & partioned. So it's quite possible when you resize the partition, the resulting new partition has some characteristic the ROM bootloader no longer likes.

  • I ran into this problem as well using a different tool that runs on Mac OS X.  It appears the total partition sector count that you use for the boot partition needs to be divisible by 63.  If you keep that in mind it appears you can change the boot partition size to different values.

  • The fdisk in Ubuntu 10.04 LTS has some issues formatting SD cards.  The fdisk in Ubuntu 12 is much better.

    You can also use TI_SDCard_boot_utility.exe from the StarterWare when formatting on a Win PC.