Install Petalinux2022.1 on ubuntu
---
1.update your ubuntu , then set your sw environment for installing
```
sudo apt-get update
sudo dpkg --add-architecture i386 && sudo apt update && sudo apt install -y gawk wget git diffstat unzip texinfo gcc-multilib build-essential chrpath socat cpio python3 python3-pip python3-pexpect xz-utils debianutils iputils-ping libsdl1.2-dev tofrodos net-tools zlib1g:i386 zlib1g-dev libncurses5-dev libssl-dev libtool locales libglib2.0-dev libarchive-dev autoconf flex bison libselinux1 xterm
```

2.install tftp Server , and then restart it .
```
sudo apt-get install tftpd-hpa
service tftpd-hpa restart
```
3.Downoad petalinux-2022.1 package from xilinx , and then copy to your ubuntu by MobaXterm
https://www.xilinx.com/support/download/index.html/content/xilinx/en/downloadNav/embedded-design-tools/archive.html


Here , I make a folder named petalinux in home for this whole environment.
In folder "petalinux" , I create a "install" folder for insatlling . (this step is not essential )
4.Go to the path where you put the petalinux package.
```
cd ~/petalunx/install
ls -l
```

5.Setup permission ,and install it by .run file
```
chmod +x petalinux-v2022.1-04191534-installer.run
./petalinux-v2022.1-04191534-installer.run --dir ~/petalinux/2022.1
```
When start installing , it will tell you to click "Enter" to show the xilinx's license. Just follow it .The just press "q" to close ,and "y" to agree.

6.After above , you can check whether the petalinux is installed successfully .
```
source ~/petalinux/2022.1/settings.sh
```

And you can check if the environment is set.
```
echo $PETALINUX
```

---
ref : http://www.hellofpga.com/index.php/2025/05/21/petalinux2022-1_install/
Install share-state cache
---
1.Download the package on AMD's website (select 2022.1)

link: https://www.xilinx.com/support/download/index.html/content/xilinx/en/downloadNav/embedded-design-tools/archive.html
2.Copy to your vm (ubuntu) by sharing folder
VM's setting -> share folder

The folder will occur at media (in root list), you can copy to your petalinux folder

3. Unzip the package
```
tar -xzvf sstate_aarch64_2022.1_04190222.tar.gz
tar -xzvf downloads_2022.1_04190222.tar.gz
```
Install SDK (cross compiler)
---
1.You need to clone the vitis-ai 2.5 repository from github
ref : https://github.com/Xilinx/Vitis-AI/tree/2.5/setup/mpsoc
```
git clone --branch 2.5 https://github.com/Xilinx/Vitis-AI.git
```

2.go to the setting folder , and run script
```
cd Vitis-AI/setup/mpsoc
./host_cross_compiler_setup.sh
```
3.Then click "enter" to continue

4.If success , you can find the folder at your home list

Install common image
---
1.Download package from AMD's website (2022.1)
https://www.xilinx.com/support/download/index.html/content/xilinx/en/downloadNav/embedded-design-tools/archive.html

2.copy to your ubuntu

3.unzip
```
tar -xzvf xilinx-zynqmp-common-v2022.1_04191534.tar.gz
```
4. Run the script
```
cd xilinx-zynqmp-common-v2022.1/
./sdk.sh
```
5.Select the install target to current path , and keep continue
