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

Compare with Current View Page History

Version 1 Next »

The phyBOARD-i.MX7 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 NAND is empty
  • Upgrade to a new release
  • Use custom built images

Configure SD Card for Flashing

In addition to the standard SD card formatted in Creating a Bootable SD Card, the following steps are required to copy over images that will be flashed. Execute from the host PC:

  1. Copy u-boot.imx to the Boot partition of the SD card. In order to be able to save the environment to NAND rather than SD card, u-boot.imx-nand image is needed. This image is available in the release binaries.

    cp u-boot.imx-nand /media/Boot\ imx7/; sync

    To build a u-boot.imx-nand image with Yocto, set UBOOT_CONFIG variable to nand in $YOCTO_DIR/build/conf/local.conf:

    UBOOT_CONFIG = "nand"
  2. Create a new partition on the SD card to hold the root filesystem ext4 image.

    sudo fdisk /dev/sd<X>
    
            p           print current partitions (note end of partition 2, 1826815 for NXP 1.2.0 release)
            n           newpartition
            p           primary
            3           partition number
            1826816     (start after end of partition 2) first sector
            <enter>       Use defaultvalue forlast sector
            t           Change partition systemid
            3           Partition number
            c           FAT32
            w           write table to disk and exit
    
    sudo mkfs.vfat -n "data"/dev/sd<X>3
  3. Copy the filesystem image to the new "data" partition. Due to the size of NAND, the standard fsl-image-bsp filesystem does not fit on NAND, so a smaller filesystem will need to be used. This example uses the Yocto image "core-image-minimal", which is included in the BSP release images.

    cp core-image-minimal-<MACHINE NAME>.tar.bz2 /media/data/; sync
  4. Power on the board and boot from the SD card into Linux.
  5. Erase mtd0 and use NXP's utility "kobs-ng" to flash u-boot.imx to NAND:

    flash_erase /dev/mtd0 0 0
    kobs-ng init -x /run/media/mmcblk0p1/u-boot.imx
  6. Flash zImage and device tree :

    flash_erase /dev/mtd1 0 0
    nandwrite -p /dev/mtd1 /run/media/mmcblk0p1/zImage
    
    flash_erase /dev/mtd2 0 0
    nandwrite -p /dev/mtd2 /run/media/mmcblk0p1/<MACHINE NAME>.dtb
  7. Flash filesystem:

    flash_erase /dev/mtd3 0 0
    ubiformat /dev/mtd3; ubiattach /dev/ubi_ctrl -m 3; ubimkvol /dev/ubi0 -N rootfs -m
    mkdir /tmp/rootfs
    mount -t ubifs ubi0:rootfs /tmp/rootfs
    tar -xf /run/media/mmcblk0p3/core-image-minimal-<MACHINE NAME>.tar.bz2 -C /tmp/rootfs/; sync
  8. Power off the board, set boot switches according to Boot Configurations, and power back on.
  • No labels