Translate

Monday, 26 November 2018

How to install PetaLinux



Hi !

In the previous post we installed Xilinx Vivado 2018.2 for FPGA generation and Xilinx SDK 2018.2 for software developements.

Now in this post we are going to install Xilinx PetaLinux 2018.2.

PetaLinux is provided by Xilinx and you can find all the relative information here : Xilinx PetaLinux page


Read This !

This post describes procedures that manipulate a big installation file (6.5GB) in a virtual environment !

So some steps provided in this post may be quite long, depending on your computer configuration !!

If you don't want to lose too much time I encourage you to follow the steps in the provided order.



Here are the main sections of this post for a quick jump :







Step 1 : Download installation files


The first thing to do is to get the installation files for the PetaLinux 2018.2 version.


Stage 1


You must go the to Xilinx's website : Xilinx WebSite : PetaLinux 2018.2 Download

You're in the Embedded Development Section, then scroll down to the PetaLinux - Installation Files - 2018.2

Finally click on the PetaLinux 2018.2 Installer.

The file is 6.5GB !




Stage 2


This will launch the download, but first you have to login to your Xilinx account.

Fill Username, Password and then click on Sign In.




Confirm your personnal data and press Sign In for the download to begin.


Stage 3


You will be requested to provide the destination folder where the installation file will be stored.

As it will be launched in the VM under Ubuntu, you need to store the installer in the shared folder we created.

This will let us access the installer file from Ubuntu.








Step 2 : Creating the installation folder for the Xilinx PetaLinux Tool


Ok, now it's time to switch to Ubuntu.

So open your Virtual Machine and log in to Ubuntu.


Stage 1


First we need to create the destination installation folder as follow :

sudo mkdir /opt/petalinux-v2018.2-final


Then, as we did for the /opt folder, we are going to give the rights to the installation folders.

Reminder: The following table gives an explanation of a change mod command using letters.




So the chmod command for the Xilinx PetaLinux tool installation folder will be :


sudo chmod -R ugo+w /opt/petalinux-v2018.2-final


you may need to create the group with the following command


sudo addgroup mtvl


and then


sudo chown -R mtvl:mtvl /opt/petalinux-v2018.2-final


Which recursively gives to the Mtvl user group the write permission to this repository.




As you can see on the previous screenshot the Xilinx Tools folder does not have all the expected rights!

To correct this we give the same rights with :

sudo chmod -R ugo+w /opt/Xilinx


Now we have :




Ok, now everything is set up.






Step 3 : Install the Xilinx PetaLinux Tool



MANDATORY !

Before going further in the installation process you have to apply the following steps otherwise the installation will FAIL !

- First, set the BASH shell : Follow the steps of this post :
Set Ubuntu shell for Xilinx PetaLinux

- Second, automatically set up the PetaLinux environment with the steps of this post :
How to automatically configure the PetaLinux environment

- Third, customize Ubuntu to provide everything needed by PetaLinux with the steps of this post :
How to customize Ubuntu for Xilinx PetaLinux


Stage 1


The first thing to do is to copy the installer file from the shared folder to a folder where we have permissions. This is because the installer file will be extracted and we have to write in that folder.

As the destination installation folder is placed in /opt, I propose to move the installer file there.




Ok, then we can launch the installation process with the following command :

cd /opt

./petalinux-v2018.2-final-installer.run /opt/petalinux-v2018.2-final



In a first step the installer will check the integrity of the file, which takes several minutes (7 minutes on my computer).

Then it will extract the file (6 minutes on my computer).




Stage 2


Then comes the license agreement steps.




So as it says, press Enter.


Stage 3


A first License text is displayed.




To read the whole text use your mouse or page up/down.

When finished press q.

Which leads you to this license approval request.




Just press y then Enter.

You will be requested to accept two more licences texts like this one.

Use the same procedure, read the text, press y and Enter.


Stage 4


Then the installation procedure starts, expect to spend some time waiting in front of your computer !!!

Here is the log where you can check steps

mtvl@mtvl-VirtualBox:/opt$ ./petalinux-v2018.2-final-installer.run ./petalinux-v2018.2-final/

