Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

By pass PMUFW debug logs on different UART console:
Code Block
themeMidnight
YAML_SERIAL_CONSOLE_STDIN_forcevariable = "psu_uart_1"
YAML_SERIAL_CONSOLE_STDOUT_forcevariable = "psu_uart_1"
Remove the <plnx-proj-root>/components/plnx_workspace and clean you project workspace before rebuilding FSBL or PMUFW components
Code Block
themeMidnight
$ petalinux-build -x mrproper

#Note: In v2018.1 or later PetaLinux release "petalinux-build -x mrproper" command will remove <plnx-proj-root>/components/plnx_workspace directory
$ rm -rf <plnx-proj-root>/components/plnx_workspace
$ petalinux-build

How to Update psu_init Files in PetaLinux Project

Info

Note: PSU_INIT files are generated based on HDF or XSA parsing, Hence these files can't be patched on top of embedded_sw repo using Yocto SRC_URI variable. Alternatively we can update these files by editing <plnx-proj-root>/project-spec/hw-description/psu_init.c and copy to FSBL build workspace during do_compile_prepend bitbake task.


1. Modify <plnx-proj-root>/project-spec/hw-description/psu_init.c file as per your requirement 

2. Create a FSBL bbappend file under <plnx-proj-root>/project-spec/meta-user/recipes-bsp/fsbl/fsbl_%.bbappend and add below content to update psu_init.c changes to FSBL

Code Block
themeMidnight
# For 2018.2 and below versions
do_compile_prepend(){
   install -m 0644 ${TOPDIR}/../project-spec/hw-description/psu_init.c ${TOPDIR}/../components/plnx_workspace/fsbl/fsbl_hwproj/psu_init.c
}

# For 2018.3 and later versions we removed FSBL and PMUFW external workspace from <plnx-proj-root>/components/plnx_workspace directory
# to align Yocto patching mechanism. Hence we are copying the files to build workspace(${B})
# https://github.com/Xilinx/meta-xilinx-tools/blob/rel-v2018.3/classes/xsctbase.bbclass#L14
do_compile_prepend(){
   install -m 0644 ${TOPDIR}/../project-spec/hw-description/psu_init.c ${B}/fsbl/psu_init.c
}

How to Add Pre-built Libraries in PetaLinux or Yocto Recipes


1. Create a new recipe or in existing recipe in meta-user layer as shown
Code Block
themeMidnight
$ mkdir -p <plnx-proj-root>/project-spec/meta-user/recipes-apps/libcpsample/files
2. Copy pre-built libraries files and header file required for libraries to <plnx-proj-root>/project-spec/meta-user/recipes-apps/libcpsample/files as
Code Block
themeMidnight
$ cp libcpsample.so.1.0.1 <plnx-proj-root>/project-spec/meta-user/recipes-apps/libcpsample/files
$ cp cpsample.h <plnx-proj-root>/project-spec/meta-user/recipes-apps/libcpsample/files
3. Add the below content to recipe file
Code Block
themeMidnight
#
# This file is the libcpsample recipe.
#
 
SUMMARY = "Sample pre-built library copy to rootfs"
SECTION = "libs"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
 
SRC_URI = " \
    file://libcpsample.so.1.0.1 \
    file://cpsample.h \
"
 
S = "${WORKDIR}"
 
# Add dependency libraires if any
# for example DEPENDS = "libpcap"
 
# If you need to create a symbolic link using the pre-built libraries you should use oe_soinstall.
# This copies libraries to "{TARGET_ROOTFS}/usr/lib" directory and create a symlink as
# lrwxrwxrwx libcpsample.so.1.0 -> libcpsample.so.1.0.1
# -rwxr-xr-x libcpsample.so.1.0.1
 
do_install() {
    install -d ${D}${libdir}
    oe_soinstall ${S}/libcpsample.so.1.0.1 ${D}${libdir}
    install -d -m 0655 ${D}${includedir}/CPSAMPLE
    install -m 0644 ${S}/*.h ${D}${includedir}/CPSAMPLE/
}
 
# Inhibit warnings about files being stripped
INSANE_SKIP_${PN} = "ldflags"
INSANE_SKIP_${PN} = "already-stripped"
 
# If you don't have .h file to copy to /usr/include add something like below
# FILES_${PN} = "${libdir}/*.so.*"
 
FILES_${PN} = "${libdir}/*.so.* ${includedir}/*"
FILES_${PN}-dev = "${libdir}/*.so"
4. Build the pre-built library recipe
Code Block
themeMidnight
$ petalinux-build -c libcpsample


...