Note |
---|
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.
Make temporary directories to store your work:
Code Block language bash title Host mkdir -p ~/nand/temp cd ~/nand
Place your root file system in the temporary directory created in the previous step:
Code Block language bash title Host tar -xf phytec-tisdk-image-am5728-phycore-rdk.tar.xz -C ~/nand/temp
Create a UBI File System (UBIFS) image from your root file system directory:
Code Block language bash title Host mkfs.ubifs -m 4096 -c 4083 -e 258048 -r ~/nand/temp phytec-tisdk-image-am5728-phycore-rdk.ubifs
Create and save a file named ubi.ini in your current working directory with the following contents:
Code Block language text title 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
Create an unsorted block image (UBI) from your UBIFS image:
Code Block language bash title 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:
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.
Code Block language bash title 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
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.
Code Block language bash title 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:
Info |
---|
Please reference AM57xx Boot Configuration for boot mode settings. |
- Set the boot switches to boot from the SD card and power on the board and boot into Linux.
Flash MLO image to NAND:
Code Block language bash title Target flash_erase /dev/mtd0 0 0 nandwrite -p /dev/mtd0 MLO
Flash u-boot.img image to NAND:
Code Block language bash title Target flash_erase /dev/mtd4 0 0 nandwrite -p /dev/mtd4 u-boot.img
Flash the root file system image to NAND:
Code Block language bash title Target flash_erase /dev/mtd6 0 0 ubiformat /dev/mtd6 -f phytec-tisdk-image-am5728-phycore-rdk.ubi
- Power off the board, set the boot switches to boot from NAND, and power the board back on.