Skip to end of metadata
Go to start of metadata

The target Linux commands listed in this section will only work correctly if Linux is booted from SD card on the target hardware.

The phyCORE-AM57xx RDK is delivered with a pre-flashed bootloader and root file system. The following instructions will be useful if you would like to:

  • Create a flashable NAND image
  • Flash images to NAND

Create a NAND Root File System Image

To create a flashable NAND root file system image, follow these steps on your host PC. In these steps, we use phytec-tisdk-image-am5728-phycore-rdk.tar.xz as an example source root file system.

  1. Make temporary directories to store your work:

    Host
    mkdir -p ~/nand/temp
    
    cd ~/nand
  2. Place your root file system in the temporary directory created in the previous step:

    Host
    tar -xf phytec-tisdk-image-am5728-phycore-rdk.tar.xz -C ~/nand/temp
  3. Create a UBI File System (UBIFS) image from your root file system directory:

    Host
    mkfs.ubifs -m 4096 -c 4083 -e 258048 -r ~/nand/temp phytec-tisdk-image-am5728-phycore-rdk.ubifs
  4. Create and save a file named ubi.ini in your current working directory with the following contents:

    Host (ubi.ini)
    [rootfs]
    mode=ubi
    image=phytec-tisdk-image-am5728-phycore-rdk.ubifs
    vol_id=1
    vol_type=dynamic
    vol_name=rootfs
    vol_flags=autoresize
    vol_alignment=1
  5. Create an unsorted block image (UBI) from your UBIFS image:

    Host
    ubinize -o phytec-tisdk-image-am5728-phycore-rdk.ubi -p 256KiB -m 4096 -s 1024 ubi.ini

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 images that will be flashed. From the host PC:

  1. Copy the NAND-specific MLO and u-boot.img files to the rootfs partition on the SD card. In order to read from and write to the NAND by default, bootloader images that are compiled with NAND support are needed. The images needed are available in the release binaries and the filenames may vary.

    Host
    cp MLO-am572x_phycore_rdk_nand /media/<user>/boot/MLO && sync
    
    cp u-boot.img-am572x_phycore_rdk_nand /media/<user>/boot/u-boot.img && sync
  2. Copy the NAND-specific root file system image to a convenient place on the SD card. We recommend using the root user's home directory as you will not need to change directories after logging in to follow the rest of this guide.

    Host
    sudo cp phytec-tisdk-image-am5728-phycore-rdk.ubi /media/<user>/rootfs/home/root/ && sync

Flash Images to NAND

With a properly configured SD card, follow these steps to flash your NAND:

Please reference AM57xx Boot Configuration for boot mode settings.

  1. Set the boot switches to boot from the SD card and power on the board and boot into Linux.
  2. Flash MLO image to NAND:

    Target
    flash_erase /dev/mtd0 0 0
    
    nandwrite -p /dev/mtd0 MLO
    
  3. Flash u-boot.img image to NAND:

    Target
    flash_erase /dev/mtd4 0 0
    
    nandwrite -p /dev/mtd4 u-boot.img
  4. Flash the root file system image to NAND:

    Target
    flash_erase /dev/mtd6 0 0
    
    ubiformat /dev/mtd6 -f phytec-tisdk-image-am5728-phycore-rdk.ubi
  5. Power off the board, set the boot switches to boot from NAND, and power the board back on.