zybo 作业板 linux,Zybo GPIO Demo Run Embedded Linux

1.Environment

Ubuntu 12.04 x86_64

Vivado 2013.4

SDK 2013.4

2.Pre-requisites

2.1 CodeSourcery arm-gcc toolchain lite 32-bit compatible

echo “export PATH=~/CodeSourcery/bin:$PATH” >> ~/.bashrc

echo “export CROSS_COMPILE=arm-xilinx-linux-gnueabi-“ >> ~/.bashrc

arm-xilinx-linux-gnueabi-gcc –v

2.2 fsbl Download

LinaroDemo-> boot_image

2.3 u-boot Download

http://pan.baidu.com/s/1dD6D2pz

git clone https://github.com/Xilinx/u-boot-xlnx.git

Click Download ZIP right hand

2.4 devicetree Download

2.5 Kernel Download

https://github.com/Xilinx/linux-xlnx

branch->tags->Xilinx-v2013.4

2.6Randisk Download

wget http://www.wiki.xilinx.com/file/view/arm_ramdisk.image.gz/419243558/arm_ramdisk.image.gz

3.Hardware

Open vivado,Create a new project named zybo_gpio_demo,Click next。

0c17d58162654c49d5223155285ab226.png

In the device selection pannel,we choose xc7z010clg400-1 destdevice。

dea3e25bb0c16a360216963dc44a0699.png

Add a new block design,named design_1。

5de8b143ae2adb6a50f284b90753a03c.png

1f36798e2fb51a24c7b975301365b631.png

Click Add Ip button in the view window,and add ZYNQ IP Core.

05a0aa3ba90d6537355e322726592434.png

Double Click IP Core to configure it。

ca4a9e8d046ea243fd51a07516ec28cb.png

Choose Import XPS Settings,Add ZYBO_zynq_def.xml,click OK。

6c6675734fb5c3682afdfdacb816a691.png

Download Link:

http://www.digilentinc.com/Data/Products/ZYBO/ZYBO_def.zip

d53a671deed13a257a9192e67fcb8fc3.png

Now ZYNQ has been configured and fit for zybo。

f1fefdd52dc13471f097b3a04ad76bfb.png

Click OK,go back to block design,click Add Ip button again,Insert GPIO IP core。

14d57c425e9175a739ffc7529839da43.png

Double click GPIO core to config it:

52a67603bd47a65d30a50b6ea5b05778.png

The configuration is as follows:open Dual Channel,Set the bit width of each channel to 4bit。

3b078aeaddce021c0274fa661a59bd5d.png

Click Run Block Automation in the, and Run Connection Automation tips column, and Vivado will auto connection and configure。Click ok in all the pop-up dialogs。

24fa41a728c45a80a02a305f999e6289.png

c8f219e39d28c6a60f6aceef92b6739c.png

Click refresh button at bottom left,the result is as follows。

3c7b8b6cb0ee1dc55e3eebaece3e415e.png

783a07013c2ed7e33185655627ceafcd.png

In Source window, choose Sources tab,right click design_1, choose Generate Output Products…

c6668992290801e03a532e982fe6938e.png

3944e16413863d9ff644bc7cdbb61e2a.png

Right click zynq_system_1,choose Create HDL Wrapper,Keep default,click OK, Vivado will generate a top file for IP subsystem。

a42f2458bd4697de7c8d9a3da6f3e91f.png

9d3b93908bc354859f418eef13c22acd.png

Right click Constraints->constrs_1 and choose Add Source。

319c3af14e59dfd76839bdefd2830ab4.png

In the pop-up dialog,choose Create File…,rename it to system.xdc。

390264eff53f6f35e533ee17755d352d.png

reference ZYBO_Master.xdc, add LED and SW constraints altogether 8 lines。

ef9fdf06fd25d1427d978b1fa6d51ea6.png

Finally,In Flow Navigator,expand Program and Debug,click Generate Bitstream.

f8843952b6ed2424cde6239bde81f1d2.png

When bitstream generated,Bitstream Generation successful completeddialog will be open, Choose Open Implementation Design,Click OK to finish.

589b4ffee619a255e17c8b07c5bf81ce.png

In IP Integrator Item, click Open Block Design,choose zynq_system_1.bd,reopen the Block Design we built.

145c6927e37a5c2c599a51a0e572304a.png

Choose File > Export > Export Hardware for SDK….,Export Hardware for SDK dialogue will be open,make sure Include bitstream and Launch SDK has been choosed.

c771bb502d9d39add6d2a2020e3ee3c3.png

17af5e430a06d09eef36502e206658b9.png

4.Linux

4.1Compile u-boot

Enter u-boot source code folder and modify the boot file:

vi ./include/configs/zynq_zed.h

Modify line 39, insert code:

#define CONFIG_ZYNQ_PS_CLK_FREQ 50000000UL

Run the following command in u-boot source code folder.

make zynq_zed config

make

cp u-boot u-boot.elf

4.2Compile Kernel

Enter kernel source code folder, and run the following command.

cd linux-xlnx-xilinx-v2013.4

make ARCH=arm xilinx_zynq_defconfig

make ARCH=arm UIMAGE_LOADADDR=0x8000 uImage

cp arch/arm/boot/uImage .

4.3 Change Randisk

Run the following command and do the modify:

cp arm_ramdisk.image.gz ramdisk.image.gz

gunzip ramdisk.image.gz

mkdir file_tmp

mount ramdisk.image –o loop ./file_tmp/

Run the following command to repack to uramdisk:

sudo umount file_tmp/

gzip ramdisk.image

sudo apt-get install u-boot-tools

mkimage –A arm –T ramdisk –C gzip –d ramdisk.image.gz uramdisk.image.gz

5.References

http://pan.baidu.com/s/1bnq23UZ

原文:http://www.cnblogs.com/shenerguang/p/3886807.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值