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
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 |
---|
|
$ 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 |
---|
|
#Add debug for FSBL
XSCTH_BUILD_DEBUG = "1" |
To add compiler flags in FSBL:
Code Block |
---|
|
#Add compiler flags for FSBL
YAML_COMPILER_FLAGS_append = " -DFSBL_PROT_BYPASS" |
To add BSP flags(secure mode) in FSBL:
Code Block |
---|
|
#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 |
---|
|
$ 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 |
---|
|
#Add debug for PMUFW
XSCTH_BUILD_DEBUG = "1" |
To add compiler flags in PMUFW, see
PMU FW Build Flags:
Code Block |
---|
|
#Add compiler flags for PMUFW
YAML_COMPILER_FLAGS_append = " -DDEBUG_MODE -DXPFW_DEBUG_DETAILED" |
To add BSP flags(secure mode) in PMUFW:
Code Block |
---|
|
#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 |
---|
|
#Add BSP flags for PMUFW
YAML_BSP_CONFIG += "debug_mode"
YAML_BSP_CONFIG[debug_mode] = "set,true" |
...
- 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.
Go to your 2019.2 PetaLinux project and set the following options using petalinux-config
Code Block |
---|
language | bash |
---|
theme | Midnight |
---|
title | SSTATE 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 |
---|
language | bash |
---|
theme | Midnight |
---|
title | SSTATE 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. |
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 |
---|
language | bash |
---|
theme | Midnight |
---|
title | DL_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 |
---|
language | bash |
---|
theme | Midnight |
---|
title | DL_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. |
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 |
---|
language | bash |
---|
theme | Midnight |
---|
title | Build Commands |
---|
|
$ petalinux-build
$ petalinux-build --sdk |
If you are building without network access then set the BB_NO_NETWORK variable.
Code Block |
---|
language | bash |
---|
theme | Midnight |
---|
title | Set 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.
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 |
---|
language | bash |
---|
theme | Midnight |
---|
|
IMAGE_FEATURES_remove = "hwcodecs" |
Clean and rebuild complete project.
Code Block |
---|
language | bash |
---|
theme | Midnight |
---|
|
$ petalinux-build -x mrproper
$ petalinux-build |
Yocto References
...