ZYBO Zync-7000 Development Board Work Booting Linux on the ZYBO

本文翻译自:http://www.dbrss.org/zybo/tutorial4.html
本文主要是详细讲解zybo硬件系统搭建,u-bootlinux-kernel移植,linaro文件系统移植。过程中需要生成的文件有system.bit,fsbl.elf,u-boot.elf,devicetree.dtb,uImage(zImage和uImage区别请看),linaro文件系统(linaro.org可以下载)

Introduction

  If you are new to linux I would recommend reading through some of the references at the bottom of the page. For this tutorial I am working on a Linux Ubuntu 14.04 vm. Figure 1 is an important overview of the entire design process and how everything comes together to create the necessary components to boot linux on the Zynq-7000 SoC. The end goal of this tutorial is to cover the steps from the beginning stages all the way to booting a Linaro Linux distribution with a graphical user interface on the ZYBO. At this point the tutorial only covers the stages up to booting to a Linaro root shell.

Things you will need!!

1、Xilinx Vivado 2014
2、Xilinx SDK 2014
3、Digilent’s ZYBO board
4、Linux-Digilent-Dev master-next branch obtained here.
5、u-boot-Digilent-Dev master-next branch obtained here.
6、 zybo base system( zybo_base_system.zip) here

Step 1: Obtaining necessary files and repositories

I would recommend making a project folder to work from. I am working from zee-bow on the desktop but it is up to you as to where you want to setup. Also create two more folders to put the boot files and root system files as we create them. I named these folders sd_boot and sd_fs.

1) Download the zybo base system from the Digilnets ZYBO product page.

2) Download the Digilent Inc. u-boot-Digilent-Dev and Linux-Digilent-Dev repositories. Make sure to get the master-next branch as these contain the necessary zybo config and dts files. These will be used to create the kernel and u-boot.elf.

Figure 2: Cloning Linux-Digilent-Dev and u-boot-Digilent-Dev into my working folder.
注意:一定要在master-next branch中下载zybo相应的配置文件,u-boot和kernel默认不包含这些文件的


默认DigilentInc/u-boot-Digilent-Dev中boards.cfg文件中也不会包含zybo的配置文件,我们也必须在master-next branches中去下载boards.cfg文件

Step 2: Compiling U-Boot

目的:编译u-boot,生成u-boot.elf文件

编译u-boot需要做以下两部修改:
1、修改环境变量,使得编译器GCC指向交叉编译器xilinx-linux-gnueabi-
目标处理器类型为arm

vim /etc/bash.bashrc
#在末尾加上
export ARCH=arm
export CROSS_COMPILE=arm-xilinx-linux-gnueabi-
export PATH=/root/CodeSourcery/Sourcery_CodeBench_Lite_for_Xilinx_GNU_Linux/bin/:$PATH

In order to compile the U-Boot and later the kernel we need to set up the tools and extend the $PATH environment variable to find the tools. I would recommend moving the first two exports and the source into your .bashrc so you don’t have to set them again after closing the terminal.

2、修改 u-boot-Digilent-Dev/include/configs/zynq_zybo.h ,删除图片中的绿色一行,以此保证启动时候不会去加载ramdisk,因为本文采用的文件系统是linaro的桌面ubuntu。
The next step is to configure and compile the U-Boot. Navigate to the u-boot-Digilent-Dev folder in the terminal. before compiling the u-boot we need to change the zynq_zybo.h file to prevent the u-boot from loading the ramdisk. Instead we want it to pass to the root filesystem.

Figure 4: Configure and building U-Boot for ZYBO.

Now lets compile the u-boot. Run make with the specific board zynq_zybo_config file and then run make and the execute and link u-boot should compile.

Figure 5: Configure and building U-Boot for ZYBO.

If you get an error during this step your $PATH environment variable most likely can not find the tools necessary to compile the u-boot. If the u-boot compiled correctly you should see a u-boot in the top level of the u-boot-Digilent-Dev folder. Lets move this to the sd_boot folder and add an elf extenstion. This will be used to generate the BOOT.bin in the following step.

Figure 6: Adding the elf extension to U-Boot.

Step 3: Building the base design(vivado)

