PetaLinux requires the following preparation before use:
- Create the PetaLinux master project in a suitable directory without any
spaces. In this guide it is named
<plnx-proj-root>:$ petalinux-create -t project -s <PATH_TO_PETALINUX_ZYNQMP_PROJECT_BSP> - Navigate to the
<plnx-proj-root>directory:$ cd <plnx-proj-root> - Include a remote application in the PetaLinux project.
This step is needed if you are not using one of the pre-built remote firmware already included with the PetaLinux BSP. After you have developed and built a remote application (for example, with AMD Vitis™ unified software platform) it must be included in the PetaLinux project so that it is available from the Linux filesystem for remoteproc.
- Create a PetaLinux application inside the
components/apps/<app_name>directory, using the following command:$ petalinux-create -t apps --template install -n <app_name> --enable -
Copy the firmware (that is, the .elf file) built with AMD Vitis™ unified software platform for the remote processor into this directory:
project-spec/meta-user/recipes-apps/<app-name>/files/ - Modify the
project-spec/meta-user/recipes-apps/<app_name>/<app_name>.bbto install the remote processor firmware in the RootFS. For example:Recipe needs to be changed due to syntax changes in yocto Please use recipe content below SUMMARY = "Simple freertos-amp-demos application" SECTION = "PETALINUX/apps" LICENSE = "MIT" LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" SRC_URI = "file://<myfirmware> \ " S = "${WORKDIR}" INSANE_SKIP:${PN} = "arch" RDEPENDS:${PN} += " \ libmetal \ " do_install() { install -d ${D}${base_libdir}/firmware install -m 0644 ${S}/<myfirmware> ${D}${base_libdir}/firmware/<myfirmware> } FILES:${PN} = "${base_libdir}/firmware/<myfirmware>"
- Create a PetaLinux application inside the
- For all devices, configure the kernel options to work with OpenAMP:
- Start the PetaLinux Kernel configuration
tool:
petalinux-config -c kernel - Enable loadable module
support:
[*] Enable loadable module support ---> - Enable the
remoteprocdriver support:Device Drivers ---> Remoteproc drivers ---> # for R5: <M> ZynqMP_r5 remoteproc support
- Start the PetaLinux Kernel configuration
tool:
- Enable all of the modules and applications in the RootFS:Note: These options are only available in the PetaLinux reference BSP. The applications in this procedure are examples you can use.
- Open the
RootFSconfiguration menu:petalinux-config -c rootfs - Ensure the OpenAMP applications and rpmsg modules are
enabled:
Filesystem Packages ---> -> Petalinux Package Groups -> packagegroup-petalinux-openampNote:packagegroup-petalinux-openampenables many openamp related sub-components. If you need more fine-grained control, do not set this packagegroup. Instead, enable the following individual components as needed:rpmsg-echo-test, rpmsg-mat-mul, rpmsg-proxy-appLinks to each of the packages’ source code for the above components can be found in the following:
- rpmsg-echo-test: https://github.com/OpenAMP/openamp-system-reference/blob/main/examples/linux/rpmsg-echo-test/echo_test.c
- rpmsg-proxy-app: https://github.com/OpenAMP/openamp-system-reference/blob/main/examples/linux/rpmsg-proxy-app/proxy_app.c
- rpmsg-mat-mul: https://github.com/OpenAMP/openamp-system-reference/blob/main/examples/linux/rpmsg-mat-mul/mat_mul_demo.c
- If needed, enable inclusion of default remote processor firmware images:
Filesystem Packages ---> misc ---> openamp-fw-echo-testd ---> [*] openamp-fw-echo-testd openamp-fw-mat-muld ---> [*] openamp-fw-mat-muld openamp-fw-rpc-demo ---> [*] openamp-fw-rpc-demoNote: This includes the same remote processor firmwares provided by pre-built images as found in the rootfs/lib/firmwaredirectory. It is not needed if you build new images with the AMD Vitis™ unified software platform.
- Open the