INFO: Checking installer checksum...

INFO: Extracting PetaLinux installer...

LICENSE AGREEMENTS

PetaLinux SDK contains software from a number of sources. Please review

the following licenses and indicate your acceptance of each to continue.

You do not have to accept the licenses, however if you do not then you may

not use PetaLinux SDK.

Use PgUp/PgDn to navigate the license viewer, and press 'q' to close

Press Enter to display the license agreements

Do you accept Xilinx End User License Agreement? [y/N] > y

Do you accept Webtalk Terms and Conditions? [y/N] > y

Do you accept Third Party End User License Agreement? [y/N] > y

INFO: Checking installation environment requirements...

INFO: Checking free disk space

INFO: Checking installed tools

INFO: Checking installed development libraries

INFO: Checking network and other services

WARNING: No tftp server found - please refer to "PetaLinux SDK Installation Guide" for its impact and solution

INFO: Installing PetaLinux...

INFO: Checking PetaLinux installer integrity...

INFO: Installing PetaLinux SDK to "./petalinux-v2018.2-final//."

................................................................................................................................................................................................................................................................................INFO: Installing aarch64 Yocto SDK to "./petalinux-v2018.2-final//./components/yocto/source/aarch64"...

PetaLinux Extensible SDK installer version 2018.2

=================================================

You are about to install the SDK to "/opt/petalinux-v2018.2-final/components/yocto/source/aarch64". Proceed[Y/n]? Y

Extracting SDK................................done

Setting it up...

Extracting buildtools...

done

SDK has been successfully set up and is ready to be used.

Each time you wish to use the SDK in a new shell session, you need to source the environment setup script e.g.

 $ . /opt/petalinux-v2018.2-final/components/yocto/source/aarch64/environment-setup-aarch64-xilinx-linux

INFO: Installing arm Yocto SDK to "./petalinux-v2018.2-final//./components/yocto/source/arm"...

PetaLinux Extensible SDK installer version 2018.2

=================================================

You are about to install the SDK to "/opt/petalinux-v2018.2-final/components/yocto/source/arm". Proceed[Y/n]? Y

Extracting SDK..............................done

Setting it up...

Extracting buildtools...

done

SDK has been successfully set up and is ready to be used.

Each time you wish to use the SDK in a new shell session, you need to source the environment setup script e.g.

 $ . /opt/petalinux-v2018.2-final/components/yocto/source/arm/environment-setup-cortexa9hf-neon-xilinx-linux-gnueabi

INFO: Installing microblaze_full Yocto SDK to "./petalinux-v2018.2-final//./components/yocto/source/microblaze_full"...

PetaLinux Extensible SDK installer version 2018.2

=================================================

You are about to install the SDK to "/opt/petalinux-v2018.2-final/components/yocto/source/microblaze_full". Proceed[Y/n]? Y

Extracting SDK.............................done

Setting it up...

Extracting buildtools...

done

SDK has been successfully set up and is ready to be used.

Each time you wish to use the SDK in a new shell session, you need to source the environment setup script e.g.

 $ . /opt/petalinux-v2018.2-final/components/yocto/source/microblaze_full/environment-setup-microblazeel-v10.0-bs-cmp-re-mh-div-xilinx-linux

INFO: Installing microblaze_lite Yocto SDK to "./petalinux-v2018.2-final//./components/yocto/source/microblaze_lite"...

PetaLinux Extensible SDK installer version 2018.2

=================================================

You are about to install the SDK to "/opt/petalinux-v2018.2-final/components/yocto/source/microblaze_lite". Proceed[Y/n]? Y

Extracting SDK.............................done

Setting it up...

Extracting buildtools...

done

SDK has been successfully set up and is ready to be used.

Each time you wish to use the SDK in a new shell session, you need to source the environment setup script e.g.

 $ . /opt/petalinux-v2018.2-final/components/yocto/source/microblaze_lite/environment-setup-microblazeel-v10.0-bs-cmp-re-ml-xilinx-linux

INFO: PetaLinux SDK has been installed to ./petalinux-v2018.2-final//.

mtvl@mtvl-VirtualBox:/opt$






Stage 7


