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

Compare with Current View Page History

« Previous Version 12 Current »

The phyBOARD-Zeta 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

Note that the names of the images differ between releases. YOCTO_IMAGE in the instructions below refers to the Yocto image name that was used to build the image, and YOCTO_MACHINE refers to the machine that was selected to build the image. Refer to the "Built Images" section of the Quickstart pertaining to the specific release you are using for clarification on image names.

Pre-built images are available on PHYTEC's Artifactory.

Configure SD Card for Flashing

The SD card image "<YOCTO_IMAGE>-<YOCTO MACHINE>.sdcard" can be flashed to eMMC. This image will need to be copied to the boot partition of a properly formatted SD card as described in Create a Bootable SD Card

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 if using the sdcard image for both eMMC and SD, mmcblk0p1 and mmcblk1p1 as well as mmcblk0p2 and mmcblk1p2 will have the same UUID.


  1. Due to the size of the 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:

    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
    		<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 sdcard image to the new "data" partition:

    cp <YOCTO_IMAGE>-<YOCTO MACHINE>.sdcard /media/user/data/; sync

Option 1: Flash eMMC from Linux

  1. Configure the boot switch to boot from SD Card as described in i.MX7 Boot Configurations. Power on the board and boot into Linux.
  2. Flash <YOCTO_IMAGE>-<YOCTO MACHINE>.sdcard from the SD card to eMMC. This will partition the card and copy U-Boot, zImage, dtb, and root filesystem to eMMC.

    Umount existing partitions (if any) and write the image to flash.

    umount /run/media/mmcblk2p*
    dd if=/run/media/mmcblk0p3/<YOCTO_IMAGE>-<YOCTO MACHINE>.sdcard of=/dev/mmcblk2 bs=1MB; sync

Option 2: Flash eMMC from U-Boot

The default <YOCTO_IMAGE>-<YOCTO MACHINE>.sdcard image is larger than the DDR3 so cannot be loaded into memory from U-Boot. Use Option 1 for flashing eMMC.


  1. Configure the boot switch to boot from SD Card as described in i.MX7 Boot Configurations. Power on the board and stop in U-Boot.

  2. Flash <YOCTO_IMAGE>-<YOCTO MACHINE>.sdcard from the SD card to eMMC. This will partition the card and copy U-Boot, zImage, dtb, and root filesystem to eMMC.

    => fatload mmc 0:3 ${loadaddr} <YOCTO_IMAGE>-<YOCTO MACHINE>.sdcard
    reading <YOCTO_IMAGE>-<YOCTO MACHINE>.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.

    => 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

Updating Individual Images

U-Boot

Flash U-Boot to eMMC. The i.MX7 expects an Image Vector Table offset of 0x400 bytes for SD/MMC boot device type. Type the following in U-Boot (alternatively, use dd command in Linux):

fatload mmc 0:1 ${loadaddr} u-boot.imx
mmc dev 1
mmc write ${loadaddr} 0x2 <u-boot image size in blocks>

Linux/DTB

From Linux, copy the kernel and device tree file to eMMC:

# 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/; sync
cp /run/media/mmcblk0p1/zImage-<YOCTO_MACHINE>.dtb /run/media/mmcblk2p1/oftree; sync

Root Filesystem

From Linux, flash the root filesystem to eMMC, partition 2.

dd if=/run/media/mmcblk0p3/<YOCTO_IMAGE>-<YOCTO MACHINE>.ext4 of=/dev/mmcblk2p2 bs=1M

Boot Options in U-Boot

The target can be booted from on-board media. In our standard configuration, this BSP release loads the kernel and root filesystem from MMC if an SD card is inserted in the micro SD card slot. If no SD card is present, it will boot from eMMC.

Stand Alone SD/MMC Card Boot

This is the default boot configuration. Simply type the following:

boot 

Stand-Alone eMMC Boot

By default, the U-Boot environment is configured to autodetect which mmc interface U-boot was booted from (See i.MX7: Boot Configurations) and boot the kernel and root file system from the same device. However, if you would like to boot Linux from eMMC regardless of the boot source for U-Boot, then disable auto-detection and set the mmc boot device to mmc1 by modifying the environment as follows:

=> setenv mmcautodetect no
=> setenv mmcdev 1
=> saveenv

Reset the board and let it boot fully into Linux, or use the "boot" command within U-boot:

=> boot



  • No labels