Configuring UBIFS Boot - 2023.1 English

PetaLinux Tools Documentation: Reference Guide (UG1144)

Document ID
UG1144
Release Date
2023-05-16
Version
2023.1 English
Follow these steps to configure PetaLinux for UBIFS:
  1. Set the root file system to UBIFS. For more information, see Configuring Root File System Type.

    .
    1. Select petalinux-config > Image Packaging Configuration > Root filesystem type (UBI/UBIFS).
    2. Specify the arguments used in mkfs.ubifs to create the UBIFS partition-m 2 -e 130944 -c 400 For QSPI 128k erase block size.
    3. Specify the arguments used in ubinize to create the UBIFS partition. -m 2048 -p 128KiB -s 512 For QSPI 128k erase block size.
    4. Specify the ubifs part name to add in bootargs, for example, ubifs.
      Note: Ensure that you create the QSPI partition with the specified name.
    5. Specify the root file system format to build rootfs.ubi during the build.

      For example,

      tar.gz cpio cpio.gz.u-boot cpio.gz ext4 jffs2 ubi
  2. Set Primary Flash as boot device and configure boot script. For more information, see Configuring U-Boot Boot Script (boot.scr) and Configuring Primary Flash Partition.
  3. Build the system image. For more information, see Building a System Image.
  4. Boot a PetaLinux Image on Hardware with SD Card. For more information, see Booting PetaLinux Image on Hardware with an SD Card.
  5. Ensure that you have configured the TFTP server in the host.
  6. Check the offsets for kernel and root file system at petalinux-config > u-boot Configuration > u-boot script configuration. If they do not match, the process can fail at the U-Boot prompt.
  7. Set the server IP address to the host IP address using the following command at U-Boot prompt.
    ZynqMP> setenv serverip <HOST IP ADDRESS>;
    1. Detect Flash Memory.
      ZynqMP> sf probe 0 0 0
    2. Erase Flash Memory.
      ZynqMP> sf erase 0 0x8000000
    3. Read images onto Memory and write into Flash.
      • Read BOOT.BIN.
        ZynqMP> tftpboot 0x80000 BOOT.BIN
      • Write BOOT.BIN.
        ZynqMP> sf write 0x80000 0x0 $filesize

        Example: sf write 0x80000 0x0 0x10EF48

      • Read image.ub.
        ZynqMP> tftpboot 0x80000 image.ub
      • Write image.ub.
        ZynqMP>sf write 0x80000 <Fit Image Flash Offset Address> $filesize

        Example: sf write 0x80000 0xF40000 0x6cb0e4

      • Read rootfs.ubi.
        ZynqMP> tftpboot 0x80000 rootfs.ubi
      • Write rootfs.ubi.
        ZynqMP> sf write 0x80000 <Rootfs Flash Offset Address> $filesize

        Example: sf write 0x80000 0x04000000 0x7d4000

      • Read boot.scr
        ZynqMP> tftpboot 0x80000 boot.scr
      • Write boot.scr
        ZynqMP> sf write 0x80000 <boot.scr Flash Offset Address> $filesize

        Example: sf write 0x80000 0x03e80000 0x80000

  8. Enable QSPI flash boot mode on board.
  9. Reset the board (booting starts from flash).