1. Introduction
Since the ZYNQ ARM side needs to be tested for Linux development in the near future, Petalinux tools need to be used for customization, so this article briefly summarizes the Petalinux installation process, and explains and solves some problems encountered during the installation process.
Petalinux is an embedded Linux custom software developed by Xilinx, which simplifies the development of Linux systems by working with Vivado. Developers can customize u-boot, Linux kernel and Linux applications through Petalinux, and can add new kernels, device drivers, applications and libraries, as well as launch and test software protocols on full-system emulators or physical hardware via network or JTAG The stack completes all operations from system startup to execution.
The Xilinx official website provides the Petalinux download address Petalinux Download and the installation guide Petalinux Reference Guide . For the specific installation process, please refer to the installation guide.
2. Petalinux installation process
- Download the Petalinux suite installation package petalinux-v<version number>-final-installer.run from the official website . Taking 2017.4 as an example, put the installation package in the Download directory:
- Add executable permissions to the installation package:
sudo chmod +x petalinux-v2017.4-final-installer.run
- Install the corresponding dependent packages, otherwise it will prompt that there are no relevant dependencies during the installation process. The specific dependent packages can be found in the reference guide :
Ubuntu system:
sudo apt-get install -y tofrodos gawk xvfb git make net-tools libncurses5-dev tftpd \
zlib1g-dev 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
Redhat/CentOS system
sudo yum install gawk make wget tar bzip2 gzip python unzip perl patch diffutils \
diffstat git cpp gcc gcc-c++ glibc-devel texinfo chrpath socat perl-Data-Dumper \
perl-Text-ParseWords perl-Thread-Queue python34-pip xz which SDL-devel xterm autoconf \
libtool zlib-devel automake glib2-devel zlib ncurses-devel openssl-devel dos2unix flex \
bison glibc.i686 screen pax glibc-devel.i686 compat-libstdc+-33.i686 libstdc+.i686
Wait for the installation to complete:
- Install python and tftp server, otherwise it will affect the installation, the specific impact will be introduced in detail in the third part:
sudo apt-get install -y python tftpd-hpa
- Create the Petalinux installation directory, this article is created in the /opt/ directory:
sudo mkdir -p /opt/petalinux/2017.4/
- Change the permission owner for the installation path, the opt directory is under root, and associate the installation directory with the user name:
sudo chown carson /opt/petalinux/2017.4/
- Run the installation command at the location of the installation package to complete the installation of Petalinux in non-administrator mode :
./petalinux-v2017.4-final-installer.run /opt/petalinux/2017.4/
- During the installation process, a series of license agreement interface will pop up, press Enter to enter the interface, q to exit the agreement, and y to agree to the content of the agreement:
Enter to read the agreement:
The 'q' key quits the protocol:
'y' agrees to the content of the agreement:
The 'q' key quits the protocol:
'y' agrees to the content of the agreement:
The 'q' key quits the protocol:
'y' agrees to the content of the agreement and waits for the installation to complete:
3. Installation common problems and solutions
1. An error message "ERROR: You are PetaLinux installation guide - required tools and libraries package section for detailed information" is reported during the installation process
Cause of the problem: The dependent package is not fully installed, and the related dependent package is missing, for example, the python library is missing here:
Solution: Follow the prompts to install the corresponding installation package:
sudo apt-get install -y python
2. The installation process warning "WARNING: No tftp server found - please refer to "PetaLinux SDK Installation Guide" for its impact and solution"
Cause of the problem: tftp server is not installed, tftp provides faster boot startup than JTAG, the official document explains as follows:
Solution: install tftp server and provide corresponding read and write permissions:
sudo apt-get install tftpd-hpa ##安装tftp server
sudo mkdir -p /var/lib/tftpboot/ ##创建tftpboot启动目录
sudo chmod 777 /var/lib/tftpboot/ ##为启动目录添加权限
sudo vim /etc/default/tftpd-hpa ##更改tftpboot启动配置内容
The default configuration of tftpd-hpa is as follows:
Configure it to the new directory:
Restart the tftp server service:
sudo service tftpd-hpa restart
3. 安装过程报错 “ERROR: You have tools don’t meet the version requirements: -Detected python version is less than the expected 2.7.3”
The cause of the problem: The python version is too low or installed as python3. Since there are many updates to python3, python2.7 (python2.7.3 and above) is still used here
Solution: If the python version is python3, install python2.7.17 and set it as the default:
##查看python版本
python --version
##安装python2.7
sudo apt-get install -y python
##更改python软链接为python2.7
cd /usr/bin #进入python所在目录
sudo rm python #将原有python文件删除
sudo ln -s python2.7 python #将python链接到python2.7
If the problem is still not resolved, you need to change the status file under /var/lib/dpkg:
cd /var/lib/dpkg #进入/var/lib/dpkg目录
sudo vi status #用vim修改status文件,若未安装vim需提前安装
Search to the python package section and add the following before ( vi/vim search and edit method ):
Package: python
Status: install ok installed
Maintainer: Fake Entry <[email protected]>
Architecture: all
Version: 2.7.17
Description: fake package for petalinux
Save and exit and run again to complete the installation successfully.
4. Error "libncursesw.so.5: cannot open shared object file: No such file or directory" is reported during the running process
Cause of the problem: The libncursesw.so.5 file is missing, and libncursesw.so.5 cannot be found under /lib/x86_64-linux-gnu and /lib32
Workaround: Search for libnursesw.so.5 to see if this file exists:
sudo apt install apt-file
sudo apt-file update
sudo apt-file find libncursesw.so.5
If the file cannot be found, the libncursesw library needs to be reinstalled:
sudo apt-get install libncursesw5
ncursesw (libncursesw.so.5) adds support for utf8 character set on the basis of ncurses (libncurses.so.5), and can support Chinese, so if there is Chinese in the software, errors may be reported during operation : utf8 is not supported.