Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Configure SD Card for Flashing

The images to be flashed SD card image "fsl-image-gui-imx7d-phyboard-zeta.sdcard" can be flashed to eMMC. This image will need to be copied to the /Boot imx7-p/boot partition of a properly formatted SD card as described in the Creating a Bootable SD Card section of the Quickstart. Additionally, the root filesystem fsl-image-gui-imx7d-phyboard-zeta.ext4 image and u-boot.imx will need to be copied over to the SD card.

Copy u-boot.imx to the boot partition of the SD card: 

 

Warning

Due to the UUIDs of the partitions in the sdcard image, it is recommended that you manually format the SD card if you plan on using it after flashing the image to eMMC, otherwise mmcblk0p1 and mmcblk1p1 as well as mmcblk0p2 and mmcblk1p2 will have the same UUID.

 

...

  1. Due to the size of the root file system image, a new partition is required on the SD card to hold it. To create an additional partition that extends to the rest of the SD card, execute the following from your host machine:

    Code Block
    sudo fdisk /dev/sd<X>
    
    		p			print partition table. *Note end of partition /dev/sd<x>2* 	
    		n 			new partition
    		p 			primary
    		3 			partition number
    		1581056		(start at<start> 	enter value after end of partition 2 (from partition table). This is the first sector of partition 3
    		<enter>		Use default value for last sector
    		t			Change partition system id
    		3			Partition number
    		c 			FAT32
    		w			write table to disk and exit
    
    sudo mkfs.vfat -n "data" /dev/sd<X>3
  2. Copy the root file system sdcard image to the new "data" partition:

    Code Block
    cp fsl-image-gui-imx7d-phyboard-zeta.ext4sdcard /media/data/; sync

Partition eMMC from

...

U-Boot

  1. Configure the boot switch to boot from SD Card as described in Selecting Boot Modes. Power on the board and boot fully into Linux.
  2. Format eMMC (mmcblk2):

    Code Block
    fdisk /dev/mmcblk2	
    	u 		Change display/entry units to sectors instead of cylinders
    	o 		Create a new empty DOS partition table
    
    	n 		Create new partition
    	p 		Create a primary partition
    	1 		partition number 1
    	4096 	First sector 
    	20479	Last sector
    
    	n		Create new partition
    	p		Create a primary partition
    	2		Partition number 2
    	20480	First sector
    	<enter> Using the default value will create a partition that extends to the last sector of the media
    
    	w		write partition table to eMMC and exit fdisk
    
    mkfs.vfat /dev/mmcblk2p1

U-Boot

Flash u-boot to eMMC. The i.MX7 expects an Image Vector Table offset of 0x400 bytes for SD boot device type.

Code Block
dd if=/run/media/mmcblk0p1/u-boot.imx of=/dev/mmcblk2 bs=512 seek=2

Linux/DTB

Copy the kernel and device tree file to eMMC:

Code Block
# The eMMC partitions will mount to /run/media/ on boot. If you just partitioned eMMC, you may manually mount the partition:
mkdir /run/media/mmcblk2p1
mount /dev/mmcblk2p1 /run/media/mmcblk2p1
 
cp /run/media/mmcblk0p1/zImage /run/media/mmcblk2p1/
cp /run/media/mmcblk0p1/imx7d-phyboard-zeta.dtb /run/media/mmcblk2p1/

Root Filesystem

Flash the root filesystem to eMMC, partition 2.

  1. stop in U-Boot.
  2. Flash fsl-image-gui-imx7d-phyboard-zeta.sdcard from the SD card to eMMC. This will partition the card and copy u-boot, zImage, dtb, and root filesystem to eMMC.

    Code Block
    => fatload mmc 0:3 ${loadaddr} fsl-image-gui-imx7d-phyboard-zeta.sdcard
    reading fsl-image-gui-imx7d-phyboard-zeta.sdcard
    935329792 bytes read in 41164 ms (21.7 MiB/s)
    
    => mmc dev 1
    switch to partitions #0, OK
    mmc1(part 0) is current device
    => mmc write ${loadaddr} 0x0 <number of blocks to write. In this case 0x1BF000>
    
    MMC write: dev # 1, block # 0, count 1830912 ... 1830912 blocks written: OK
    
    

     

     

  3. Reset the board. Stop in U-Boot again and check that the partition table for eMMC is as expected.

    Code Block
    => reset
     
    ...
     
    => mmc dev 1
    switch to partitions #0, OK
    mmc1(part 0) is current device
    => mmc part
    
    Partition Map for MMC device 1  --   Partition Type: DOS
    
    Part    Start Sector    Num Sectors     UUID            Type
      1     8192            16384           ef3963c1-01     0c
      2     24576           1794048         ef3963c1-02     83
    
    
Info

To flash u-boot individually to eMMC, execute the following:

=> fatload mmc 0:1 ${loadaddr} u-boot.imx

=> mmc dev 1

=> mmc write ${loadaddr} 0x2 <u-boot image size in blocks>

Code Block
dd if=/run/media/mmcblk0p3/fsl-image-gui-imx7d-phyboard-zeta.ext4 of=/dev/mmcblk2p2 bs=1M