Ok, the Xilinx PetaLinux tool is installed.

To check that every thing is set up let's try to launch a create command.




Ok fine !

The command is recognized and launched. As the command has no arguments, PetaLinux displays the help of the command.

Well, now all the tools are ready, we can start designing !





Post Conclusion

Now we have :

- Prepared the system to enable the PetaLinux tool installation.
- Installed the PetaLinux tool.

Thursday, 22 November 2018

How to customize Ubuntu for Xilinx PetaLinux



Hi !


If you want to run Xilinx PetaLinux on Ubuntu then you need to add resources to Ubuntu.

That's what we will do in this post !



Here are the main sections of this post for a quick jump :







Step 1 : Install Additionnal System Tools and Library Dependencies


These installations are madatory in order to run the Xilinx PetaLinux tool on Ubuntu.

Otherwise you will get this type of error if you launch the PetaLinux installation :




To proceed with the installation, use the following command line :

Read This !

Beware to copy this command in a single line !

sudo apt-get --yes install tofrodos iproute gawk gcc git-core make net-tools libncurses5-dev tftpd zlib1g-dev flex bison lib32z1 lib32ncurses5 lib32ncursesw5 lib32gomp1 xvfb chrpath socat autoconf libtool texinfo gcc-multilib libsdl1.2-dev libglib2.0-dev zlib1g:i386 libssl-dev


And there it goes :



Just wait for this installation run to finish.






Step 2 : Add the TFTP tool


TFTP (Trivial File Transfert Protocol) is a light protocol for files transfer over an ethernet link.

In our case it will let us transfer files between Ubuntu running on my computer to the PetaLinux running on the MiniZed Board.

This will be very convenient for Linux files, files stored in embedded flash memories or FPGA's bitstream update.


Stage 1


First we need to install the TFTP tool in Ubuntu.

Use the following command :

sudo apt-get install xinetd tftpd tftp


You should get the following log after you provide your sudo password.




Stage 2


The next step is to create the TFTP entry for the xinetd service.

First let's create the empty file with the following command:

sudo touch /etc/xinetd.d/tftp


As we don't have permission in the /etc/xinetd.d/ folder and we need to modify the tftp file we have to give the permission to the file with the following command :

sudo chmod ugo+rw /etc/xinetd.d/tftp





Then open the file with your text editor, paste the following text in the file and save the file.

service tftp
{
protocol = udp
port = 69
socket_type = dgram
wait = yes
user = nobody
server = /usr/sbin/in.tftpd
server_args = /tftpboot
disable = no
}




Stage 3


Then we need to create the folder mentionned in the server_args of the /etc/xinetd.d/tftp file.

So at the root folder of your system create the tftpboot folder with the following command :

sudo mkdir /tftpboot


And then give permission to that folder with the following command :

sudo chmod ugo+rw /tftpboot/





Stage 4


To finalize the installation just restart the xinetd service with the following command :

sudo service xinetd restart


And that's it !

The Ubuntu's TFTP server should be up and running !





Step 3 : Add the Putty tool



Stage 1


First we need to install the Putty tool in Ubuntu.

Use the following command :

sudo apt-get install putty


You should get the following log.



Second, you need to give the rights to your profile to access the driver.

Use the following command :

sudo usermod -a -G dialout mtvl




Stage 2


Then in the Search Your Computer tool find the putty icon, drag and drop it on the desktop to have it accessible anytime.




Stage 3


Then you can configure connexion settings and save it in a configuration file. It will be very convenient when you launch a putty connexion very often, and even more if you switch from tasks to tasks !
















Post Conclusion

Now we have :

- Completed the Ubuntu's installation with neccessary resources for Xilinx PetaLinux tool.
- Install the TFTP tool for files transfer to the MiniZed board.
- Install the Putty tool for viewing Linux consoles from the MiniZed board.

Tuesday, 20 November 2018

How to automatically configure the PetaLinux environment



Hi !

In this post we are going to see how to automatically set the requiered environment to launch the Xilinx PetaLinux tool.


Stage 1


Ok, you're very happy, you've just installed the Xilinx PetaLinux tool and you want to use it.

