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.
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
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.
- 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.






No comments:
Post a Comment