1. 程式人生 > >基於Zynq Linux環境搭建(三)

基於Zynq Linux環境搭建(三)

https://www.cnblogs.com/ifpga/p/8182029.html

此篇編譯Kernel

解壓:

 

1

[#17#17:26:56 [email protected] ~/Zybo_Demo]$tar zxvf *.tar.gz

  

進入到檔案kernel資料夾中,clean

 

1

[#19#18:48:24 [email protected] ~/Zybo_Demo/linux-xlnx-xilinx-v2014.2]$make distclean

  

配置

 

1

[#21#18:49:01 [email protected] ~/Zybo_Demo/linux-xlnx-xilinx-v2014.2]$make ARCH=arm xilinx_zynq_defconfig

  

make  ARCH=arm  menuconfig

出現錯誤,需要安裝ncurses庫,命令sudo apt-get install libncurses5-dev

 

 

make

 

1

[#22#18:49:14 [email protected] ~/Zybo_Demo/linux-xlnx-xilinx-v2014.2]$make ARCH=arm uImage LOADADDR=0x00100000

  

在編譯生產image檔案時,出現了下述錯誤

 

1

2

3

"mkimage" command not found - U-Boot images will not be built

make[1]: *** [arch/arm/boot/uImage] Error 1

make: *** [uImage] Error 2

  

更新u-boot-tools

 

1

[#22#18:55:17 [email protected] ~/Zybo_Demo/linux-xlnx-xilinx-v2014.2]$sudo apt-get install u-boot-tools

  

更新完成後,再次執行即可生成Image檔案

 

dts編譯

在SDK配置相關模板

生成PL側和PS側的裝置資訊,匯入到./arch/arm/boot/dts/

重啟前的版本如下:

 

1

[#27#19:01:21 [email protected] ~/Zybo_Demo/linux-xlnx-xilinx-v2014.2]$./scripts/dtc/dtc -O dtb -I dts -o devicetree.dtb ./arch/arm/boot/dts/zynq-zybo.dts

  

在當前目錄下生成dtb。

至此,kernel和dts都生成號