Building User Applications - 2023.2 English

PetaLinux Tools Documentation: Reference Guide (UG1144)

Document ID
UG1144
Release Date
2023-10-18
Version
2023.2 English

Running petalinux-build in the project directory <plnx-proj-root> rebuilds the system image including the selected user application myapp. (The output directory for this build process is <TMPDIR>/work/<arch>/myapp/1.0-r0/) where arch can be:

  • aarch64(zynqmp and versal) - cortexa72-cortexa53-xilinx-linux
  • arm(zynq) - cortexa9t2hf-neon-xilinx-linux-gnueabi/
  • microblaze - microblazeel-v11.0-bs-cmp-re-mh-div-xilinx-linux/
petalinux-build

To build myapp into an existing system image:

cd <plnx-proj-root>
petalinux-build -c rootfs
petalinux-build -x package

Other petalinux-build options are explained with --help. Some of the build options are:

  • To clean the selected user application:
    petalinux-build -c myapp -x do_clean
  • To rebuild the selected user application:
    petalinux-build -c myapp

    This compiles the application. The compiled executable files are in the <TMPDIR>/work/<arch>/myapp/1.0-r0/ directory where arch can be:

    • aarch64(zynqmp and versal) - cortexa72-cortexa53-xilinx-linux
    • arm(zynq) - cortexa9t2hf-neon-xilinx-linux-gnueabi/
    • microblaze - microblazeel-v11.0-bs-cmp-re-mh-div-xilinx-linux/

    If you want to use the build artifacts for debugging with the third party utilities, add the line: RM_WORK_EXCLUDE += "myapp" in <plnx-proj-root>/project-spec/meta-user/conf/petalinuxbsp.conf. Refer Debugging for more information. Without this line, the BitBake removes all the build artifacts after building successfully.

  • To see all list of tasks for myapp:
    petalinux-build -c myapp -x listtasks
  • To install the selected user application:
    petalinux-build -c myapp -x do_install

    This installs the application into the target the root file system host copy: <TMPDIR>/work/<MACHINE_NAME>-xilinx-linux/petalinux-image-minimal/1.0-r0/rootfs/.

    TMPDIR can be found in petalinux-config > Yocto-settings > TMPDIR. If the project is on local storage, TMPDIR is <plnx-proj-root>/build/tmp/.

    If you want to use the build artifacts for debugging with third party utilities, add the following line in project-spec/meta-user/conf/petalinuxbsp.conf:

    RM_WORK_EXCLUDE += "myapp"