码迷,mamicode.com
首页 > 系统相关 > 详细

Zybo GPIO Demo Run Embedded Linux

时间:2014-08-02 15:10:13      阅读:1289      评论:0      收藏:0      [点我收藏+]

标签:des   style   blog   http   os   io   for   2014   

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

git clone https://github.com/xupsh/CodeSourcery.git

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

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

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

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

2.5 Kernel Download

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

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。

bubuko.com,布布扣

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

bubuko.com,布布扣

Add a new block design,named design_1。

bubuko.com,布布扣

bubuko.com,布布扣

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

bubuko.com,布布扣

Double Click IP Core to configure it。

bubuko.com,布布扣

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

bubuko.com,布布扣

Download Link:

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

bubuko.com,布布扣

Now ZYNQ has been configured and fit for zybo。

bubuko.com,布布扣

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

bubuko.com,布布扣

Double click GPIO core to config it:

bubuko.com,布布扣

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

bubuko.com,布布扣

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。

bubuko.com,布布扣

bubuko.com,布布扣

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

bubuko.com,布布扣

bubuko.com,布布扣

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

bubuko.com,布布扣

bubuko.com,布布扣

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

bubuko.com,布布扣

bubuko.com,布布扣

Right click Constraints->constrs_1 and choose Add Source。

bubuko.com,布布扣

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

bubuko.com,布布扣

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

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

bubuko.com,布布扣

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

bubuko.com,布布扣

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

bubuko.com,布布扣

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

bubuko.com,布布扣

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.

bubuko.com,布布扣

bubuko.com,布布扣

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

Zybo GPIO Demo Run Embedded Linux,布布扣,bubuko.com

Zybo GPIO Demo Run Embedded Linux

标签:des   style   blog   http   os   io   for   2014   

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!