| Preparing a bootable SD/microSD card |
|
|
|
|
These instructions assume you are using a Linux development machine. The example below will show the steps for setting up a brand new card. We will be creating 2 partitions on the card: a FAT partition that will contain the bootloaders and Linux kernel, and an ext3 partition that will contain the root file system. Getting started
First insert your card into your development machine's flash card slot. If using a microSD card you may need to use a microSD to SD card adaptor to fit your slot.
On my Ubuntu machine, the newly inserted card shows up as /dev/sde and that is the device name that will be used through this example. You should substitute the proper device name for your machine. You can use 'mount' or 'df' to see where the card mounts on your machine. Let's unmount the device's existing file system before we get started with the process: $ sudo umount /dev/sde1 If you are the type who likes to understand exactly what is going on, you can follow the manual process below. If you just want to get the job done, you can use a script that automates this process. See the article entitled A script for partitioning/formatting a bootable SD/miroSD card, and then return to the INSTALLING THE BOOT FILES section below. Partitioning the cardNow launch fdisk and create an empty partition table. Note that the argument for fdisk is the entire device (/dev/sde) not just a single partition (i.e. /dev/sde1): # sudo fdisk /dev/sde Let's first look at the current card information: Command (m for help): p Note the card size in bytes. We will needed it later in the process. In order to create a bootable SD/microSD compatible with the OMAP3 boot ROM you must set a special geometry using the fdisk "Expert mode". To go into "Expert" mode use the "x" command: Command (m for help): x Next we will set the geometry to 255 heads, 63 sectors and a calculated value for the number of cylinders required for the particular microSD card. To calculate the number of cylinders, we take the 2032664576 bytes reported above by fdisk divided by 255 heads, 63 sectors and 512 bytes per sector: 2032664576 / 255 / 63 / 512 = 247.12 which we round down to 247 cylinders. Expert command (m for help): h Return to fdisk's main mode and create a new partition 32 MB FAT partition: Expert command (m for help): r Change the partition type to FAT32: Command (m for help): t And mark it bootable: Command (m for help): a Next we create an ext3 partition for the rootfs: Command (m for help): n To verify our work, lets print the partition info: Command (m for help): p Up to this point no changes have been made to the card itself, so our final step is to write the new partition table to the card and then exit: Command (m for help): w Formatting the new partitionsWe format the first partition as a FAT file system (the -n parameter gives it a label of FAT, you can change or omit this if you like): # sudo mkfs.vfat -F 32 /dev/sde1 -n FAT We format the second partition as an ext3 file system: $ sudo mkfs.ext3 /dev/sde2 Installing the boot filesThis instructions below will assume that:
There are three files required on the first (FAT) partition to boot your OMAP3 processor:
It is important that these three files have precisely these names. Mount the FAT partition of your microSD card. This example will assume that you have mounted it at /media/card: sudo mount /dev/sde1 /media/card Due to constraints of the mask boot ROM in the OMAP processor, MLO should be written first: $ sudo cp ~/Desktop/MLO-overo /media/card/MLO Then copy u-boot and the linux kernel to the card: $ sudo cp ~/Desktop/u-boot-overo.bin /media/card/u-boot.bin You can now unmount the FAT partition: $ sudo umount /dev/sde1 At this point you have a bootable FAT partition. Installing the Root file system
The final step is to untar your rootfs onto the ext3 partition that you created above. Note that this step can be dangerous. You do not want to untar your OMAP3 rootfs onto the root of your development machine file system. Be careful! $ sudo mount /dev/sde2 /media/card Now untar your rootfs: $ cd /media/card You can now unmount the ext3 partition: $ sudo umount /dev/sde2 It is now safe to remove the SD/microSD card from your development machines card slot. Insert the card in your OMAP3 machine and press the reset button (on Beagle be sure to hold down the User button when pressing and releasing the reset button in order to ensure that the Beagle boots from the SD card) After a short while you will see a login screen. Login as user root with password root. If you desire, you can then use the System/Administration/Users and Groups menu item to create a normal user.Have fun exploring! To change your display resolution see the article Changing the display resolution. But please read the section below first! A few words about the U-boot environment partitionIt is recommended that you erase the u-boot environment partition every time you install a new version of u-boot. This will cause u-boot to use its default environment. The images on this site are always matched sets - the u-boot default enviroment will be appropriate for the kernel and rootfs in the set. You should only change the default u-boot environment if you know what you are doing. You shouldn't normally need to change this default unless you want to use a different display resolution than the default 1024x768. To erase the u-boot environment partition, press any key during the boot sequence when u-boot prints the following message: Hit any key to stop autoboot: Then, at the command prompt for Overo type: Overo # nand erase 240000 20000 For Beagle, type: OMAP3 beagleboard.org # nand erase 260000 20000 Your machine will now reboot and you will see confirmation thas you have successfully erased the environment partition whe u-boot prints the following message: *** Warning - bad CRC or NAND, using default environment |
| Last Updated on Tuesday, 08 December 2009 12:19 |
0 Comments