MYiR MYD-Y7Z010/007S User manual

MYD-Y7Z010/007S Board Linux Development Manual
Table of Contents
TABLE OF CONTENTS ........................................................................................................................................ 1
CHAPTER 1 OVERVIEW AND INTRODUCTION OF SOFTWARE RESOURCE .......................................................... 2
1.1 OVERVIEW ........................................................................................................................................................ 2
1.2 SOFTWARE RESOURCES ....................................................................................................................................... 2
CHAPTER 2 BUILD LINUX DEVELOPMENT ENVIRONMENT ................................................................................ 3
2.1 ESTABLISHMENT WORKING DIRECTORY................................................................................................................... 3
2.2 SET CROSS COMPILE TOOL ................................................................................................................................... 3
2.3 INSTALL TOOL .................................................................................................................................................... 3
CHAPTER 3 LINUX SYSTEM COMPILE ................................................................................................................ 3
3.1 COMPILE BOOTLOADER ....................................................................................................................................... 3
3.2 COMPILE LINUX KERNEL....................................................................................................................................... 4
3.3 CREATE ROOT FILESYSTEM.................................................................................................................................... 4
3.4 MAKE FILE SYSTEM............................................................................................................................................. 5
3.4.1Make Ramdisk ........................................................................................................................................ 5
3.4.2Modify Rootfs.......................................................................................................................................... 6
CHAPTER 4 DOWNLOAD LINUX SYSTEM ........................................................................................................... 6
4.1 CREATE A MICRO SD CARD .................................................................................................................................. 6
4.2 PREPARE IMAGE FILE........................................................................................................................................... 7
4.3 START INSTALL ................................................................................................................................................... 8
CHAPTER 5 LINUX APPLICATION ....................................................................................................................... 8
5.1 LED ................................................................................................................................................................ 9
5.2 CAN ............................................................................................................................................................... 9
APPENDIX I DISCLAIMER ................................................................................................................................ 10
APPENDIX II TECHNICAL SUPPORT AND WARRANTY ...................................................................................... 11
APPENDIX III CONTACT US .............................................................................................................................. 14

MYD-Y7Z010/007S Board Linux Development Manual
Chapter 1 Overview and Introduction of Software Resource
1.1 Overview
MYD-Y7Z010/007S Board provides abundant hardware and software resource. This manual will
start from building the environment and introduce how to develop a MYD-Y7Z010/007S Board
Linux program step by step. The development commands of this manual are illustrated based-on
Ubuntu system.
1.2 Software Resources
Category
Name
Remark
Code
Tool
chains
gcc 4.6.1
gcc version 4.6.1
(Sourcery CodeBench Lite 2011.09-50)
Boot
loader
boot.bin
First bootstrap Include FSBL and u-boot
Yes
Linux
Kernel
Linux 3.15.0
Linux kernel customized for the
MYD-Y7Z010/007S Board hardware
Yes
Driver
USB host
USB host driver
Yes
Ethernet
Gigabit Ethernet driver(3 net interfaces)
Yes
MMC/SD/TF
MMC/SD/TF card driver
Yes
UART
UART driver
Yes
UARTlite
Uartlite serial driver
Yes
CAN
CAN driver
Yes
LCD
LCD driver
Yes
HDMI
HDMI driver
Yes
LED
LED driver
Yes
GPIO
GPIO driver
Yes
File
system
Ramdisk
Ramdisk image system
Rootfs
Made by Buildroot
Yes
Table 1-1

