Custom_table_size_100 |
---|
PetaLinux is brand name used by
...
AMD , it is based on Yocto and pretty decent mainstream kernel, what Petalinux adds is the HSI (Hardware Software Interface from Vivado) and special tools for boot image creation.
Scroll Only (inline) |
---|
Online version of this manual and other related documents can be found at https://wiki.trenz-electronic.de/display/PD/PetaLinux+KICKstart |
Table of Contents | ||
---|---|---|
|
Excerpt |
---|
Petalinux Project Creation- Short HOWTOGetting Linux working on Zynq is very simple, following steps are required
This is generic how-to, everything is setup for your by the Vivado->PetaLinux flow. Note, the boot.bin generated by PetaLinux may not always work, in such case it is recommended to make the boot.bin with SDK-GUI or command line tools manually. There is no need to install |
...
anything else, or to fetch anything from any github repos, etc. PetaLinux 2023.2
PetaLinux Installation
Creating a Project from Vivado Project
Petalinux ConfigurationUse local sstate cache and downlods
Configuration menues and filesMost settings can be changed with menu-config:
Manual changes can be done in the subfolder "<plnx-proj-root>/project-spec/meta-user/"
Additional Descriptions
References
|
(optional) Create new VM with supported Linux OS.
Attention: Use English as OS language for your Linux System (Keyboard language can be any language). Other languages may cause errors on PetaLinux build process.
with OracleVM:
VM Setup:
RAM: >= 8GB
CPU: >= 4
HDD: 200GB dynanically
ubuntu-20.04-desktop-amd64.iso
install vm guest additions
Network: network bridge
optional: add shared folder, enable drag and drop
Info | ||
---|---|---|
| ||
Download PetaLinux from Xilinx Website: http://www.xilinx.com/support/download/index.html/content/xilinx/en/downloadNav/embedded-design-tools.html
Choose a PetaLinux Version, that's corresponding to the installed Vivado and SDK Version.
Example: Use Vitis (SDK+Vivado) 2021.2 with PetaLinux 2021.2
Use UG1144 "PetaLinux Tools Documentation - Reference Guide" that's corresponding with your PetaLinux Version
Use bash as terminal:
$ sudo dpkg-reconfigure dash
→ press no
Check "PetaLinux Tools Installation Requirements" chapter and install missing tool/libraries
https://www.xilinx.com/support/answers/73296.html
download plnx-env-setup.sh and run
$
sudo apt-get update
$
sudo apt-get install iproute2 gawk python3 python build-essential gcc git make net-tools libncurses5-dev tftpd zlib1g-dev libssl-dev flex bison libselinux1 gnupg wget git-core diffstat chrpath socat xterm autoconf libtool tar unzip texinfo zlib1g-dev gcc-multilib automake zlib1g:i386 screen pax gzip cpio python3-pip python3-pexpect xz-utils debianutils iputils-ping python3-git python3-jinja2 libegl1-mesa libsdl1.2-dev pylint3 -y
Install petalinux (Note: do not start from shared folder, copy installer into home directory)
$ mkdir -p ~/petalinux/2022.2
$ ./petalinux-v2020.2-final-installer.run
source enviroment
$ source ~/petalinux/2022.2/settings.sh
Deactivate Webtalk:
$ petalinux-util --webtalk off
Note:
There is no need to install anything else, or to fetch anything from any github repos, etc.
It is recommended to test the installation by creating a dummy template project and building it.
Download one of the BSP Examples from Xilinx Website (Only to test your installation)
Install:$ petalinux-create -t project -s <path-to-bsp>
Build: $ petalinux-build
Info |
---|
Some reference designs contains a preconfigured PetaLinux project as template. This can be used instead of creating a new project described on step 2. Basic Note to TE Petalinux Templates, see: PetaLinux TE-Template#PetaLinux2021.2 New with 2022.2 and newer:
New with 2020.2 and newer:
|
"/bin/sh" is bash
$ petalinux-create --type project --template <CPU_TYPE> --name <PROJECT_NAME>
Most settings can be changed with menu-config:
Manual changes can be done in the subfolder "<plnx-proj-root>/project-spec/meta-user/"
CONFIG |
|
|
U-Boot |
|
|
Device Tree |
|
|
Kernel |
|
|
Apps |
|
|
ROOTFS |
|
|
Xilinx generated configuration |
| Note: config and rootfs_config are shared at the moment, they include user and xilinx default changes from XSA import |
(optional) Create new VM with supported Linux OS.
Attention: Use English as OS language for your Linux System (Keyboard language can be any language). Other languages may cause errors on PetaLinux build process.
with OracleVM:
VM Setup:
RAM: >= 8GB
CPU: >= 4
HDD: 200GB dynanically
ubuntu-20.04-desktop-amd64.iso
install vm guest additions
Network: network bridge
optional: add shared folder, enable drag and drop
Info | ||
---|---|---|
| ||
Download PetaLinux from Xilinx Website: http://www.xilinx.com/support/download/index.html/content/xilinx/en/downloadNav/embedded-design-tools.html
Choose a PetaLinux Version, that's corresponding to the installed Vivado and SDK Version.
Example: Use Vitis (SDK+Vivado) 2021.2 with PetaLinux 2021.2
Use UG1144 "PetaLinux Tools Documentation - Reference Guide" that's corresponding with your PetaLinux Version
Use bash as terminal:
$ sudo dpkg-reconfigure dash
→ press no
Check "PetaLinux Tools Installation Requirements" chapter and install missing tool/libraries
https://www.xilinx.com/support/answers/73296.html
download plnx-env-setup.sh and run
$
sudo apt-get update
$
sudo apt-get install iproute2 gawk python3 python build-essential gcc git make net-tools libncurses5-dev tftpd zlib1g-dev libssl-dev flex bison libselinux1 gnupg wget git-core diffstat chrpath socat xterm autoconf libtool tar unzip texinfo zlib1g-dev gcc-multilib automake zlib1g:i386 screen pax gzip cpio python3-pip python3-pexpect xz-utils debianutils iputils-ping python3-git python3-jinja2 libegl1-mesa libsdl1.2-dev pylint3 -y
Install petalinux (Note: do not start from shared folder, copy installer into home directory)
$ mkdir -p ~/petalinux/2021.2
$ ./petalinux-v2020.2-final-installer.run
source enviroment
$ source ~/petalinux/2021.2/settings.sh
Deactivate Webtalk:
$ petalinux-util --webtalk off
Note:
There is no need to install anything else, or to fetch anything from any github repos, etc.
It is recommended to test the installation by creating a dummy template project and building it.
Download one of the BSP Examples from Xilinx Website (Only to test your installation)
Install:$ petalinux-create -t project -s <path-to-bsp>
Build: $ petalinux-build
Info |
---|
Some reference designs contains a preconfigured PetaLinux project as template. This can be used instead of creating a new project described on step 2. Basic Note to TE Petalinux Templates, see: PetaLinux TE-Template#PetaLinux2021.2 New with 2021.2 and newer:
New with 2020.2 and newer:
|
"/bin/sh" is bash
$ petalinux-create --type project --template <CPU_TYPE> --name <PROJECT_NAME>
Most settings can be changed with menu-config:
Manual changes can be done in the subfolder "<plnx-proj-root>/project-spec/meta-user/"
CONFIG |
|
|
U-Boot |
|
|
Device Tree |
|
|
Kernel |
|
|
Apps |
|
|
ROOTFS |
|
|
Xilinx generated configuration |
| Note: config and rootfs_config are shared at the moment, they include user and xilinx default changes from XSA import |
(optional) Create new VM with supported Linux OS.
Attention: Use English as OS language for your Linux System (Keyboard language can be any language). Other languages may cause errors on PetaLinux build process.
with OracleVM:
VM Setup:
RAM: >= 8GB
CPU: >= 4
HDD: 200GB dynanically
ubuntu-18.04-desktop-amd64.iso
install vm guest additions
update to 18.04.5 was done
Network: network bridge
optional: add shared folder, enable drag and drop
Info | ||
---|---|---|
| ||
Download PetaLinux from Xilinx Website: http://www.xilinx.com/support/download/index.html/content/xilinx/en/downloadNav/embedded-design-tools.html
Choose a PetaLinux Version, that's corresponding to the installed Vivado and SDK Version.
Example: Use Vitis (SDK+Vivado)
...
2021.2 with PetaLinux 2020.2
Use UG1144 "PetaLinux Tools Documentation - Reference Guide" that's corresponding with your PetaLinux Version
Use bash as terminal:
$ sudo dpkg-reconfigure dash
→ press no
Check "PetaLinux Tools Installation Requirements" chapter and install missing tool/libraries
https://www.xilinx.com/support/answers/73296.html
download plnx-env-setup.sh and run
$
sudo apt-get update
$
sudo apt-get install iproute2 gawk python3 python build-essential gcc git make net-tools libncurses5-dev tftpd zlib1g-dev libssl-dev flex bison libselinux1 gnupg wget git-core diffstat chrpath socat xterm autoconf libtool tar unzip texinfo zlib1g-dev gcc-multilib automake zlib1g:i386 screen pax gzip cpio python3-pip python3-pexpect xz-utils debianutils iputils-ping python3-git python3-jinja2 libegl1-mesa libsdl1.2-dev pylint3 -y
Install petalinux (Note: do not start from shared folder, copy installer into home directory)
$ mkdir -p ~/petalinux/2020.2
$ ./petalinux-v2020.2-final-installer.run
source enviroment
$ source ~/petalinux/2020.2/settings.sh
Deactivate Webtalk:
$ petalinux-util --webtalk off
Note:
There is no need to install anything else, or to fetch anything from any github repos, etc.
It is recommended to test the installation by creating a dummy template project and building it.
Download one of the BSP Examples from Xilinx Website (Only to test your installation)
Install:$ petalinux-create -t project -s <path-to-bsp>
Build: $ petalinux-build
Info |
---|
Some reference designs contains a preconfigured PetaLinux project as template. This can be used instead of creating a new project described on step 2. Basic Note to TE Petalinux Templates, see: PetaLinux TE- |
...
New with 2020.2:
|
...
|
"/bin/sh" is bash
$ petalinux-create --type project --template <CPU_TYPE> --name <PROJECT_NAME>
Most settings can be changed with menu-config*:
* with 2020.2 kernel and u-boot changes must be exported to the user-layer with petalinux-devtool command.
Manual changes can be done in the subfolder "<plnx-proj-root>/project-spec/meta-user/"
CONFIG |
|
|
U-Boot |
|
|
Device Tree |
|
|
Kernel |
|
|
Apps |
|
|
ROOTFS |
|
|
Children Display |
---|
...
PetaLinux Tools Documentation - PetaLinux Command Line Reference (UG1157)
...
Xilinx generated configuration |
| Note: config and rootfs_config are shared at the moment, they include user and xilinx default changes from XSA import |
...
$
sudo apt-get update$
sudo apt-get install tofrodos iproute2 gawk make net-tools libncurses5-dev tftpd zlib1g:i386 libssl-dev flex bison libselinux1 gnupg wget diffstat chrpath socat xterm autoconf libtool tar unzip texinfo zlib1g-dev gcc-multilib build-essential screen pax gzip python 2.7.5 -y$ sudo chown <owner>:<owner> /opt/
Info |
---|
Some reference designs contains a preconfigured PetaLinux project as template. This can be used instead of creating a new project described on step two. Basic Note to TE Petalinux Templates, see: PetaLinux TE-Template#Template-PetaLinux2019.2 |
"/bin/sh" is bash
$ petalinux-create --type project --template <CPU_TYPE> --name <PROJECT_NAME>
Most settings can be changed with menu-config:
Manual changes can be done in the subfolder "<plnx-proj-root>/project-spec/meta-user/"
U-Boot |
| overwrite, add UBoot settings |
Device Tree |
| overwrite, add device tree attributes |
Kernel |
| changes with "petalinux-config -c kernel" will be add here automatically |
Apps |
| add simple new app with "petalinux-create -t apps -n myapp --enable" enable/disable with "petalinux-config -c rootfs" |
Info |
---|
Some reference designs contains a preconfigured PetaLinux project as template. This can be used instead of creating a new project described on step two. Basic Note to TE Petalinux Templates, see: PetaLinux TE-Template#Template-PetaLinux2018.3 |
"/bin/sh" is bash
$ petalinux-create --type project --template <CPU_TYPE> --name <PROJECT_NAME>
Most settings can be changed with menu-config:
Manual changes can be done in the subfolder "<plnx-proj-root>/project-spec/meta-user/"
U-Boot | recipes-bsp/u-boot/files/platform-top.h | overwrite, add UBoot settings |
Device Tree | recipes-bsp/device-tree/files/system-user.dtsi | overwrite, add device tree attributes |
Kernel | recipes-kernel/linux/linux-xlnx/ | changes with "petalinux-config -c kernel" will be add here automatically |
Apps | project-spec/meta-user/recipes-apps | add simple new app with "petalinux-create -t apps -n myapp --enable" enable/disable with "petalinux-config -c rootfs" |
Info | ||
---|---|---|
Some reference designs contains a preconfigured PetaLinux project as template. This can be used instead of creating a new project described on step two.
|
"/bin/sh" is bash
$ petalinux-create --type project --template <CPU_TYPE> --name <PROJECT_NAME>
Most settings can be changed with menu-config ($ petalinux-config, petalinux-config -c kernel, petalinux-config -c rootfs).
Manual changes can be done in the subfolder "<plnx-proj-root>/project-spec/meta-user/"
U-Boot | recipes-bsp/u-boot/files/platform-top.h | overwrite, add UBoot settings |
Device Tree | recipes-bsp/device-tree/files/system-user.dtsi | overwrite, add device tree attributes |
Kernel | recipes-kernel/linux/linux-xlnx/ | changes with "petalinux-config -c kernel" will be add here automatically |
Info | ||
---|---|---|
Some reference designs contains a preconfigured PetaLinux project as template. This can be used instead of creating a new project described on step two.
|
"/bin/sh" is bash
$ petalinux-create --type project --template <CPU_TYPE> --name <PROJECT_NAME>
Most settings can be changed with menu-config ($ petalinux-config, petalinux-config -c kernel, petalinux-config -c rootfs).
Manual changes can be done in the subfolder "<plnx-proj-root>/project-spec/meta-user/"
U-Boot | recipes-bsp/u-boot/files/platform-top.h | overwrite, add UBoot settings |
Device Tree | recipes-bsp/device-tree/files/system-user.dtsi | overwrite, add device tree attributes |
Kernel | recipes-kernel/linux/linux-xlnx/ | changes with "petalinux-config -c kernel" will be add here automatically |
Info | ||
---|---|---|
Some reference designs contains a preconfigured PetaLinux project as template. This can be used instead of creating a new project described on step two.
|
Most settings can be changed with menu-config ($ petalinux-config, petalinux-config -c kernel, petalinux-config -c rootfs).
Manual changes can be done in the subfolder "<plnx-proj-root>/project-spec/meta-user/"
U-Boot | recipes-bsp/u-boot/files/platform-top.h | overwrite, add UBoot settings |
Device Tree | recipes-bsp/device-tree/files/system-user.dtsi | overwrite, add device tree attributes |
Kernel | recipes-kernel/linux/linux-xlnx/ | changes with "petalinux-config -c kernel" will be add here automatically |
Info | ||
---|---|---|
Some reference designs contains a preconfigured PetaLinux project as template. This can be used instead of creating a new project described on step two.
|
Most settings can be changed with menu-config ($ petalinux-config, petalinux-config -c kernel, petalinux-config -c rootfs).
Manual changes can be done in the subfolder "<plnx-proj-root>/project-spec/meta-user/"
U-Boot | recipes-bsp/u-boot/files/platform-top.h | overwrite, add UBoot settings |
Device Tree | recipes-bsp/device-tree/files/system-user.dtsi | overwrite, add device tree attributes |
Kernel | recipes-kernel/linux/linux-xlnx/ | changes with "petalinux-config -c kernel" will be add here automatically |
Info | ||
---|---|---|
Some reference designs contains a preconfigured PetaLinux project as template. This can be used instead of creating a new project described on step two.
|
Most settings can be changed with menu-config ($ petalinux-config, petalinux-config -c kernel, petalinux-config -c rootfs).
Manual changes can be done in the subfolder "<plnx-proj-root>/project-spec/meta-user/"
U-Boot | recipes-bsp/u-boot/files/platform-top.h | overwrite, add UBoot settings |
Device Tree | recipes-dt/device-tree/files/system-top.dts | overwrite, add device tree attributes |
Kernel | recipes-kernel/linux/linux-xlnx/ | changes with "petalinux-config -c kernel" will be add here automatically |
Info |
---|
Some reference designs contains a preconfigured PetaLinux project as template. This can be used instead of creating a new project described on step two. |
Most settings can be changed with menu-config ($ petalinux-config).
There are 3 more files that user can edit, they are
File | Description | Location |
---|---|---|
system-top.dts | Device tree changes are to be applied here | <petalinux-project>/subsystems/linux/configs/device-tree |
platform-top.h | U-boot changes are to be applied here | <petalinux-project>/subsystems/linux/configs/u-boot |
fsbl_hooks.c | FSBL changes are to be applied here | SDK/HSI FSBL-Template |
There should be no reason to modify any other files by editing them (most of them are generated and would be overwritten).