-
安裝petalinux(利用petalinux工具移植Linux)
-
下載petalinux https://www.xilinx.com/support/download
-
下載 zcu102 ZCU102 BSP
-
安裝petaLinux
把shell設定成bash(這一步看不懂的話可以忽略,因為有些人喜歡把shell設定為dash),具體設定方法是$ sudo dpkg-reconfigure dash
安裝一些庫(參考ug1144檔案,下面為shell command)
apt install build-essential vim tofrodos
apt install iproute2 gawk gcc git make net-tools zlib1g-dev
apt install libssl-dev flex bison libselinux1 libncurses5-dev
apt install lib32stdc++6 xvfb chrpath socat autoconf libtool
apt install texinfo gcc-multilib libsdl1.2-dev libglib2.0-dev zlib1g:i386
cd 到petalinux-v2018.3-final-installer.run所在目錄,或者下面命令在其前面加上其所在目錄,shell行輸入:
chmod +x petalinux-v2019.2-final-installer.run
./petalinux-v2018.3-final-installer.run ./petalinux
等待,安裝到一半的時候,提醒查看許可,按回車查看,按q退出,退出后輸入y,回車,如此重復三次,才開始正式安裝(這個步驟要很小心,如果沒有輸入 y,就回車,就要重新了)
-
運行petalinux shell行輸入:source /home/li/petalinux/settings.sh
(petalinux安裝目錄)
-
搭建petalinux工程
方法(一):利用zcu102BSP官方包
下面為shell行輸入:
首先打開petalinux工具:
: source /home/li/petalinux/settings.sh
: cd /home/user
: petalinux-create -t project -s <path-to-bsp>
: cd Xilinx_*/
: petalinux-build
: petalinux-package --boot --format BIN --fsbl images/linux/zynqmp_fsbl.elf --u-boot images/linux/u-boot.elf --pmufw images/linux/pmufw.elf --fpga images/linux/system.bit –force
方法(二):獨自設計硬體描述
-
利用vavido工具,生成.hdf檔案(參考ug1209)
點擊Create Block Design,如出現上圖,
點擊Run Block Automation
然后雙擊zynq_ultrascale如下圖所示
點擊PS-PL Configuration
取消 AXI HPM0 FPD 和AXI HPM1 FPD的√
點擊OK保存,
右擊選擇(validate design)
然后在source里選擇design_1,右擊選擇Create HDL Wrapper
在source里選擇design_1,右擊選擇Generate Output Products
點擊Generate Bitstream
點擊file 選擇Exprot ? Exprot Hardware
.經Vivado綜合,實作后,在Vivado中導出硬體,輸出PetaLinux所需要的硬體描述檔案
輸出的檔案就在“/(工程檔案夾)/(工程名).sdk”這個檔案夾下,這個檔案夾下的design_wrapper.hdf待用.
-
建立petalinux工程
找到存放工程的目錄
根據petalinux安裝的路徑啟動shell:source
/home/mm/petalinux/settings.sh
創建工程
shell:petalinux-create
--type project --template zynqMP --name zcu102_linux_01
決議硬體描述檔案
把之前匯出的硬體描述檔案design_wrapper.hdf拷貝到計算機中的zcu102_linux_01工程檔案夾下,輸入下面命令:
shell: petalinux-config --get-hw-description=/home/(該工程目錄路徑)
會進入一個配置界面,在里面可以配置一些系統設定
選擇image packaging configuration
->Root filesystem type
選擇 SD card,保存 exit,
<style></style> <style></style>shell : petalinux-config -c rootfs
shell:petalinux-build #生成image.ub
再重新編譯:petelinux-build
shell:petalinux-package --boot --format BIN --fsbl images/linux/zynqmp_fsbl.elf --u-boot images/linux/u-boot.elf --pmufw images/linux/pmufw.elf --fpga images/linux/system.bit --force
#生成BOOI.BIN檔案
生成的檔案在 /iamge/linux/ 下
這倆檔案為LINUX系統啟動檔案
(參考Ubuntu移植redhat到zynqMP)
需要petalinux 工具生成啟動檔案image.ub和BOOT.BIN
下載Ubuntu根目錄檔案系統包
https://rcn-ee.com/rootfs/eewiki/minfs/
https://rcn-ee.com/rootfs/eewiki/minfs/ubuntu-16.04.2-minimal-armhf-2017-05-11.tar.xz
將啟動檔案 image.ub和BOOT.BIN檔案拷貝到sd卡中的BOOT磁區
進入petalLinux工程目錄下,打開終端,輸入下面命令:
cp images/linux/image.ub /media/l/BOOT/
cp images/linux/BOOT.BIN /media/l/BOOT/
將下載下來的Ubuntu根目錄檔案系統包解壓到sd卡的rootfs磁區
shell:
cd 到該目錄下,或者在該目錄下打開終端
sudo tar xvf ubuntu-16.04.2-minimal-armhf-2017-05-11.tar.xz -C /media/l/rootfs
cd ubuntu-16.04.2-minimal-armhf-2017-05-11
sudo tar xvf armhr-rootfs-ubuntu-xenial.tar -C /media/l/rootfs
啟動系統:
彈出sd卡
插入開發板
在主機打開終端
shell:
sudo apt install minicom
minicom
接通開發板電源
等待串口列印Linux啟動資訊
輸入 log :ubuntu
password:temppwd
進入Ubuntu系統:
<style></style>
<style></style>
<style></style>
<style></style>
<style></style>
<style></style>
<style></style>
<style></style>
<style></style>
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/1992.html
標籤:Verilog