To check that everything is set up properly, just try to launch the following command :

petalinux-create





Oups, something is wrong......


Stage 2




Good to know :

Like for every Xilinx tool, the associated environment must have been set up to let the tool start !.

When a tool is launched using the desktop icon, the launcher icon contains the actions for the environment setup.

When a tool is used under command lines, the environment setup has to be done manually, or something has to be done to handle it automatically.



To load the PetaLinux environment use the following command :

source /opt/petalinux-v2018.2-final/settings.sh


This will run the script that sets up the PetaLinux environment.




Ok, let's see if the script did its job !

Try again the create project command.




Ok, this time the command is available.

The error is only due because the command's arguments are missing so the command's help is automatically displayed by PetaLinux.


Stage 3


The remaining problem is that providing manually the script command is only valid for this session.

So everytime you launch Ubuntu again, you will have to do it again.

One solution is to add the command in the ~/.bashrc file.

Edit the file with an text editor, for example Gedit.

Use the following command :

gedit ~/.bashrc


Add the following lines at the beginning :

# Mtvl : Add PetaLinux Environment setup.
source /opt/petalinux-v2018.2-final/settings.sh



Save the file, close the file.




Now Every time you will open a terminal window, the bash configuration file is executed and it will execute the PetaLinux environment setup script, just like below.




Stage 4


To check the modification just :

- Shut down you VM.

- Start your VM again.

- Once in Ubuntu open a new terminal console.

- You will get the log of the PetaLinux environment setup script.

- Then the prompt.

If you launch the PetaLinux command again it will execute.




Ok, that's it !





Post Conclusion

Now we have :

- Identified which script file sets the PetaLinux environment up.
- Made the PetaLinux environment setup script run automatically on each terminal launch.
- Made PetaLinux commands available in a terminal window.

Set Ubuntu shell for Xilinx PetaLinux



Hi !

In this post we are going to set the default shell used by Ubuntu.

In our case we will use the bash shell because Xilinx PetaLinux tool requires it !


Stage 1


First, let's find what is the current type of shell set in our Ubuntu installation.

Use the following command :

ls -l /bin/sh





Ok, actual shell is dash.


Stage 2


So we need to switch to bash.

Use the following command :

sudo dpkg-reconfigure dash


This will bring the following screen to pop up in the terminal.

Change the selection to NO using the key, then press Enter.




The log tells you that the dash shell is removed and replaced by the bash shell.


Stage 3


Now, if you check again the current shell then you get the bash one this time.







Post Conclusion

Now we have :

- Set Ubuntu's default shell to BASH.


Thursday, 15 November 2018

How to install Xilinx Vivado and SDK



Hi !

In the previous post we installed tools to exchange data between the Host and Ubuntu 16.04.03 LTS in our Virtual Machine.

Now in this post we are going to install Xilinx Vivado 2018.2 for FPGA generation and Xilinx SDK 2018.2 for software developements.


As this post is quite long, here are the main sections of this post for a quick jump :







Step 1 : Download installation files



The first thing to do is to get the installation files for the 2018.2 version, without updates.


Stage 1


You must go the to Xilinx's website: https://www.xilinx.com/support/download.html

You have two choices:

- Download the full file on your computer and then install the tools from it.

- Or download the Web Installer, which will only download the parts needed for the installation configuration you made.

This is what I am doing in this post.

So, go to the website page, then scroll down to 2018.2 no update section.

Finally click on the Linux Self Extracting Web Installer.




Stage 2


This will launch the download, but first you have to login to your Xilinx account.

Fill Username, Password and then click on Sign In.




Stage 3


You will be requested to provide the destination folder where the installer will be stored.

As it will be launched in the VM under Ubuntu, you need to store the installer in the shared folder we created.

This will let us access the installer file from Ubuntu.








Step 2 : Install the Xilinx Tools


Ok, now it's time to switch to Ubuntu.

So open your Virtual Machine and login to Ubuntu.


Stage 1


We are going to give the rights to the installation folders as follow:




The following table gives an explanation of a change mod command using letters.




First the destination folder. The Xilinx tools will be installed in the Ubuntu's /opt repository.

So the chmod command for the destination folder will be :

