Steps to Configure JFFS2 Boot - 2022.1 English

PetaLinux Tools Documentation: Reference Guide (UG1144)

Document ID
UG1144
Release Date
2022-04-26
Version
2022.1 English
  1. Set the root file system type to JFFS2. For more information, see Configuring Root File System Type.
  2. Select petalinux-config -->Image Packaging Configuration  ---> jffs2 erase block size(KByte) (jffs2 erase block size: 128KiB)

    Note: 8KiB erase block size does not work with 5.10 kernel because they disabled the dependent kernel configs to support UBIFS boot support.
    CAUTION:
    The erase block size MUST match the erase size of your flash device
  3. Set Primary Flash as boot device and update the boot script configuration if required. For more information, see Configuring U-Boot Boot Script (boot.scr) and Configuring Primary Flash Partition.
  4. Build the system image. For more information, see Build System Image.
  5. Boot a PetaLinux Image on hardware with JTAG, see Booting PetaLinux Image on Hardware with an SD Card.
  6. Make sure you have configured TFTP server in host.
  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.jffs2.
        ZynqMP> tftpboot 0x80000 rootfs.jffs2
      • Write rootfs.jffs2.
        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

    Note: 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 may fail at the U-Boot prompt.
  8. Enable QSPI flash boot mode on board.
  9. Reset the board (booting starts from flash).
Table 1. Error Message while loading Image and ramdisk.cpio.gz.u-boot
Error Message Description
Wrong Image Format for bootm command
ERROR: can't get kernel image!
Booting using Fit image failed
This error message appears when you load Image and ramdisk.cpio.gz.u-boot for QSPI/OSPI/NAND boot mode. You can ignore this error message.