This tutorial explains procedure to measure transition times and respected power values when either PS or PL suspends or wake up. By following below procedure, user can see/measure the suspend/wake-up time and power. These procedures are for 2021.1 and later releases.
...
Petalinux 2020.2 generated images (including rpu_app.elf, boot.bif and BOOT.BINother intermediate files):
ZCU102 rev1.0: zcu102.tar
Linux log: zynqmp-linux-log.txt
rpu source: rpu_src.tar
For Versal
Petalinux 2020.2 generated images (including rpu_app.elf, boot.bif and BOOT.BINother intermediate files):
VCK190 Prod: vck190-prod.tar
Linux log: vck190-linux-log.txt
rpu source: rpu_src.tar
To generate binaries on your own please refer below steps for generating required images/binaries.
...
Configure petalinux to use custom XSA (provided in prebuilt section) and enable the custom user application
Code Block petalinux-config --silentconfig --get-hw-description=<path to xsa directory> petalinux-create -t apps --template install --name myapp --enable
Use below command to apply patch for plm (patch file is provided in prebuilt section)
Code Block mkdir -p project-spec/meta-user/recipes-bsp/plm-firmware/files/ cp plm.patch project-spec/meta-user/recipes-bsp/plm-firmware/files/ vim project-spec/meta-user/recipes-bsp/plm-firmware/plm-firmware_%.bbappend
Add below content to plm-firmware_%.bbappend file
Code Block FILESEXTRAPATHS_prepend := "${THISDIR}/files:" SRC_URI += "file://plm.patch \ "
copy apu_script.shand another PL bitfiles (partial.pdi, partial.dtbo, greybox.pdi and greybox.dtbo) to myapp (All files provided in prebuilt section)
Code Block cd <petalinux_proj_dir>/project-spec/meta-user/recipes-apps/myapp/files/ cp <dow_dir>/apu_script.sh <dow_dir>/partial.pdi <dow_dir>/partial.dtbo <dow_dir>/greybox.pdi <dow_dir>/greybox.dtbo .
Update myapp.bb (located at project-spec/meta-user/recipes-apps/myapp) as shown below
Code Block # # This file is the myapp recipe. # SUMMARY = "Simple myapp application" SECTION = "PETALINUX/apps" LICENSE = "MIT" LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" FILESEXTRAPATHS_prepend := "${THISDIR}/files:" SRC_URI = "file://myapp \ file://partial.pdi \ file://partial.dtbo \ file://greybox.pdi \ file://greybox.dtbo \ file://apu_script.sh \ " S = "${WORKDIR}" CFLAGS_prepend = "-I ${S}/include" do_install() { echo "D: ${D}" echo "S: ${S}" install -d ${D}${bindir} install -m 0755 ${S}/myapp ${D}${bindir} install -m 0755 ${S}/partial.pdi ${D}${bindir} install -m 0755 ${S}/partial.dtbo ${D}${bindir} install -m 0755 ${S}/greybox.pdi ${D}${bindir} install -m 0755 ${S}/greybox.dtbo ${D}${bindir} install -m 0755 ${S}/apu_script.sh ${D}${bindir} }
Replace rootfs_configfile (provided in prebuilt section) with <petalinux-proj-dir>/project-spec/configs/rootfs_config file
Build the petalinux as shown below
Code Block petalinux-build
...
Use below command to create and enable custom petalinux application
Code Block petalinux-config --silentconfig petalinux-create -t apps --template install --name myapp --enable
Copy apu_script.sh (provided in prebuilt section) to myapp folder
Code Block cp <dow_dir>/apu_script.sh <petalinux_proj_dir>/project-spec/meta-user/recipes-apps/myapp/files/
Update myapp.bb (located at project-spec/meta-user/recipes-apps/myapp/) as shown below
Code Block # # This file is the myapp recipe. # SUMMARY = "Simple myapp application" SECTION = "PETALINUX/apps" LICENSE = "MIT" LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" FILESEXTRAPATHS_prepend := "${THISDIR}/files:" SRC_URI = "file://myapp \ file://apu_script.sh \ " S = "${WORKDIR}" CFLAGS_prepend = "-I ${S}/include" do_install() { echo "D: ${D}" echo "S: ${S}" install -d ${D}${bindir} install -m 0755 ${S}/myapp ${D}${bindir} install -m 0755 ${S}/apu_script.sh ${D}${bindir} }
Enable ECC in FSBL code:
Create directory <plnx-proj-root>/project-spec/meta-user/recipes-bsp/fsbl/files/ (if not present)
Copy patch file to <plnx-proj-root>/project-spec/meta-user/recipes-bsp/fsbl/files/ (Patch attached in prebuilt section)
Open file <plnx-proj-root>/project-spec/meta-user/recipes-bsp/fsbl/fsbl_%.bbappend (create if not present)
Add below lines in file:
Code Block FILESEXTRAPATHS_prepend := "${THISDIR}/files:" SRC_URI += " file://ecc_fsbl.patch"
Now build petalinux using below command
Code Block petalinux-build
...
Open Vitis and start with empty application as shown below
Select “create a new hardware platform“ and select petalinux prebuilt XSA file as shown below (uncheck generate boot components option in case of ZynqMP)
Select target processor as "psu_cortexr5_0" and give the application name (ex. rpu_app)
Click next and leave all options unchanged
Click next and select "Empty Application" from the template list
Click finish which will show the project window as shown below
Now click on "Navigate to BSP" settings and click "Modify BSP settings"
Now select the "xilpm" library option as shown below.
Select psu_cortexr5_0 and add “-DDEBUG_MODE“ in extra_compiler_flags as shown below and click ok.
Right click on "rpu_app" from explorer and select "import sources" option
Download rpu_src.tar and extract it to local folder
Select the source and target path as shown below and click ok
Right click on "rpu_app" from explorer and select "build project"
...