sudo chmod ugo+w /opt

Which gives the write permission to the /opt repository.


Second, the source installer file must be executed, so the chmod command will be :

chmod +x /media/sf_share/Xilinx_Vivado_SDK_Web_2018.2_0614_1954_Lin64.bin

Which gives the execute permission to the installer file.

Reminder : In the Ubuntu view, the shared folder with the Host has the /media/sf_share path name.


Stage 2


Everything is set up.

To execute the installer file use the command :

/media/sf_share/Xilinx_Vivado_SDK_Web_2018.2_0614_1954_Lin64.bin

This will launch the installation process.




Stage 3


A first popup screen shows up, just giving global information.

Just click on Next.




Stage 4


As the installer will need to access some other installation resources, it will request your Xilinx account's Login and Password.

Here you can choose to download and install only the requested elements, or you can download to whole installation data for a local installation.


Keep Download and Install Now and click Next.




Stage 5


The second popup screen is License Agreement.

Click the 3 I Agree boxes.

Click Next.




Stage 6


The third popup screen is for Tool setup selection.

We will select the Vivavo HL WebPACK, which allows you to use a list of FPGA devices for free with the Tools.

Click Next.




Stage 7


The next popup screen will let you select the content of the installation you need.

What you have to know is that the more devices familly you select, the more the installation time will be longer and your hard drive heavilly filled !!!!

- Design tools : Vivado Design Suite : it is mandatory, this is the main development tool.

- Design tools : Software Developement Kit (SDK) : this is for software development, add it.

- Design tools : DocNav :  this is a tool for Xilinx's documentation handling. Which might be nice to have since there are hundreds of documents available !!!!

- Devices : As our MiniZed board embedds a Zynq Soc device, select the Zynq-7000 familly.
                All other famillies are optional.

Once your selection is done, click Next.




Stage 8


The next popup screen handles installation repositories.

The default location is /opt/Xilinx, so click Yes then Next to validate the destination repository.




Stage 9


This popup screen is the installation summary, as everything should be fine, just click Install.




Stage 10


Surprisingly, we are requested once again to provide the Xilinx account credentials.

So provide Login, Password and click Login.




Stage 11


At last ! The installation process starts !!

As you can see, it will depend on your ethernet connexion speed and on your computer efficiency.

For me installation process took about 40 minutes.

Just click Ok to end the installation process.




Stage 12


As a result you get the Xilinx Tools launch icons on your Ubuntu desktop !

- Vivado 2018.2 : This the FPGA design Tool.

- Vivado HLS 2018.2 : This stands for High Level Synthesis, this tool is used to translate C code into VHDL. We won't use it.

- Documentation Navigator : Documentation browser, usefull when you search for a Xilinx document as there are tons of them !!




Stage 13


Ooops, but where is the SDK launch icon ?

Well, as I don't know Ubuntu, I tried to search for SDK (Launch search tool, then search for SDK).

The search tool found the SDK application, so I dragged and dropped the icon found onto the Ubuntu desktop, and there it was !




Stage 14


The just right click on the desktop and select Organize Desktop by Name, and there you go !

The Ubuntu desktop provides all the needed icons for the development tools we will use with their GUI.








Step 3 : Install Cables Drivers



The first thing to do is to go to the drivers folder with the following command:

cd /opt/Xilinx/Vivado/2018.2/data/xicom/cable_drivers/lin64/install_script/install_drivers/


Then launch the installation with the command:

sudo ./install_drivers

Provide your password if needed, and that's it !








Post Conclusion

Now we have :

- Downloaded installation files
- Installed Xilinx Vivado 2018.2
- Installed Xilinx SDK 2018.2

Friday, 9 November 2018

Optimization for the Host / Ubuntu interactions within the Virtual Machine



Hi !

In the previous post we installed Ubuntu 16.04.03 LTS in our Virtual Machine.

Now in this post we are going to add and configure resources of the Virtual Box that will allow us to exchange data between the Host and the Ubuntu OS running in the Virtual Machine. Which will be very convenient !!




Here are the main sections of this post for a quick jump :






Step 1 : Install the Virtual Box Guest Additions