第三步是硬件系统的构建,原文采用的vivado,我采用的是EDK+SDK,所以这一节有点不一样,但是过程是一样的,生成文件也是一样的,都是生成system.bit,fsbl,加上step2中生成的u-boot.elf,三个文件一起生成boot.bin文件。主要是看你习惯用vivado还是ISE,我偏向于ISE。如果大家想用vivado,那就就按照原文操作,我采用EDK+SDK单独讲解。
Now on to the base design. Open your chosen version of Vivado, I am working with Vivado 2014.4 and the corresponding SDK. Open the base design project under zybo_base_system/source/vivado/hw/zybo_bsd/zybo_bsd.xpr. If you are using the version that the base design was created with then this next part does not pertain to you and you can go ahead and generate the bitstream. If you are not using the version that it was created on then you will be prompted with an Older Project Version warning and an option to automatically upgrade to the current version. Select okay to automatically upgrade. A second warning will apear saying Vivado no longer uses ‘work’, select okay. The third warning is notify you that some Xilinx IP’s have undergone changes in this version of Vivado, select report ip status. Select the Upgrade Selected at the bottom of the design tool. It will ask if you wish to proceed, select ok.

Figure 7: Upgrading IPs in Vivado 2014.4.

The tool will notify you that there were six critical warning messages, select ok. These will not cause an issue with the system. The next step is to generate the bitstream. There are no implementations available so the tool will ask to launch synthesis and implementation before generating the bitstream, select yes. There will be warnings that appear during the sysnthesis and implementation, select ok do not worry about those for now. I would recommend reading up on some of the references as this may take some time depending on the processing power of your computer. Once the tool has finished you will need to export hardware.

Figure 8: Exporting hardware for SDK.

Include the bitstream when exporting the hardware and then launch the SDK

Figure 9: Include Bitstream when exporting hardware.

Step 3: Building the base design(EDK)

目的:生成system.bit,并到处硬件工程到SDK

下载得到zybo_base_system.zip
打开\zybo_base_system\zybo_base_system\source\ise\hw\system.xmp工程(EDK的工程文件),可以看到完整的zybo硬件构架,然后点击Export Design

最后就会将生成的硬件文件导入到SDK中,新建一个application,Select C and standalone for the target software language and OS platform。
注意:一定要将fsbl中的fsbl_hooks.h文件替换,替换的fsbl_hooks.h文件在 zybo_base_system/source/vivado/SDK/fsbl 中

Step 4: First Stage Boot Loader

目的:创建fsbl应用,生成fsbl.elf文件

Once the SDK loads create a new application project. Make sure the hardware platform has selected the hardware you previously exported from Vivado. Select C and standalone for the target software language and OS platform. Name the project fsbl and select next.

Figure 10: New application project specification

Now we will need to modify the fsbl_hooks.c file and set the mac address. Locate the ZYBO specific fsbl_hooks.c file in the zybo_base_system/source/vivado/SDK/fsbl folder and replace the one that was generated in the SDK fsbl project. Once you have replaced the fsbl_hooks clean and build the project. This will generate the fsbl.elf used to create the BOOT.bin in the next step.

Step 5: Building BOOT.bin

目的:由system.bit,fsbl.elf,u-boot.elf生成boot.bin文件

Select create Zynq Boot image under the Xilinx Tools tab. We need to add, in order, the fsbl.elf, system_wrapper.bit, and the u-boot.elf in order to create the BOOT.bin. The fsbl can be found in the zybo_base_system/source/vivado/hw/zybo_bsd/zybo_bsd.sdk/fsbl/debug folder. The system_wrapper.bit can be found in the zybo_base_system/source/vivado/hw/zybo_bsd/zybo_bsd.sdk/system_wrapper_hw_platform_0 folder. In an earlier step we moved the u-boot.elf into a the sd_boot folder. Next specify the output path where you want the BOOT.bin to be generated.

Figure 11: Generating BOOT.bin.

Step 6: Building the Linux kernel

目的:编译Linux内核文件生成uImage

The next step is to build the Linux kernel. Navigate to the Linux-Digilent-Dev folder we downloaded earlier. Now we are ready to compile the kernel. Make sure to run make on the xilinx_zynq_defconfig file to set up the configurations for the zynq chip before compiling the kernel.

