One of the great things about AMD System on Chips and FPGAs is the ability to leverage processing elements. Within SoCs this is of course hard core processors implemented within the silicon, while for FPGAs it is softcore processors implemented within the programmable logic fabric.
For simple engineering tasks we can use bare metal software development. However, for more complex applications which require features such as networking, file systems, leveraging a wide range of drivers and frameworks an embedded Linux solution provides the most optimal solution.
If you have never before worked with PetaLinux, it might at first seem daunting to create a system which enables you to build a embedded Linux solution for your AMD SoC or FPGA. This might be as you need to create a Linux system to enable the creation and cross compilation of the embedded Linux solution. If you do not develop your FPGA based solutions on a Linux machine this requires the creation of a virtual machine running an Linux distribution.
In this project we are going to look at how we can create a Linux virtual machine and install the PetaLinux and use it it create embedded Linux solutions for our AMD devices.
Creating the Virtual MachineThe first step on this journey is to create a virtual machine which is running a Linux distribution.
We can create these VMs pretty simply, there are a couple of things we need to consider however.
- The size of the hard disk we need for the virtual machine and if our host machine has the spare disk volume available.
- The allocation of processors and RAM available for the virtual machine.
While there is little I can do about the second point, apart from building a new more powerful machine. I use an external USB C solid state hard disk to store the hard disk created by the virtual machine.
For this example I am going to get started using the VMWare workstation player. This will enable us to easily create a Virtual Machine which is running a Linux distribution on a Windows machine.
We can download the VM workstation Player here
Clicking on download for free will take you to a download page.
From here you can select the version you require depending upon the host operating system.
Once the binary is available we can then run it to install the VM Workstation Player
Follow the installation steps on the dialog
Read the license and agree if you accept the End User Agreement
Check the option to install the Windows Hyper Visor Platform
Add VMWare Workstation console to the system PATH
Uncheck the product updates and customer experience improvement program
Check the options for desktop and start menu program folder
Click install
Installation might a few minutes
Click on finished
Once the installation is complete we will be able to create a new virtual machine, But first we need to determine what Linux distribution to create on the virtual machine.
Creating Linux Virtual MachineThe virtual machine we create needs to be running one of the supported PetaLinux distributions and that is has the necessary workstation requirements.
We can find the list of workstation requirements and supported Linux distributions within UG1144.
Minimum workstation requirements:
- 8 GB RAM (recommended minimum for AMD tools)
- 2 GHz CPU clock or equivalent (minimum of eight cores)
- 100 GB free HDD space
Supported OS:
- Completely removed RHEL and CENTOS to align with upstream Yocto.
- Ubuntu Desktop/Server 18.04.1 LTS, 18.04.2 LTS, 18.04.3 LTS, 18.04.4 LTS, 18.04.5 LTS, 18.04.06 LTS, 20.04.2 LTS, 20.04.3 LTS, 20.04.4 LTS, 20.04.5 LTS(64-bit), 20.04.6 LTS, 22.04 LTS, 22.04.1 LTS and 22.04.2 LTS
- OpenSuse Leap 15.3 and 15.4
- AlmaLinux 8.7 and 9.1
For this virtual machine I am going to install, Ubuntu desktop 20.04.4 LTS available here.
Once the ISO is downloaded we are then able to create the virtual machine. Start the VMware
This will start the installation process
Once the machine is created we are able to log in and start working with the linux system
If we want to make changes to the number of processors or RAM allocated to the virtual machine we can edit the machines settings while the VM is not running.
Having made the changes to the RAM and number of processors, re start the machine and log into your account and open a new terminal window.
To ensure we have all of the necessary packages installed, we can review the PetaLinux 2023.2 - Product Update Release Notes and Known Issues which contains a spreadsheet for download.
This spreadsheet contains the commands necessary to install all of the installation packages. For the Ubuntu desktop we are using we can use the following command copied from the spreadsheet.
You should be able to copy and paste easily between the host machine and the virtual machine.
Installing these packages will take a few minutes.
Once this is completed we are able to download and install PetaLinux, for this we will need a AMD account.
Using an internet browser from within your Virtual Machine go to the PetaLinux downloads page and download the installer
Downloading the PetaLinux installer will take a few minutes to download.
Once downloaded we are able to install PetaLinux.
PetaLinux InstallationIn the downloaded file location we should now have the installer image.
Copy this to the location you wish to install PetaLinux, I normally create a folder in the home directory with named PetaLinux_<Version>
This enables me to have several different versions installed.
Ensure the installer is able to be executed
Open a terminal in the folder where the installer is and run the command
./
This will check the disk space and other requirements and begin to install PetaLinux.
The next stage of the installation is to read and agree the licenses
This will be followed by asking you to confirm the installation directory - type y
If you see a warning about the installation directory being not empty (as the installer application is located there also) type y
The installation will then start and will take several minutes
Once completed the prompt will return.
We are now in the position that we can start working with PetaLinux for projects such as
To get started using PetaLinux we need to source the settings.sh file in a terminal which has just been installed.
We are now ready to start creating and working with PetaLinux, if you want to know more about how to leverage Petalinux in your projects. I did a webinar on working with PetaLinux which can be watched below
Wrap UpIn this project we have learned how to create a virtual machine which runs a Linux Distribution that we can install the AMD Embedded Linux development environment PetaLinux.
Now we are ready to get started with our developments?
Comments