Versions Compared

Key

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

This page is intended to be a collection place for tips and tricks related to Yocto layers and how Yocto works under Petalinux.

Table of Contents

Table of Contents
excludeTable of Contents

Documentation

The first place you should start to better understand many details of the Yocto project is the Yocto project website

...


Create a fsbl bbappend file and add below content
Code Block
themeMidnight
$ vim <plnx-proj-root>/project-spec/meta-user/recipes-bsp/fsbl/fsbl_%.bbappend
# From 2021.1 onwards
$ vim <plnx-proj-root>/project-spec/meta-user/recipes-bsp/embeddedsw/fsbl-firmware_%.bbappend
To enable debugs in FSBL:
Code Block
themeMidnight
#Add debug for FSBL
XSCTH_BUILD_DEBUG = "1"
To add compiler flags in FSBL:
Code Block
themeMidnight
#Add compiler flags for FSBL
YAML_COMPILER_FLAGS_append = " -DFSBL_PROT_BYPASS"
To add BSP flags(secure mode) in FSBL:
Code Block
themeMidnight
#Add BSP flags for FSBL
YAML_BSP_CONFIG += "secure_mode"
YAML_BSP_CONFIG[secure_mode] = "set,true"
Create a pmu-firmware_%.bbappend file and add below content
Code Block
themeMidnight
$ vim <plnx-proj-root>/project-spec/meta-user/recipes-bsp/pmu/pmu-firmware_%.bbappend

#For v2018.1 or later PetaLinux releases only
$ vim <plnx-proj-root>/project-spec/meta-user/recipes-bsp/pmu-firmware/pmu-firmware_%.bbappend
To enable debugs in PMUFW refer this https://xilinx-wiki.atlassian.net/wiki/spaces/A/pages/18841724/PMU+Firmware page for DEBUG flags list
Code Block
themeMidnight
#Add debug for PMUFW
XSCTH_BUILD_DEBUG = "1"
 To add compiler flags in PMUFW, see PMU FW Build Flags:


Info

Note that the method of loading the PMUFW can prevent early prints (during code initialization) from being output.  See PMU Firmware > Using FSBL to load PMUFW for additional details.


Code Block
themeMidnight
#Add compiler flags for PMUFW
YAML_COMPILER_FLAGS_append = " -DDEBUG_MODE -DXPFW_DEBUG_DETAILED"
To add BSP flags(secure mode) in PMUFW:
Code Block
themeMidnight
#Add BSP flags for PMUFW
YAML_BSP_CONFIG += "secure_mode"
YAML_BSP_CONFIG[secure_mode] = "set,true"

To add BSP flags(debug mode) in PMUFW: For example if you want to enable https://github.com/Xilinx/embeddedsw/blob/release-2018.3/lib/sw_apps/zynqmp_pmufw/misc/xfpga_config.h#L34 debug is Xil BSP libraries

Code Block
themeMidnight
#Add BSP flags for PMUFW
YAML_BSP_CONFIG += "debug_mode"
YAML_BSP_CONFIG[debug_mode] = "set,true"


...

In Petalinux Flow:

Code Block
themeMidnight
$ petalinux-create -t apps --template install --name libcpsample --enable
$ 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
(or) You can use the below single command to achieve the above functionality.
Code Block
themeMidnight
$ petalinux-create -t apps --template install --name libcpsample --enable --srcuri "<path-to-dir>/libcpsample.so.1.0.1 <path-to-dir>/cpsample.h>"

In Yocto Flow:

Code Block
themeMidnight
$ mkdir -p <layer-path>/recipes-apps/libcpsample/files
$ touch <layer-path>/recipes-apps/libcpsample/libcpsample.bb
$ cp libcpsample.so.1.0.1 <layer-path>/recipes-apps/libcpsample/files
$ cp cpsample.h <layer-path>/recipes-apps/libcpsample/files


...