MYD-Y7Z010/007S Board Linux Development Manual
Chapter 2 Build Linux Development Environment
2.1 Establishment Working Directory
Copy the document in MYD-Y7Z010/007S Board DVD disk to the host:
$ mkdir -p <WORKDIR>
$ cp -a <DVDROM>/04-Linux_Source/* <WORKDIR>
2.2 Set Cross Compile Tool
$ cd <WORKDIR>/Toolchain
$ tar xvjf Sourcery_CodeBench_Lite_for_Xilinx_GNU_Linux.tar.bz2
$ export PATH=$PATH:<WORKDIR>/Toolchain/\
CodeSourcery/Sourcery_CodeBench_Lite_for_Xilinx_GNU_Linux/bin
$ export CROSS_COMPILE=arm-xilinx-linux-gnueabi-
After executing the "export" commands, input “arm” and then press the Tab key to check whether
or not the "export" settings has been executed successfully. These settings are only valid for the
current terminal; if it is required to keep them permanently, please add above commands to script
file: “~/.bashrc”
2.3 Install Tool
Install other necessary tools:
$ sudo apt-get install build-essential git-core libncurses5-dev \
flex bison texinfo zip tar zlib1g-dev gettext \
gperf libsdl-dev libesd0-dev libwxgtk2.6-dev \
uboot-mkimage \
g++ xz-utils
Chapter 3 Linux System Compile
3.1 Compile Bootloader
Enter Bootloader director, tar U-boot source code:
$ cd <WORKDIR>/Bootloader

MYD-Y7Z010/007S Board Linux Development Manual
$ tar jxvf u-boot-xlnx.tar.bz2
$ cd u-boot-xlnx
Compile the source code:
$ make ARCH=arm CROSS_COMPILE=arm-xilinx-linux-gnueabi- distclean
$ make ARCH=arm CROSS_COMPILE=arm-xilinx-linux-gnueabi-\
zynq_myd_config
$ make ARCH=arm CROSS_COMPILE=arm-xilinx-linux-gnueabi-
After compiling, it will generate “u-boot” ELF files in the current directory.It is crucial to rename this
file to “u-boot.elf” when using this image to make “boot.bin”.
3.2 Compile Linux kernel
Enter the “Kernel”director, and tar the kernel source code:
$ cd <WORKDIR>/Kernel
$ tar xvjf linux-xlnx.tar.bz2
$ cd linux-xlnx
Compile the source code:
$ make ARCH=arm CROSS_COMPILE=arm-xilinx-linux-gnueabi- distclean
$ make ARCH=arm CROSS_COMPILE=arm-xilinx-linux-gnueabi- \
zynq_myd_defconfig
$ make ARCH=arm CROSS_COMPILE=arm-xilinx-linux-gnueabi- uImage
$ make ARCH=arm CROSS_COMPILE=arm-xilinx-linux-gnueabi- dtbs
After compiling, it will generate the “uImage” in the “arch/arm/boot” directory and the
“zynq_myd.dtb” file in the “arch/arm/boot/dts/” directory.
3.3 Create Root Filesystem
Create rootfs using buildroot in here. Enter the file system directory, extract buildroot source:
$ cd <WORKDIR>/Filesystem
$ tar jxvf buildroot-2015.02.tar.bz2
$ cd buildroot-2015.02
Rename the zynq_myd_config to .config:
$ cp zynq_myd_config .config
Configure:
$ make menuconfig
Set the path of Toolchain:
Toolchain --- >

MYD-Y7Z010/007S Board Linux Development Manual
() Toolchain path
Enter Toolchain path option, fill in the Toolchain path:
<WORKDIR>/Toolchain/CodeSourcery/Sourcery_CodeBench_Lite_for_Xilinx_GNU_Lin
ux
Exit and make:
$ make
After compiling, you will find the rootfs.tar in the “buildroot-2015.02/output/images”.
3.4 Make File System
3.4.1Make Ramdisk
⑴Mount ramdisk
Create a new directory “tmp”, and copy the “uramdisk.image.gz” to this directory:
$ cd <WORKDIR>/Filesystem
$ mkdir tmp
$ cp uramdisk.image.gz tmp/
$ cd tmp/
Delete the 64 bytes header file generated by “mkimage”, and generate a new “ramdisk.image.gz”:
$ dd if=uramdisk.image.gz of=ramdisk.image.gz bs=64 skip=1
gunzip “ramdisk.image.gz” to generate “ramdisk.image”:
$ gunzip ramdisk.image.gz
Create a new mount directory "ramdiskdir", and mount the “ramdisk.image” file:
$ mkdir -p ramdiskdir
$ sudo mount -o loop,rw ramdisk.image ramdiskdir
Enter the “ramdiskdir” directory, and modify it if necessary.
⑵Generatea new ramdisk
Synchronize the file system and unmount the ramdisk file system:
$ sync
$ sudo umount ramdiskdir
Compress “ramdisk.image” with gzip, and generate “ramdisk.image.gz”:
$ gzip -9 ramdisk.image
Add new head file with mkimage, generate a new “uramdisk.image.gz” file for u-boot:
$ mkimage -A arm -T ramdisk -C gzip -n Ramdisk -d ramdisk.image.gz
uramdisk.image.gz
Delete temporary file “ramdisk.image.gz”:

MYD-Y7Z010/007S Board Linux Development Manual
$ rm ramdisk.image.gz
3.4.2Modify Rootfs
(1)Extract the tar :
$ cd <WORKDIR>/Filesystem
$ mkdir -p rootfs
$ sudo tar xvf rootfs.tar –C ./rootfs/
(2)Modifying Filesystem,add new file.
(3)Archive tar
$ cd ./rootfs
$ sudo tar cvf ../rootfs.tar ./*
Chapter 4 Download Linux System
In here, we will boot from Micro SD Card using Ramdisk, then install bootloader and kernel to
QSPI-Flash, install rootfs to eMMC.
4.1 Create a Micro SD Card
⑴TF card format
Please format the TF Card using the “HP USB Disk Storage Format Tool 2.0.6” tool in directory
“03-Tools” of the DVD disk.
①Insert the TF card into the USB card reader, then connect the card reader with a
computer;
②Open “HP USB Disk Storage Format Tool 2.0.6”. It will prompt up a dialog as the
following:

MYD-Y7Z010/007S Board Linux Development Manual
Figure 4-1
③Select the "FAT32" file system;
④click “Start”;
⑤After formatting accomplishes, click “OK”.
NOTE: The “HP USB Disk Storage Format Tool 2.0.6” Tool will clear all data in the TF card.
Please make backup before formatting.
4.2 Prepare Image File
Copy the image to the Micro SD Card which just create. You can find all of them in the CDROM.
Image
Description
boot.bin
This is the system startup program, including“fsbl”, and “u-boot”.
The specific building methods will be described in "
MYD-Y7Z010/007S Board Programmable Logic Development
Manual".
7z010.bit
XC7Z010 Bitstream File
7z007.bit
XC7Z007S Bitstream File
uImage
Linux kernel
devicetree.dtb
Device Tree
uramdisk.image.gz
Ramdisk file system

MYD-Y7Z010/007S Board Linux Development Manual
uEnv.txt
U-boot Environment File
rootfs.tar
Root filesystem, it will copy to eMMC
Table 4-2
4.3 Start Install
⑴set sw1: 1 off, 2 on;
(2)Insert TF card which just copyed image. Connect the serial port, set baud rate to 115200,
then powered on;
(3) It will load into Ramdisk, Enter Linux command, keyin as follow:
welcome to myir board
myir login: root
[root@myir ~]#/updatesys.sh /mnt/mmcblk1p1
The script will be copy BOOT.bin, 7z010.bit/7z007.bit, devicetree.dtb and uImage into the
QSPI-Flash, copy the rootfs.tar to eMMC.
(4) After the programming is completed, set sw1: 1 on, 2 on, Power ON again.
Chapter 5 Linux Application
MYD-Y7Z010/007S Board provides demo programs for common peripherals. These programs
and source codes are storaged in the "<WORKDIR>/Examples/" directory. Please compile the
source codes according to the “Makefile” or “README” file in directory:
$ cd <WORKDIR>/Examples/
$ export CROSS_COMPILE=arm-xilinx-linux-gnueabi-
$ make
Connect J8, set the baud rate for 115200, 8 data bits, stop bits 1, no parity; Copy the
corresponding executable program to the development board. If the program can not be executed,
please execute the following command first:
# chmod +x <program-to-be-executed>

MYD-Y7Z010/007S Board Linux Development Manual
5.1 LED
This example demonstrates how to use LED by Linux API, please refer to the source codes for
detailed information.
Copy the executable file “led-test” from directory "<WORKDIR>/Examples/led-test" to the
development board, and connect J8 to PC. Execute the following command and the LED on the
development board, will flash rapidly:
# ./led-test
5.2 CAN
This example demonstrates how to use CAN by Linux API, please refer to the source codes for
detailed information.
Copy the executable file “can-test” from directory "<WORKDIR>/Examples/can-test" to the
development board, and connect J8 to PC. Execute the following command:
(Note: please connect the can interface on the board with the external can device to test the can
communication)
# ./can-test

MYD-Y7Z010/007S Board Linux Development Manual
Appendix I Disclaimer
This User Manual (the "Manual") is proprietary to MYIR Electronics Limited. ("MYIR") and no
ownership rights are hereby transferred. No part of the Manual shall be used, reproduced,
translated, converted, adapted, stored in a retrieval system, communicated or transmitted by any
means, for any commercial purpose, including without limitation, sale, resale, license, rental or
lease, without the prior express written consent of MYIR.
MYIR does not make any representations, warranties or guarantees, express or implied, as to the
accuracy or completeness of the Manual. Users must be aware that updates and amendments
will be made from time to time to the Manual. It is the user's responsibility to determine whether
there have been any such updates or amendments. Neither MYIR nor any of its directors, officers,
employees or agents shall be liable in contract, tort or in any other manner whatsoever to any
person for any loss, damage, injury, liability, cost or expense of any nature, including without
limitation incidental, special, direct or consequential damages arising out of or in connection with
the use of the Manual.

MYD-Y7Z010/007S Board Linux Development Manual
Appendix II Technical Support and Warranty
MYIR Electronics Limited (“MYIR”) is a global provider of ARM hardware and software tools,
design solutions for embedded applications. We support our customers in a wide range of
services to accelerate your time to market.
MYIR is an ARM Connected Community Member and work closely with ARM and many
semiconductor vendors. We sell products ranging from board level products such as development
boards, single board computers and CPU modules to help with your evaluation, prototype, and
system integration or creating your own applications. Our products are used widely in industrial
control, medical devices, consumer electronic, telecommunication systems, Human Machine
Interface (HMI) and more other embedded applications. MYIR has an experienced team and
provides custom design services based on ARM processors to help customers make your idea a
reality.
The contents below introduce to customers the warranty and technical support services provided
by MYIR as well as the matters needing attention in using MYIR’s products.
Service Guarantee
MYIR regards the product quality as the life of an enterprise. We strictly check and control the
core board design, the procurement of components, production control, product testing,
packaging, shipping and other aspects and strive to provide products with best quality to
customers. We believe that only quality products and excellent services can ensure the long-term
cooperation and mutual benefit.
Price
MYIR insists on providing customers with the most valuable products. We do not pursue excess
profits which we think only for short-time cooperation. Instead, we hope to establish long-term
cooperation and win-win business with customers. So we will offer reasonable prices in the hope
of making the business greater with the customers together hand in hand.
NCNR (Non-cancellation of orders and non-return of goods)
No returns or cancellations will be accepted without prior written agreement from MYIR.
Delivery Time
MYIR will always keep a certain stock for its regular products. If your order quantity is less than
the amount of inventory, the delivery time would be within three days; if your order quantity is
greater than the number of inventory, the delivery time would be always four to six weeks. If for
any urgent delivery, we can negotiate with customer and try to supply the goods in advance.
Technical Support
MYIR has a professional technical support team. Customer can contact us by email

MYD-Y7Z010/007S Board Linux Development Manual
(support@myirtech.com), we will try to reply you within 48 hours. For mass production and
customized products, we will specify person to follow the case and ensure the smooth production.
After-sale Service
MYIR offers 12 months free technical support and after-sales maintenance service from the
purchase date. The service covers:
1. Technical support service
MYIR offers technical support for the hardware and software materials which have provided to
customers;
To help customers compile and run the source code we offer;
To help customers solve problems occurred during operations if users follow the user manual
documents;
To judge whether the failure exists;
To provide free software upgrading service.
However, the following situations are not included in the scope of our free technical
support service:
Hardware or software problems occurred during customers’ own development;
Problems occurred when customers compile or run the OS which is tailored by themselves;
Problems occurred during customers’ own applications development;
Problems occurred during the modification of MYIR’s software source code.
2. After-sales maintenance service
The products except LCD, which are not used properly, will take the twelve months free
maintenance service since the purchase date. But following situations are not included in the
scope of our free maintenance service:
The warranty period is expired;
The customer cannot provide proof-of-purchase or the product has no serial number;
The customer has not followed the instruction of the manual which has caused the damage the
product;
Due to the natural disasters (unexpected matters), or natural attrition of the components, or
unexpected matters leads the defects of appearance/function;
Due to the power supply, bump, leaking of the roof, pets, moist, impurities into the boards, all
those reasons which have caused the damage of the products or defects of appearance;
Due to unauthorized weld or dismantle parts or repair the products which has caused the damage
of the products or defects of appearance;
Due to unauthorized installation of the software, system or incorrect configuration or computer
virus which has caused the damage of products.
Warm tips:
MYIR does not supply maintenance service to LCD. We suggest the customer first check the LCD
when receiving the goods. In case the LCD cannot run or no display, customer should contact
MYIR within 7 business days from the moment get the goods.
Please do not use finger nails or hard sharp object to touch the surface of the LCD.
MYIR suggests user purchasing a piece of special wiper to wipe the LCD after long time use,
please avoid clean the surface with fingers or hands to leave fingerprint.
Do not clean the surface of the screen with chemicals.

MYD-Y7Z010/007S Board Linux Development Manual
Please read through the product user manual before you using MYIR’s products.
For any maintenance service, customers should communicate with MYIR to confirm the issue first.
MYIR’s support team will judge the failure to see if the goods need to be returned for repair
service, we will issue you RMAnumber for return maintenance service after confirmation.
3. Maintenance period and charges
a) MYIR will test the products within three days after receipt of the returned goods and inform
customer the testing result. Then we will arrange shipment within one week for the repaired goods
to the customer. For any special failure, we will negotiate with customers to confirm the
maintenance period.
b) For products within warranty period and caused by quality problem, MYIR offers free
maintenance service; for products within warranty period but out of free maintenance service
scope, MYIR provides maintenance service but shall charge some basic material cost; for
products out of warranty period, MYIR provides maintenance service but shall charge some basic
material cost and handling fee.
4. Shipping cost
During the warranty period, the shipping cost which delivered to MYIR should be responsible by
user; MYIR will pay for the return shipping cost to users when the product is repaired. If the
warranty period is expired, all the shipping cost will be responsible by users.
5. Products Life Cycle
MYIR will always select mainstream chips for our design, thus to ensure at least ten years
continuous supply; if meeting some main chip stopping production, we will inform customers in
time and assist customers with products updating and upgrading.
Value-added Services
MYIR provides services of driver development base on MYIR’s products, like serial port, USB,
Ethernet, LCD, etc.
MYIR provides the services of OS porting, BSP drivers’ development, API software development,
etc.
MYIR provides other products supporting services like power adapter, LCD panel, etc.
ODM/OEM services.

MYD-Y7Z010/007S Board Linux Development Manual
Appendix III Contact Us
MYIR Electronics Limited
Address:
Room 05, 6th Floor, Building No.2, Fada Road,
Yunli Intelligent Park, Bantian, Longgang District,
Shenzhen, Guangdong,
China 518129
Phone: +86-755-22984836
Fax: +86-755-25532724
Sales E-mail: sales@myirtech.com or myirtech@yahoo.com
Support E-mail: support@myirtech.com (support)
Website: http://www.myirtech.com
Thanks for using MYIR’s products and services. For more information, please refer to the website or contact MYIR.
Table of contents
Other MYiR Motherboard manuals