Figure 12: Uncompressing the zImage kernel image.
注意:如果这一步出现找不到mkimage工具的错误,可以在线安装mkimage

sudo apt-get isntall u-boot-tools

Step 7: Generating the Device Tree Blob

目的:编译设备树zynq_zybo.dts,生成zynq_zybo.dtb

Before we generate the device tree blob we need to make some slight adjustments to the zynq_zybo.dts file found Linux-Digilent_dev/arch/arm/boot/dts. Particularly line 44, 53, and 62. changing the clock prevented an error that occured after booting up to the root shell.

Figure 13: Modifying the zynq_zybo.dts.

Now we are ready to generate the dtb file. After this is complete copy it into the sd_boot folder and rename it devicetree.dtb.

Figure 14: Modifying the zynq_zybo.dts.

Step 8: Partitioning your Secure Digital card

目的:采用gparted分区工具对SD卡进行分区(FAT32+EXT4),将boot.bin,uImage,device.dtb拷贝至fat32中。

There are a couple of ways to do this, the easier way is to use Gparted. A second way is to use the command line tool fdisk. If you do not have gparted it is fairly easy to download and install. Type sudo apt-get install gparted to install it and sudo gparted to run it. Once you have it install plug in your SD card and select it from the drop down window in the top left. If you have any information on the SD card make sure to back it up otherwise select the partition tab and unmount the partition then select and delete the partition. Select the check mark that appears, confirming you wish to delete the partition. Create two new partitions, the first with a beginning offset of 4 MiB. The first partition should be FAT32 and be 1 GiB, the second partition should be ext4 and can take the remaining space.

Figure 15: Partitioning the boot SD card.

Step 9: Obtaining the Linaro file system

目的:在线下载linaro-ubuntu文件系统,将解压后的linaro文件系统拷贝至sd卡中的ext4文件系统中

Download the Linaro file system tar ball from here. We are interested in the last one in the list. Extract the contents and cd into binary/boot/filesystem.dir. Now we need to sync the contents of this folder with the ROOT_FS partition we just created.

Figure 16: Syncing the Linaro root file system with the ROOT_FS partition on the SD card.

Step 10: Booting the ZYBO

Now we need to put BOOT.bin, devicetree.dtb, and uImage onto the FAT32 boot partition. I would recommend creating a temporary folder, mounting the boot partition to that folder, and then using rsync to copy the files over. Once the files are on the correct partition eject the SD card and put it into your ZYBO. Make sure the JP5 jumper is set to SD and JP7 is set to wall. You can boot it from the usb but I would recommend using the wall to power the board. Connect to a uart port terminal, I use GtkTerm to connect to the hardware. It is available in the Ubuntu Software Center, when running it make sure to use sudo as it will need permission to connect to the usb port. Power on the ZYBO and then in the serial port terminal set the configuration to the port where the ZYBO is connected and set the baud rate to 11500, everything else should stay as defualt.

Figure 17: Booting from SD on the ZYBO to the Linaro root shell.

References

[1] Xilinx Getting Started Wiki
[2] Digilent Embedded Linux Hands-on Tutorial for the ZYBO
[3] What-is-Linux
[4] Device Tree Wiki
[5] Initrd Wiki

