This guide explains how to create a bootable SD card for the phyCORE-i.MX7 Development Kit using Linux. You will need the following to complete these instructions:

  • SDHC SD card, at least 4GB for PHYTEC's TISDK release images
  • Linux Host PC or Virtual Machine
    • Ubuntu 16.04 LTS recommended
    • SD card reader

Creating a bootable SD card requires an SD card reader operational under Linux to format and access the Linux partition of the card. If you do not have SD card access under Linux then copying the bootloader and mounting the root filesystem on SD/MMC card will not be possible.

Pre-built images are available on PHYTEC's Artifactory. If you have built your own images, then the images are located in buld directory here: $YOCTO_DIR/build/tmp/deploy/images/<YOCTO_MACHINE>/ 

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.

Boot switches on phyBOARD-Zeta will have to be set in order to specify the location of the primary bootloader. See this link for more details (Boot Switch).

Flashing a Complete Image:

  1. Download the "fsl-image-validation-imx-<Yocto Machine>.sdcard" image to your Host Machine. This will be used to format a bootable SD card. The binary images for BSP-Yocto-FSL-iMX7-PD19.1.x can be found at PHYTEC's Artifactory.
  2. Determine the SD card device name
    1. The SD card device name is of the form /dev/sdX where X is either the letter b, c, d or e. Run the following without and with the SD card connected to your host machine to determine what name is being assigned to the card. 

      Host (Ubuntu)

      ls /dev/sd*
      CODE
    2. Remember the name of the device that appears when the SD card is plugged in.

  3. Unmount all partitions of the SD card, using the SD card device name from Step 1 (replace the 'X' with the correct letter):  

    Host (Ubuntu)

    umount /dev/sdX*
    CODE
  4. Load the SD card image onto the SD card from the linux command line. This will format the appropriate partitions, as well as add U-Boot, the kernel image, and the root filesystem to the card.

    1. From the directory that contains the '.sdcard.bz2' file, execute the following command by replacing '<YOCTO_IMAGE>-<YOCTO_MACHINE>.sdcard' with the name of file and the letter 'X' with the correct letter found in step 1: 

      Host (Ubuntu)

      bzip2 -dc <YOCTO_IMAGE>-<YOCTO_MACHINE>.sdcard.bz2 | sudo dd of=/dev/sdX bs=1MB && sync
      CODE
  5. Unmount the partitions and remove the SD card 

    Host (Ubuntu)

    umount /media/<user>/boot /media/<user>/rootfs
    CODE
  6. You SD card should now be ready to boot your hardware into Linux.

Updating Individual Parts of an Image:

Once the SD card has been formatted, you can update the kernel, root filesystem, and u-boot individually as well:

 Click here to expand...

Kernel

 Click here to expand...
  1. If modifying the kernel, remove the existing zImage and device tree binary files (replace '<user>' in the file path accordingly): 

    Host (Ubuntu)

    rm /media/<user>/Boot\ imx7d-/zImage && rm /media/<user>/Boot\ imx7d-/oftree
    CODE
  2. Load the new Linux kernel and device tree binary to the SD Card. By default u-boot loads the file named "oftree" as the DTB, so make sure to rename the device tree that you intend to use: 

    Host (Ubuntu)

    cp zImage /media/<user>/Boot\ imx7d-/; sync
    cp zImage-<YOCTO_MACHINE>.dtb /media/<user>/Boot\ imx7d-/oftree; sync
    CODE

    If you wish to change the dtb name that is loaded from "oftree" to a specific dtb name, follow these steps to modify the U-Boot environment:

    a. Power on the board and press any key to stop autoboot within 3 seconds to enter U-Boot:

    b. Type the following commands: 

    Target (U-Boot)

    setenv fdt_file <dtb name>
    saveenv
    reset
    CODE

Root Filesystem

 Click here to expand...
  1. If modifying the root filesystem, remove the existing (replace '<user>' in the file path accordingly):  

    Host (Ubuntu)

    sudo rm -rf /media/<user>/<rootfs partition>/*
    CODE
  2. Load the new filesystem to the SD Card: 

    Host (Ubuntu)

    sudo tar -jxf <YOCTO_IMAGE>-<YOCTO_MACHINE>.tar.bz2 -C /media/<user>/<rootfs partition>/; sync
    CODE

Bootloader

 Click here to expand...
  1. Flash u-boot to the SD card (replace X with the correct letter): 

    Host (Ubuntu)

    sudo dd if=u-boot.imx of=/dev/sdX bs=512 seek=2 conv=fsync
    CODE