Zybo GPIO Demo Run Embedded Linux

Source: Internet
Author: User
Tags vivado

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.

In the device selection Pannel,we choose Xc7z010clg400-1 destdevice.

Add a new block design,named design_1.

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

Double Click IP Core to configure it.

Choose Import XPS settings,add zybo_zynq_def.xml,click OK.

Download Link:

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

Now ZYNQ have been configured and fit for Zybo.

Click Ok,go back to block design,click Add IP button again,insert GPIO IP core.

Double Click GPIO core to config it:

The configuration is as Follows:open Dual Channel,set, the bit width of each Channel to 4bit.

Click run Block Automation in the, and Run Connection Automation tips column, and Vivado would auto Connection and Configur E. Click OK in all the pop-up dialogs.

Click Refresh button at bottom left,the result is as follows.

In the Source window, choose Sources tab,right click design_1, choose Generate Output products ...

Right click zynq_system_1,choose Create HDL Wrapper, Keep Default,click OK, Vivado would Generate a top file for IP subsystem.

Right click Constraints->constrs_1 and choose Add Source.

In the pop-up dialog,choose Create file...,rename it to system.xdc.

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

Reference zybo_master.xdc, add LED and SW constraints altogether 8 lines.

Finally,in Flow Navigator,expand Program and Debug, click Generate bitstream.

When Bitstream generated,bitstream Generation Successful completed dialog would be open, Choose open Implement ation Design, Click OK to finish.

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

Choose File > Export > Export Hardware for SDK..., export Hardware for SDK dialogue'll be open,make sure in Clude bitstream and Launch SDK has been choosed.

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, 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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.