Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Updated section explaining difference between u-boot.imx and u-boot.imx-nand. Also, added <user> to path when referencing SD card paths

...

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-nand to the Boot partition of the SD card. In order to be able to save the environment to NAND rather than SD card, NAND and boot kernel images from NAND by default, the u-boot.imx-nand image is needed. This image is The default u-boot.imx image will default to SD card. Both images are available in the release binaries. 

    Code Block
    cp u-boot.imx-nand /media/<user>/Boot\ imx7/; sync


    Info

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

    Code Block
    UBOOT_CONFIG = "nand"



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

    Code Block
    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.

    Code Block
    cp core-image-minimal-<MACHINE NAME>.tar.bz2 /media/<user>/data/; sync


  4. Power on the board and Set the boot switches, according to Boot Configurations, to boot from the SD card and power on the board into Linux.
  5. Erase mtd0 and use NXP's utility "kobs-ng" to flash u-boot.imx-nand to NAND:

    Code Block
    flash_erase /dev/mtd0 0 0
    kobs-ng init -x /run/media/mmcblk0p1/u-boot.imx-nand



  6. Flash zImage and device tree :

    Code Block
    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:

    Code Block
    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.

...