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"


...

  1. Download and untar the PetaLinux release sstate-cache files from https://www.xilinx.com/support/download/index.html/content/xilinx/en/downloadNav/embedded-design-tools.html. Here we are taking 2019.2 as an example.
  2. Go to your 2019.2 PetaLinux project and set the following options using petalinux-config

    Code Block
    languagebash
    themeMidnight
    titleSSTATE Template
    $ petalinux-config ---> Yocto Settings ---> Add pre-mirror url ---> file://<path_to_downloads>
    $ petalinux-config ---> Yocto Settings ---> Local sstate feeds settings ---> local sstate feeds url ---> <path_to_sstate_aarch64_2019.2/aarch64>


    Code Block
    languagebash
    themeMidnight
    titleSSTATE Example Usage
    $ petalinux-config ---> Yocto Settings ---> Add pre-mirror url ---> file:///opt/xilinx/petalinux/2019.2/downloads
    $ petalinux-config ---> Yocto Settings ---> Local sstate feeds settings ---> local sstate feeds url ---> /opt/xilinx/petalinux/2019.2/sstate_aarch64_2019.2/aarch64


    Info

    Note: For PREMIRRORS usage you need to add the file, git, http or https protocol followed by the path, but this is not true for SSTATE feeds.


  3. For setting up the download and shared state directories add the following variables in the <plnx-proj-root>/project-spec/meta-user/conf/petalinuxbsp.conf file.

    Code Block
    languagebash
    themeMidnight
    titleDL_DIR and SSTATE_DIR Template
    DL_DIR = "<PATH-TO-DOWNLOADS-DIRECTORY>/<PetaLinux-Version>/downloads"
    SSTATE_DIR = "<PATH-TO-SSTATE-DIRECTORY>/<PetaLinux-Version>/sstate-cache/<ARCH>"


    Code Block
    languagebash
    themeMidnight
    titleDL_DIR and SSTATE_DIR example usage
    DL_DIR = "/home/$USER/plnx-workspace/2019.2/downloads"
    SSTATE_DIR = "/home/$USER/plnx-workspace/2019.2/sstate-cache/aarch64"


    Info

    Note: DL_DIR and SSTATE_DIR directories should have read and write permission.


  4. Now you need to start the build and if you are building the SDK (petalinux --sdk) then enabling the network is mandatory for a fresh build.

    Code Block
    languagebash
    themeMidnight
    titleBuild Commands
    $ petalinux-build
    $ petalinux-build --sdk


  5. If you are building without network access then set the BB_NO_NETWORK variable.

    Code Block
    languagebash
    themeMidnight
    titleSet BB_NO_NETWORK
    $ petalinux-config ---> Yocto Settings ---> [*] Enable BB NO NETWORK


    Info

    Note: In case the project was built previously, run petalinux-build -x mrproper with above variables to reduce build time especially when using petalinux-build --sdk.


How to disable hwcodecs(Xilinx vcu firmware) in PetaLinux for ZynqMP EV devices.

  1. By default hwcodecs are enabled in petalinux project when zynqmp ev device xsa is parsed while creating the project. To disable hwcodes add below variable in <plnx-proj-root>/project-spec/meta-user/conf/petaliuxbsp.conf

    Code Block
    languagebash
    themeMidnight
    IMAGE_FEATURES_remove = "hwcodecs"


  2. Clean and rebuild complete project.

    Code Block
    languagebash
    themeMidnight
    $ petalinux-build -x mrproper
    $ petalinux-build


Yocto References 

...