SD/MMC format for OMAP3 boot

From Texas Instruments Embedded Processors Wiki

< SD
Jump to: navigation, search
Translate this page to   

In order to create a bootable SD/MMC card under Linux compatible with OMAP3 boot ROM, you'd have to set a special geometry in the partition table, which is done through the fdisk "Expert mode". For Windows tooling see Procedure to boot with MMC/SD page.

First, lets clear the partition table:

# fdisk /dev/sdb

Command (m for help): o
Building a new DOS disklabel. Changes will remain in memory only,
until you decide to write them. After that, of course, the previous
content won't be recoverable.

Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

Print card info:

Command (m for help): p

Disk /dev/sdb: 128 MB, 128450560 bytes
....

Note card size in bytes. Needed later below.

Then go into "Expert mode":

Command (m for help): x

Now we want to set the geometry to 255 heads, 63 sectors and calculate the number of cylinders required for the particular SD/MMC card:

Expert command (m for help): h
Number of heads (1-256, default 4): 255

Expert command (m for help): s
Number of sectors (1-63, default 62): 63
Warning: setting sector offset for DOS compatiblity

Expert command (m for help): c
Number of cylinders (1-1048576, default 1011): 15

In this case 128MB card is used (reported as 128450560 bytes by fdisk above), thus 128450560 / 255 / 63 / 512 = 15.6 rounded down to 15 cylinders. Numbers there are 255 heads, 63 sectors, 512 bytes per sector.

Now, return to main mode and create a new partition:

Expert command (m for help): r

Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-15, default 1): 1
Last cylinder or +size or +sizeM or +sizeK (1-15, default 15): 15

Mark it bootable:

Command (m for help): a
Partition number (1-4): 1

And change its type to FAT32:

Command (m for help): t
Selected partition 1
Hex code (type L to list codes): c
Changed system type of partition 1 to c (W95 FAT32 (LBA))

The result is:

Command (m for help): p

Disk /dev/sdb: 128 MB, 128450560 bytes
255 heads, 63 sectors/track, 15 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *           1          15      120456    c  W95 FAT32 (LBA)

Now, really write configuration to card (until here, card is not changed):

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.

WARNING: If you have created or modified any DOS 6.x
partitions, please see the fdisk manual page for additional
information.
Syncing disks.

Done! What's left is to format our partition as FAT32 to be mounted and populated:

# mkfs.vfat -F 32 /dev/sdb1
mkfs.vfat 2.11 (12 Mar 2005)

Note: before running mkfs.vfat (included in the dosfstools package in Debian) make sure /dev/sdb is not mounted.

# mount /dev/sdb1 /mnt/tmp

Note: If you use additional mkfs.vfat parameter -n you can give the card a name, e.g. for easier identification (i.e. mkfs.vfat -n omap3 -F 32 /dev/sdb1)

The SD/MMC card is now ready to be used to boot OMAP3 boards.

sfdisk

In order to format same card using sfdisk, one needs to do the following:

# sfdisk -H 255 -S 63 -C 15 /dev/sdb << EOF
> ,,b,*
> EOF

And follow with the mkfs.vfat commands above.

E2e.jpg For technical support on OMAP please post your questions on The OMAP Forum. Please post only comments about the article SD/MMC format for OMAP3 boot here.
Hyperlink blue.png Links
ARM Microcontroller MCU ARM Processor Digital Media Processor Digital Signal Processing Microcontroller MCU Multi Core Processor
Ultra Low Power DSP 8 bit Microcontroller MCU 16 bit Microcontroller MCU 32 bit Microcontroller MCU

Leave a Comment

Comments

Comments on SD/MMC format for OMAP3 boot


Contents

PratheeshGangadhar said ...

I needed to make a FAT16 partition to make it boot, FAT32 simply does not boot...

And change its type to FAT16: Command (m for help): t Selected partition 1 Hex code (type L to list codes): e Changed system type of partition 1 to e (W95 FAT16 (LBA))

mkfs.vfat -F 16 /dev/sdb1 : FAT16 partition instead works fine


--PratheeshGangadhar 17:26, 28 April 2009 (UTC)

Gwlund said ...

For other linux hosts (like Ubuntu and Slackware) use #mkdosfs -F 16 /dev/sdb1 to format your patition. Thanks Pratheesh for the tip about using FAT16

--Gwlund 21:51, 10 June 2010 (CDT)

RunDown said ...

Also seems card dependent. For my 256MB card option e worked (W95 FAT16 (LBA)) per Pratheesh's comment. It did not work for a 2GB card. Option 6 (FAT16) had to be selected for that to boot. In no cases did FAT32 work with an OMAP EVM board. FAT32 works fine on a beagle board. Frustrating that the documentation is wrong on this.

--RunDown 12:57, 26 August 2010 (CDT)

Pairspace said ...

After too much time spent seeking the magic incantation for different cards, this OpenEmbedded script was found to be reliable:

http://cgit.openembedded.org/cgit.cgi/openembedded/plain/contrib/angstrom/omap3-mkcard.sh

(via http://www.xora.org.uk/2009/08/14/omap3-sd-booting/ )

--Pairspace 22:15, 18 March 2011 (CDT)

Personal tools
Namespaces
Variants
Actions
Navigation
Print/export
Toolbox