The installation of the Virtual Box Guest Additions will add functionnalities to the VM like:

- Shared Folders, in order to exchange files between the Host and Ubuntu.

- Shared clipboard, in order to exchange copy/paste function between Host and Ubuntu

- Enable Drag and Drop, directly between Host and Ubuntu


Stage 1


So the first thing to do is to start the Virtual Machine and to log in.

Then select Devices, then Insert Guest Additions CD Image.




Stage 2


This will load the installation iso file and launch it.

An installation confirmation popup will show up.




Just click Run.


Stage 3


A Ubuntu upgrade request popup might show up !

Check this !

As we used the specific Ubuntu version 16.04.03 LTS compatible with the XILINX's VIVADO 2018.2 tools, DO NOT UPGRADE Ubuntu !


To proceed with the Additions installation, an authentification popup will ask you for your password.

Just provide your Password and click Authenticate.




Stage 4


The installation will start and log is provided in a terminal window.

This will last a few minutes.

You will have to end the process by pressing Enter.




Stage 5


To finalize this installation procedure, eject the installation iso file.

Select Devices, then Optical Drives and Eject disk from virtual drive.




Check this !

Now you have to reboot your Virtual Machine !






Step 2 : Enable the shared folders


The Virtual Box Guest Additions will let you exchange files between the Host and the Ubuntu OS.


Stage 1


The first thing to do is to create a folder on the Host Hard Drive.

For me I chose to create the folder share on my dedicated hard drive DE_LINUX.




Stage 2


Then go back to the Virtual Machine. Start it and log in.

Go to Devices, then select Shared folder and finaly Shared Folders Settings.




Stage 3


First select the Permanent Folders.

Then, on the right click on the Add icon.

This will popup a window where:

- Select your share folder path on the Host hard drive

- Select Auto Mount

- Select Permanent Configuration

Finaly click Ok




And you will get the following configuration :




Check this !

Now you have to reboot your Virtual Machine !


Stage 4


Check this !

The repository created on the Host hard drive will be seen in Ubuntu as /media/sf_<host_repo_name>


If we try to access the shared repository using the Ubuntu's repo browser we get :




Stage 5


Now we will provide the needed permissions.

In the Ubuntu's desktop click right to Open Terminal.

A terminal window opens.

We need to provide permissions to the vboxsf group.

First we check that the group has been created by the Guest Additions installation. Use the following command line.




Next, I give myself the permissions to that group and check it was applied. Use the following command lines.




You will have to provide your password.


Check this !

Now you have to reboot your Virtual Machine !


Stage 6


In the Host explorer I created a file called Test_file.txt.

Now when I use the Ubuntu file explorer I can see that file in the shared repository and I can access and modify it.




If I do the same in the terminal window :








Step 3 : Enable the shared clipboard


The Virtual Box Guest Additions will let you copy/paste data between the Host and the Ubuntu OS.


Stage 1


In the VM go to Devices, then select Shared clipboard and finaly Bidirectionnal.




Stage 2


Ok, let's try it !

In the Host I write some text in my text editor that I copy to the Host's clipboard.




Now back to Ubuntu, if I open a terminal window and make a paste function, I get my text back !

This will be very helpfull for me for my posts !!!



And of course it works backward from Ubuntu's Copy function to the Host's Paste function.






Step 4 : Enable the Drag and Drop capability


The Virtual Box Guest Additions will let you Drag and Drop data between the Host and the Ubuntu OS.


Stage 1


In the VM go to Devices, then select Drag and Drop and finaly Bidirectionnal.




Check this !

Now you have to reboot your Virtual Machine !


I experienced problems with very small files.....






Step 5 : Optimizations



Stage 1


There you can give more CPU power to the VM execution.

First, Shut Down your Virtual Machine to gain access to its configuration parameters.

Next, click on the System sub section title.

Select the Processor tab.

Be carefull to keep enougth CPU for the Host !

Recommandation would be 50 / 50.







Post Conclusion

Now we have :

- Convenient ways to exchange data between the Host and the Virtual Machine (Shared Folders, Shared Clipboard, Drag and Drop)
- Virtual Machine Optimization