---
# System prepended metadata

title: Build up Petalinux workspace on ubuntu

---


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
```
![image](https://hackmd.io/_uploads/HJQqAl0x-x.png)

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

![image](https://hackmd.io/_uploads/By-ByZAlbl.png)
![image](https://hackmd.io/_uploads/ry6ikZAl-x.png)
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
```
![image](https://hackmd.io/_uploads/Hk3bbW0eZe.png)


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.
![image](https://hackmd.io/_uploads/ryYfzbRe-g.png)

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

![image](https://hackmd.io/_uploads/S1kazWAebl.png)
And you can check if the environment is set.
```
echo $PETALINUX
```
![image](https://hackmd.io/_uploads/rkogXbRgZg.png)


---
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)
![未命名](https://hackmd.io/_uploads/S1LLVSxWZg.png)

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 
![image](https://hackmd.io/_uploads/rJchzqr-Ze.png)
The folder will occur at media (in root list), you can copy to your petalinux folder
![image](https://hackmd.io/_uploads/HyRem5SWZe.png)

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
```
![image](https://hackmd.io/_uploads/S1Fo49rWbl.png)

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
![image](https://hackmd.io/_uploads/SkFJ8qrZ-x.png)

4.If success , you can find the folder at your home list
![image](https://hackmd.io/_uploads/HJQ7L5rb-e.png)

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
![未命名](https://hackmd.io/_uploads/S1jALcBZWg.png)

2.copy to your ubuntu
![image](https://hackmd.io/_uploads/SJUJO5B-be.png)

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
![image](https://hackmd.io/_uploads/HJv6ocHbbx.png)



