Steps to Boot a PetaLinux Image on Hardware with SD Card - 2021.2 English

PetaLinux Tools Documentation: Reference Guide

Document ID
UG1144
Release Date
2021-10-27
Version
2021.2 English
You can boot a PetaLinux image on hardware using an SD card by copying the required images manually or by flashing a wic image into the mounted SD card.

Steps to Flash and Boot the PetaLinux Images Manually

  1. Copy the following files from <plnx-proj-root>/images/linux or <plnx-proj-root>/pre-built/linux/images/ into the root directory of the first partition, which is in FAT32 format in the SD card:
    • BOOT.BIN
    • image.ub
    • boot.scr
  2. Extract the rootfs.tar.gz folder into the ext4 partition of the SD card.
  3. Connect the serial port on the board to your workstation.
  4. Open a console on the workstation and start the preferred serial communication program (For example: kermit, minicom, gtkterm) with the baud rate set to 115200 on that console.
  5. Power off the board.
  6. Set the boot mode of the board to SD boot. Refer to the board documentation for details.
  7. Plug the SD card into the board.
  8. Power on the board.
  9. A boot message displays on the serial console.

Steps to Flash and Boot PetaLinux Image Using WIC Image

  1. To generate the WIC image in Petalinux project see petalinux-package --wic Command Examples
  2. Go to the <plnx-proj-root>/images/linux or <plnx-proj-root>/pre-built/linux/images/ directory. For example, cd images/linux/.
  3. If the WIC image is compressed with XZ format, extract the petalinux-sdimage.wic.xz file using xz command. For example, xz -d petalinux-sdimage.wic.xz
    Note: If xz package is not installed in your build machine, use the prebuilt xz binary from $PETALINUX/components/yocto/buildtools/sysroots/x86_64-petalinux-linux/usr/bin/xz
  4. Flash the extracted petalinux-sdimage.wic image into the SD card.
    Flash the wic image in Linux
    To flash the wic image to SD card in Linux machines, connect the SD card to the host system and use the dd command:

    dd if=petalinux-sdimage.wic of=/dev/sd<X> conv=fsync

    Note: You need sudo access to do this.
    Flash the wic image in Windows
    To flash the wic image to the SD card in Windows, you can use any of the following:
    • BalenaEtcher tool
    • Win32DiskImager
  5. Insert the SD card into the board and boot the system.
  6. Connect the serial port on the board to your workstation.
  7. Open a console on the workstation and start the preferred serial communication program (For example: kermit, minicom, gtkterm) with the baud rate set to 115200 on that console.
  8. Power off the board.
  9. Set the boot mode of the board to SD boot. Refer to the board documentation for details.
  10. Plug the SD card into the board.
  11. Power on the board. The boot logs display on the serial console:
Tip: To stop auto-boot, hit any key when you see a message on the console: Hit any key to stop autoboot.