一、petalinux工具安装
安装petalinux必要的包(注:需到root权限下执行以下命令)
sudo apt-get install tofrodos等等,依次类推全部安装一遍,复制下面命令直接运行,即可一次性安装完所有的包
sudo apt-get install tofrodos -y;sudo apt-get install iproute2 -y;sudo apt-get install gawk -y;sudo apt-get install xvfb -y;sudo apt-get install git -y;sudo apt-get install make -y;sudo apt-get install net-tools -y;sudo apt-get install libncurses5-dev -y;sudo apt-get install tftpd -y;sudo apt-get install zlib1g-dev:i386 -y;sudo apt-get install libssl-dev -y;sudo apt-get install flex -y;sudo apt-get install bison -y;sudo apt-get install libselinux1 -y;sudo apt-get install gnupg -y;sudo apt-get install wget -y;sudo apt-get install diffstat -y;sudo apt-get install chrpath -y;sudo apt-get install socat -y;sudo apt-get install xterm -y;sudo apt-get install autoconf -y;sudo apt-get install libtool -y;sudo apt-get install tar -y;sudo apt-get install unzip -y;sudo apt-get install texinfo -y;sudo apt-get install zlib1g-dev -y;sudo apt-get install gcc-multilib -y;sudo apt-get install build-essential -y;sudo apt-get install libsdl1.2-dev -y;sudo apt-get install libglib2.0-dev -y;sudo apt-get install screen -y;sudo apt-get install pax -y;sudo apt-get install gzip -y;sudo apt-get install python -y
然后将Ubuntu的dash换成bash,可用命令ls -l /bin/sh来查看自己目前是dash还是bash,如果是dash,则需换成bash,命令:
sudo dpkg-reconfigure dash,选择否即可。
从网上下载petalinux系统,选择下面的PetaLinux 2018.2 Installer,下载完之后应该是一个 petalinux-v2018.2-final-installer.run 文件。
运行.run文件即可
./petalinux-v2018.2-final-installer.run ~/petalinux
不能加sudo,后面的home为安装路径可自定义,注意需要等待非常久的时间,耐心等待,之后是同意协议说明,按键enter->q->Y->q->Y多次后进入安装。
环境变量配置:
修改 ~/.bashrc 这个文件
在最后加上 $ source ~/petalinux/settings.sh
(填写为自己的petalinux安装路径,如果配置后打开终端,出现Permission denied 则可以将source 命令改写为sudo source)
配置环境变量时会出现警告WARNING: No tftp server found,
解决方法:开启tftp
sudo apt-get install tftpd-hpa //tftpd-hpa是服务器端
sudo vim /etc/default/tftpd-hpa
将文本中的ADDRESS地址项修改为自己本机的inet地址(用ifconfig查看),保存退出
启动tftp:sudo service tftpd-hpa restart
即可
============================================
tar.gz解压方法:
解压命令:tar -zxvf +待解压的文件
压缩:tar -zcvf+压缩目的文件+源文件
===========================================
二、只安装SDK,注:vivado已经包含SDK工具
选择最近的SDK 2018.2 Web Install for Linux 64(BIN - 99.29 MB),下载
然后放到linux下直接运行安装,需有赛灵思的账号,没有的可以先去官网注册一下。
三、vivado安装
下载Vivado HLx 2018.2: WebPACK and Editions - Linux Self Extracting Web Installer---需要在线下载后再安装
Vivado HLx 2018.2: WebPACK and Editions - Linux Self Extracting Web Installer
(BIN - 99.45 MB)
或者下载Vivado HLx 2018.2: All OS installer Single-File Download (TAR/GZIP - 17.11 GB)-不需要在线下载
建议下载17.11G的那个,先用迅雷下载后可以免去在线下载,还可以方便重新安装,毕竟在线下载真的慢,只有一百多KB的速度。对于十几个G的文件,即使1M的速度也很慢了。
安装方法很简单,直接进解压后的目录,然后就有个安装文件,直接./xsetup即可,然后会蹦出图形安装界面,修改下安装地址,默认是/opt/xilinx,因为opt目录需要root权限,所以建议修改为自己有权限的目录:~/Xilinx即可,其余默认即可。
如果不知自己是哪个产品,且硬盘容量充足,别管这么多了,全√选安装吧,另外需注意,在linux下默认不会安装cable下载线驱动,你会在安装的时候看到有一项为灰色,不可勾选,这个可以在vivado安装完后再进行安装
============以下针对ZYNQ7000安装vivado选项========
为了安装的全面,选择安装第三项:system Edition,这一项比较完全,防止后面产生不必要的麻烦
之后按如下勾选和去除(针对ZYNQ7000系列,我的是701A)
===============================================
安装后会看到有SDK和Xilinx两个文件夹,这两个工具都已经一起安装了。
下一步:不用多说,配置环境变量: vim ~/.bashrc中
source ~/Xilinx/SDK/2018.2/settings64.sh
只需source SDK目录就行了,VIVADO目录下也有settings64.sh,跟SDK目录下的是一样的,所以只需source这两个之中的一个就可以了。
430M CodeSourcery/
92K Sourcery_CodeBench_Lite_for_Xilinx_GNU_Linux/
37G Xilinx/
14G petalinux/
25G pkg/
76G 总用量
==========================================
//在bashrc中将存在如下配置
#petalinux env settings
source ~/petalinux/settings.sh
#Xilinx-Vivado-SDK env settings
source ~/Xilinx/SDK/2018.2/settings64.sh
#uboot-mkimage env settings
PATH=$PATH:~/pkg/u-boot-xlnx-xilinx-v2018.2/tools
#xilinx-2011.09-50-arm-xilinx-linux-gnueabi-gcc:PATH settings
PATH=$PATH:~/CodeSourcery/Sourcery_CodeBench_Lite_for_Xilinx_GNU_Linux/bin
UCAS-SICT