[Zybo u-boot Linux系统移植]-ZYBO Zync-7000 Development Board Work Booting Linux on the ZYBO相关推荐

  1. linux系统移植篇(二)—— Uboot使用介绍

    linux系列目录: linux基础篇(一)--GCC和Makefile编译过程 linux基础篇(二)--静态和动态链接 ARM裸机篇(一)--i.MX6ULL介绍 ARM裸机篇(二)--i.MX6 ...

  2. linux系统移植篇(四)—— 根文件系统使用介绍

    linux系列目录: linux基础篇(一)--GCC和Makefile编译过程 linux基础篇(二)--静态和动态链接 ARM裸机篇(一)--i.MX6ULL介绍 ARM裸机篇(二)--i.MX6 ...

  3. linux嵌入式移植培训,达内嵌入式培训大讲堂之Linux系统移植

    移植一个基本的必要的linux系统(包含存储设备,输入输出设备驱动)移植到板子里,其他的一些驱动不能移植进去,对设备的要求不高,接下来,达内嵌入式培训大讲堂将和大家讨论"Linux系统移植& ...

  4. 全志F1C100s主线linux入坑记录 (1)linux系统移植

    linux系统移植 (基于SD卡启动) 百度网站 文章目录 linux系统移植 (基于SD卡启动) 一.安装gcc交叉编译器 二.Uboot移植 1.下载Uboot 源码 2.配置Uboot 3.编译 ...

  5. zynq linux环境移植,ZYNQ 7030 Linux 系统移植

    ZYNQ 7030 Linux系统移植 手上有一块 ZYNQ-7030的演示板,是仿照Xilinx Zedboard设计的,但是与Zedboard又有所不同,因此花时间移植一下Linux系统.记录下这 ...

  6. 嵌入式Linux(5):驱动开发网络调试驱动设备的Linux系统移植

    驱动开发之网络调试驱动设备的Linux系统移植 1.Uboot移植到开发板 uboot移植 2.开发板网络通讯 nfs命令 tftp命令 3.Linux移植到开发板 4.BusyBox 构建根文件系统 ...

  7. 嵌入式Linux系统移植的四大步骤

    最近在学习系统移植的相关知识,在学习和调试过程中,发现了很多问题,也解决了很多问题,但总是对于我们的开发结果有一种莫名其妙的感觉,纠其原因,主要对于我们的开发环境没有一个深刻的认识,有时候几个简单的命 ...

  8. 嵌入式Linux系统移植的四大步骤(详细长文,慎入!)

    关注.星标公众号,直达精彩内容 来源:网路素材 最近在学习系统移植的相关知识,在学习和调试过程中,发现了很多问题,也解决了很多问题,但总是对于我们的开发结果有一种莫名其妙的感觉,纠其原因,主要对于我们 ...

  9. 外网访问arm嵌入式linux系统_嵌入式Linux系统移植的四大步骤

    最近在学习系统移植的相关知识,在学习和调试过程中,发现了很多问题,也解决了很多问题,但总是对于我们的开发结果有一种莫名其妙的感觉,纠其原因,主要对于我们的开发环境没有一个深刻的认识,有时候几个简单的命 ...

最新文章

  1. vue中使用promise
  2. 电力行业信息系统安全等级保护基本要求_重磅 | 国家标准电力信息系统安全等级保护实施指南将于2019年7月实施(附全文)...
  3. 永洪科技助力RayDataUnity强强联合,打造数字时代“新引擎
  4. 桌面虚拟化之运维支持
  5. 锤子手机成绝唱了,网友微博喊话罗永浩:赶快买回来吧!
  6. 如何“反编译” Java类文件? [关闭]
  7. 如何解决苹果Mac安装Axure首次打开报错的问题?
  8. 项目中坑记录:mongo 插入失败无提示
  9. PDF区域文本提取工具
  10. [精简]托福核心词汇64
  11. 锐捷网络2019年秋招售前产品经理面试总结
  12. html图片点击加边框颜色代码,用HTML代码给图片添加边框方法
  13. 【iOS】崩溃收集和解析
  14. 小程序免官费注册和突破实名只能绑定5个小程序的限制
  15. 苹果手机注册时显示链接服务器出现问题,苹果确认iphone密码,显示连接服务器出现问题,为什么...
  16. 20150317 实习之——余世维视频(上)
  17. 认知的高度 = 人生的高度
  18. 多方安全计算(MPC)知识汇总
  19. vue使用sort实现json数据中字母排序
  20. Matlab编程入门指南:简介、安装、学习路线和几十个编程案例分析。

热门文章

  1. 计算机专业相关的创意产品,10款惊艳的创意产品,脑洞大就是任性!
  2. SpringBoot+Vue智能停车场管理平台源码
  3. nginx反向代理的断连问题
  4. python画两个科赫雪花_【TCE的编程小讲堂】【Python】【第二期】如何画出科赫雪花?(上)...
  5. html span 宽度自动换行,span 文本内容超过宽度自动换行
  6. Noesis: 科学家们的语义搜索引擎
  7. ZYNQ开发系列——SDK输出串口选择以及打印函数print、printf、xil_printf的差别
  8. 2018.4.3_面试记录_今日头条
  9. -1 对256求模的值为255?
  10. python如何获取文件_python 中文件的读取