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.
Getting 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 is under review documentation for 2023.2 can be changed permanently at the moment (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 Alternative to Oracle VM 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) 2023.2 with PetaLinux 2023.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 Install packages(see https://support.xilinx.com/s/article/000035572?language=en_US → PetaLinux_2023.2_OS_Package_List.xlsx) Note: From excel additional to python3 also python was recommended which is not longer possible to install sudo apt-get install iproute2 gawk python3 build-essential gcc git make net-tools libncurses5-dev tftpd zlib1g-dev libssl-dev flex bison libselinux1 gnupg wget git 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 pylint bc libtinfo5 subversion u-boot-tools -y Install petalinux (Note: do not start from shared folder, copy installer into home directory) $ sudo chown <owner>:<owner> /tools/Xilinx $ ./xsetup source enviroment $ source /tools/Xilinx/PetaLinux/2023.2/tool/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 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#PetaLinux2023.2 New with 2023.2 and newer: 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/" PetaLinux Tools Documentation - PetaLinux Command Line Reference (UG1157)Petalinux Project Creation- Short HOWTO
PetaLinux 2023.2
PetaLinux Installation
Creating a Project from Vivado Project
Petalinux Configuration
Use local sstate cache and downlods
Configuration menues and files
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 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
Alternative to Oracle VM
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
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
Alternative to Oracle VM
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
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
Alternative to Oracle VM
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
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#PetaLinux2020.2
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 |
|
|
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/
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" |
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" |
Some reference designs contains a preconfigured PetaLinux project as template. This can be used instead of creating a new project described on step two.
Some 18.2 designs include "./init_config.sh" to change directory path (CONFIG_TMP_DIR_LOCATION on <plnx-proj-root>/project-spec/configs/config). This is not longer necessary with petalinux 2018.2. this files will be removed on later updates
"/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 |
Some reference designs contains a preconfigured PetaLinux project as template. This can be used instead of creating a new project described on step two.
PetaLinux 17.4 is using one absolute path in "<plnx-proj-root>/project-spec/configs/config
Change path of CONFIG_TMP_DIR_LOCATION variable to your project path "<plnx-proj-root>/build/tmp" manually or use provided "./init_config.sh" to change path variable automatically. If missing, change execution rights for init_config.sh with chmod
"/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 |
Some reference designs contains a preconfigured PetaLinux project as template. This can be used instead of creating a new project described on step two.
PetaLinux 17.2 is using one absolute path in "<plnx-proj-root>/project-spec/configs/config
Change path of CONFIG_TMP_DIR_LOCATION variable to your project path "<plnx-proj-root>/build/tmp" manually or use provided "init_config.sh" to change path variable automatically.
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 |
Some reference designs contains a preconfigured PetaLinux project as template. This can be used instead of creating a new project described on step two.
PetaLinux 17.1 is using one absolute path in "<plnx-proj-root>/project-spec/configs/config
Change path of CONFIG_TMP_DIR_LOCATION variable to your project path "<plnx-proj-root>/build/tmp" manually.
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 |
Some reference designs contains a preconfigured PetaLinux project as template. This can be used instead of creating a new project described on step two.
PetaLinux 16.4 is using one absolute path in "<plnx-proj-root>/project-spec/configs/config
Change path of CONFIG_TMP_DIR_LOCATION variable to your project path "<plnx-proj-root>/build/tmp" manually.
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 |
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).