You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 6 Next »

The Linux commands listed in this section will only work correctly if Linux is booted from SD card.

The board Development Kit is delivered with a pre-flashed bootloader. The following instructions for flashing images from SD card will be useful if you want to:

  • Flash images because eMMC is empty
  • Upgrade to a new release
  • Use custom built images

The images to be flashed will need to be copied to the /boot  or /rootfs/boot/ partition of a properly formatted SD card as described in the Creating a Bootable SD Card section of the Quickstart.

Partition eMMC from U-boot

Write a GPT partition table to eMMC. Create UUIDs for the disk and each partition by executing the following on the host machine:

uuidgen
<first UUID generated>


uuidgen
<second UUID generated>


uuidgen
<third UUID generated>


After making all required connections, power on the board and enter U-Boot. Set the UUIDs for the disk and rootfs to the generated values:

U-Boot # setenv uuid_gpt_disk <first UUID>
U-Boot # setenv uuid_gpt_rootfs <second UUID>
U-Boot # setenv uuid_gpt_env <third UUID>
U-Boot # gpt write mmc 1 ${partitions}
U-Boot # reset


The partition gpt partition will be visible after a reset. (Note that mmc0 corresponds with the SD card slot interface, while mmc1 corresponds with eMMC):

U-Boot # mmc dev 1
U-Boot # mmc part

 

Partition eMMC from Linux

Boot into Linux from the SD card, then use fdisk with the following options to write a new GPT partition table to eMMC:

fdisk /dev/mmcblk1
	g        GPT partition table
	n        new partition
	1        partition number
	2048     first sector
	4096     last sector
	n        new partition
	2        partition number
	6144     first sector
	<enter>  use default value
	w        write table to disk and exit
partprobe

Flash U-Boot

From U-Boot

Copy the MLO and u-boot.img from the /boot partition of the SD card (connector X2, mmc0 in U-Boot) to eMMC (mmc1 in U-Boot):

U-Boot # mmc dev 0
U-Boot # mmc rescan
U-Boot # mmc dev 1


U-Boot # fatload mmc 0 ${loadaddr} MLO
U-Boot # mmc write ${loadaddr} 0x100 0x100
U-Boot # mmc write ${loadaddr} 0x200 0x100


U-Boot # fatload mmc 0 ${loadaddr} u-boot.img
U-Boot # mmc write ${loadaddr} 0x300 0x400

From Linux

Boot into Linux from the SD card and run the following commands to copy MLO and u-boot.img to eMMC:

dd if=/run/media/mmcblk0p1/MLO of=/dev/mmcblk1 seek=256 count=256
dd if=/run/media/mmcblk0p1/MLO of=/dev/mmcblk1 seek=512 count=256
dd if=/run/media/mmcblk0p1/u-boot.img of=/dev/mmcblk1 seek=768 count=1024

Root Filesystem

If rootfs.ext4 is larger than the size of the DDR3, it can only be flashed in Linux. The default rootfs.ext4 for BSP-Yocto-TISDK-AM57xx-PD18.2.0 is larger than the default DDR3 size (2GB).

The rootfs.ext4 image is not loaded to the card by default. Copy it to the root of the rootfs partition on the SD card.

Linux

Boot into Linux from the SD card, then copy the root filesystem to eMMC:

dd if=/rootfs.ext4 of=/dev/mmcblk1p2 bs=1M

U-Boot

This assumes the SD card was created with TI's create-sdcard.sh script. If the SD card is formatted differently, the ext4load command may need to be replaced by fatload.

Copy the root filesystem from the /rootfs partition of the SD card (connector X2, mmc0 in U-Boot) to eMMC (mmc1 in U-boot):

U-boot # mmc dev 1
U-boot # ext4load mmc 0:2 ${loadaddr} rootfs.ext4
U-boot # mmc write ${loadaddr} 0x1800 [rootfs.ext4 size in bytes divided by 512, in hex]
  • No labels