MYiR MYD-Y6ULX Linux User manual


1.1
1.2
1.3
1.4
1.4.1
1.4.2
1.4.3
1.4.3.1
1.4.3.2
1.5
1.5.1
1.5.2
1.5.3
1.5.4
1.5.5
1.5.6
1.5.7
1.5.8
1.5.9
1.5.10
1.5.11
1.5.12
1.5.13
1.5.14
1.6
1.6.1
1.6.2
1.6.3
1.7
1.7.1
1.7.2
1.8
Table of Contents
Preface
1 Software Resource
2 Deploy Development Environment
3 Build Linux System
3.1 U-Boot
3.2 Linux Kernel
3.3 Build Filesystem
3.3.1 Yocto build Linux system
3.3.2 Yocto build SDK package
4 Linux Application Development
4.1 Test LCD
4.2 Test TouchPanel
4.3 Test Ethernet
4.4 Test GPIO-KEY
4.5 Test GPIO-LED
4.6 Test USB Host
4.7 Test USB Device
4.8 Test RS485
4.9 Test RS232
4.10 Test CAN bus
4.11 Test Audio
4.12 Test Camera
4.13 Test WiFi
4.14 Test 4G LTE
5 QT Application Development
5.1 Install QtCreator
5.2 Config QtCreator
5.3 Test Qt exapmle
6 Update System
6.1 USB Update Method
6.2 SD Card Method
AppendixA
2

MYD-Y6ULX Linux Development Guide
This document introduce the MYD-Y6ULX development board about Linux compile and deploy, interface usage on baseboard, Qt application development etc.
Version History
Version Description Date
V1.0 Initialize version 2017.10.09
V1.1 Add MYD-Y6UL board 2018.01.15
Hardware Version
This document suit list:
MYD-Y6ULL
MYD-Y6UL
3

1 Software Resource
MYD-Y6ULX series boards support the Linux kernel version 4.1.15, and provided with rich hardware resource and software resource.
Below is MYD-Y6ULX software resource table:
Categary Name Description Source
Bootloader U-boot u-boot.imx will boot chip to work YES
Linux kernel Linux 4.1.15 Based on official version imx_4.1.15_2.0.0_ga YES
Driver USB Host USB Host YES
Driver USB OTG USB OTG driver YES
Driver I2C I2C bus driver YES
Driver Ethernet 10/100Mbps ethernet driver YES
Driver MMC MMC/SDIO/TF Card YES
Driver LCD Supports 4.3inch and 7.0 inch YES
Driver RTC Read/write real date time YES
Driver Touch Panel Supports Capacity and Resistive touch panel YES
Driver USART Serial port driver YES
Driver LED GPIO LED YES
Driver KEY GPIO KEY YES
Driver Audio WM8904 codec driver YES
Driver CAN bus CAN bus driver YES
Driver RS485 RS485 bus driver YES
Driver Camera OV2659 driver YES
Driver WiFi module USI module(BCM43362 chip) use SDIO driver YES
Driver LTE module(Optional) 4G module(Quectl EC20) use USB driver YES
FileSystem Yotcto rootfs Based Yocto build filesystem(include Qt 5.6 package) YES
FileSystem Yotcto rootfs Based Yocto build filesystem(Full command line package) YES
Application GPIO KEY Reads the GPIO key code value demo YES
Application GPIO LED Operate the GPIO LED demo YES
Application NET Uses TCP/IP Sokect API, support Client and Server demo YES
Application RTC Read/write real date time demo YES
Application RS232 Read/write RS232 port demo YES
Application Audio Audio play/capture demo YES
Application Framebuffer LCD test program YES
Toolchain Cross compiler Linaro GCC 4.9 Hardfloat BINARY
Toolchain Cross compiler Yocto GCC 5.3 Hardfloat BINARY
Table1-1 Software Resource
4

2 Deploy Development Environment
You need to install the Linux Operation System on your host PC.Recommend to use the Ubuntu 16.04 64bit distribution, and connect the network.Next steps we will install
some packages from internet.
Connect development board with PC
1. PC use USB to TLL cable with DEBUG port(JP1) on board.
2. Open serial program with exist serial device
PC serial port configure parameters:
Baudrate: 115200
Data bit: 8bit
Parity: None
Stop bit: 1bit
Flow control: Disable
Figure2-1 MYC-Y6ULX top view
Figure2-2 MYD-Y6ULX top view
The core moudle of MYD-Y6ULX series boards has two models, MYC-Y6UL and MYC-Y6ULL.
Install necessary software packages
sudo apt-get install build-essential git-core libncurses5-dev flex bison \
texinfo zip unzip zlib1g-dev gettext u-boot-tools g++ xz-utils mtd-utils \
gawk diffstat gcc-multilib
Build work directory
Create a working directory to facilitate the creation of an unified environment variable path. Copy the product CD-ROM source code to the working directory, while setting the
DEV_ROOT variable to enable the follow-up step path accessed.
mkdir -p ~/MYD-Y6ULX-devel
export DEV_ROOT=~/MYD-Y6ULX-devel
cp -r <DVDROM>/02-Images $DEV_ROOT
cp -r <DVDROM>/03-Tools $DEV_ROOT
cp -r <DVDROM>/04-Source $DEV_ROOT
Configure toolchain
Linaro toolchain : gcc version 4.9.3 20141031 (prerelease) (Linaro GCC 2014.11)
Yocto toolchain: gcc version 5.3.0 (GCC)
There are two cross compile toolchains, one is support by Linaro.Another built by Yocto.Recommend you use Yocto toolchain to build all source code.
Linaro Toolchain
cd $DEV_ROOT/
tar -xvjf 03-Tools/Toolchain/gcc-linaro-4.9-2014.11-x86_64_arm-linux-gnueabihf.tar.xz
export PATH=$PATH:$DEV_ROOT/gcc-linaro-4.9-2014.11-x86_64_arm-linux-gnueabihf/bin
export CROSS_COMPILE=arm-linux-gnueabihf-
export ARCH=arm
Check if the toolchain is correct using below command.You have setup correct environment on current SHELL when you get version infomation.If you want it always
available, you need to modify your shell config file.
$ arm-linux-gnueabihf-gcc --version
arm-linux-gnueabihf-gcc (Linaro GCC 2014.11) 4.9.3 20141031 (prerelease)
Copyright (C) 2014 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
5

Yocto Toolchain
Yocto provide two kinds toolchain, one is low-level development toolchain meta-toolchain, another is application development toolchain.The low-level toolchain likes
Linaro.The another used for application development, include more third-party libaries and header files.The MYD-Y6ULX also supports two kinds, those files are list below.
Toolchain file name Description
myir-imx-fb-glibc-x86_64-fsl-image-qt5-cortexa7hf-neon-toolchain-4.1.15-2.0.1.sh toolchain for fsl-image-qt5 system image, icludes Qt5 libraries
myir-imx-fb-glibc-x86_64-core-image-base-cortexa7hf-neon-toolchain-4.1.15-2.0.1.sh toolchain for core-image-base system image, without any graphics libraries
myir-imx-fb-glibc-x86_64-meta-toolchain-cortexa7hf-neon-toolchain-4.1.15-2.0.1.sh meta-toolchain
Yocto toolchain distribute SDK package type. You need install the toolchain SDK package, then use it. Below is install method:
Run shell script as normal user.It will request you to input install path, default is under "/opt" directory.Then you will reuquest to set permission to directory. You can use
"source" or "." to load toolchain environment to current shell when your installation finish.
Below example intall the toolchain into '/opt/myir-imx6ulx-fb/4.1.15-2.0.1' directory.
$ ./myir-imx-fb-glibc-x86_64-fsl-image-qt5-cortexa7hf-neon-toolchain-4.1.15-2.0.1.sh
Freescale i.MX Release Distro SDK installer version 4.1.15-2.0.1
================================================================
Enter target directory for SDK (default: /opt/myir-imx-fb/4.1.15-2.0.1): /opt/myir-imx6ulx-fb/4.1.15-2.0.1
Do You are about to install the SDK to "/opt/myir-imx6ulx-fb/4.1.15-2.0.1". Proceed[Y/n]? Y
[sudo] password for kevinchen:
Extracting SDK..................................................
................................................................
...............done
Setting it up...done
SDK has been successfully set up and is ready to be used.
Each time you wish to use the SDK in a new shell session, you ne
ed to source the environment setup script e.g.
$ . /opt/myir-imx6ulx-fb/4.1.15-2.0.1/environment-setup-cortexa7hf-neon-poky-linux-gnueabi
Check the toolchain SDK is correct after installation.Using the "source" command to load environment file to shell and check the compiler version.
source /opt/myir-imx6ulx-fb/4.1.15-2.0.1/environment-setup-cortexa7hf-neon-poky-linux-gnueabi
arm-poky-linux-gnueabi-gcc --version
arm-poky-linux-gnueabi-gcc (GCC) 5.3.0
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
According the steps, you can install the low-level toolchain meta-toolcahin.Please input different path to store the toolchain, otherwize it will cover existing files in same
directory.
6

3 Build Linux System
This chapter introduces how to build components of Linux system. The MYD-Y6ULX includes below parts:
U-Boot: First level bootloader.
Linux Kernel: Linux kernel 4.1.15 and drivers suit for MYD-Y6ULX board.
Yocto: An open source collaboration project that provides templates, tools and methods to help you create custom Linux-based system for embedded products
regardless of the hardware architecture.
These software are locating in 04-Source directory.Some packages use ID number in file name.
Before compile u-boot and Linux kernel source code, you need install meta-toolchain and load the environment variables into current shell.
7

3.1 Compiling U-Boot
Enter Bootloader directory, extract U-boot source tar source package:
cd $DEV_ROOT/04-Source
tar -xvf MYiR-iMX-uboot.tar.gz
cd MYiR-iMX-uboot
Compiling:
make distclean
make <config>
make
The option value is different boot mode. The MYD-Y6ULX supports two boot modes.
Boot Mode Config file
MYD-Y6ULL NAND Flash myd_y6ull_14x14_nand_defconfig
MYD-Y6ULL eMMC Flash myd_y6ull_14x14_emmc_defconfig
MYD-Y6ULX NAND Flash myd_y6ul_14x14_nand_defconfig
MYD-Y6ULX eMMC Flash myd_y6ul_14x14_emmc_defconfig
U-Boot SD boot mode will search and execute a script file "boot.scr" when U-Boot booting up. It used to change boot type in temporary.Next is use TFTP to download
zImage and dtb to boot system as example. Using mkimage tool through "myd-y6ull-boot-mmc0-tftp.txt" to generate the "boot.scr" file as example. The mkimage tool
source code is locating in "U-Boot/tools" directory. It will be compiled after U-Boot compiled.
cat myd-y6ull-boot-mmc0-tftp.txt
setenv mmcroot '/dev/mmcblk0p2 rootwait rw rootdelay=5 mem=256M'
run mmcargs
tftpboot 0x83000000 zImage
tftpboot 0x84000000 myd-y6ull-gpmi-weim.dtb
bootz 0x83000000 - 0x84000000
./tool/mkimage -A arm -T script -O linux -d myd-y6ull-boot-mmc0-tftp.txt boot.scr
8

3.2 Linux Kernel
Enter Kernel directory, extract it:
cd $DEV_ROOT/04-Source
tar -xvf MYiR-iMX-Linux.tar.gz
cd MYiR-iMX-Linux
Compiling:
make distclean
make myd_y6ulx_defconfig
make zImage dtbs
When the compilation is done, the kernel image file zImage is generated in the 'arch/arm/boot' directory, and the DTB file is generated in the 'arch/arm/boot/dts'
directory.
DTB File Description
myd-y6ull-14x14-gpmi-weim.dtb MYD-Y6ULL NAND boot
myd-y6ull-14x14-emmc.dtb MYD-Y6ULL eMMC boot
myd-y6ul-14x14-gpmi-weim.dtb MYD-Y6UL NAND boot
myd-y6ul-14x14-emmc.dtb MYD-Y6UL eMMC boot
The MYD-Y6ULX Micro SD slot is connected to mmc0 controller.So, all dtb files is enabled the mmc0 controller by default.
About SD card boot mode, the U-Boot default find the myd-y6ull-14x14-evk-gpmi-weim.dtb file.
When you build kernel complete, the version tag will changed automatically.If you driver load with module type, you should recompile driver module.
make modules
After compile completation, it will be installed specify path:
mkdir ../target-kernel
make INSTALL_MOD_PATH=../target-kernel modules_install
Then you can package the target-kernel directory and extract it into /lib directory on file system of MYD-Y6ULX board.
9

3.3 Build File System
The Linux platform has many open source tools to build filesystem.These tools has some features to help developer build filesystem more easier in system build or
customize it.Recently, some are more populator Buildroot, Yocto, OpenEmbedded etc.The Yocto project support more powerful and system method to build a linux system
to suit your product.
Yocto not only a build tool for file system, it also has full workflow to build and maintain under Linux. It makes platform developer and application developer working
together under same framework. And resolve non-united and non-manage on the legacy develop way.
Yocto is an open source "umbrella" project.It means has more sub-projects.Yocto just containe all other projects and support an reference build system "Poky". The Poky
project will guide developer how to use, build, embedded Linux system.It has Bitbake, OpenEmbedded-Core, BSP package and more kinds of software packages and config
files.Through Poky to build different requirment system, eg: the minimal system core-image-minimal, include GUI system fsl-image-gui, include Qt5 graphics system fsl-
image-qt5.
NXP i.MX6UL/i.MX6ULL support build file to apply on Yocto project.These files will build a customization system by NXP.We also provide config files to support MYD-Y6ULX
series boards.This will help developer to build Linux system that can be programming to MYD-Y6ULX series boards.
Yocto has more rich development resource, help engineers to learn and customization the system. This document can't cover full usage on Yocto.We recommend developer
to build system after reading these documents.
Yocto Project Quick start
Bitback User Manual
Yocto Project Reference Manual
Yocto Project Development Manual
Yocto Project Complete Documentation Set
10

3.3.1 Yocto build Linux system
This section suit for developer on customization file system.If you just want to use it, please use the prebuilt file system.
The Yocto needs download all third-party software packages from internet.In order to build more speedly, MYD-Y6ULX also support a full package, you desn't need
download again.
Attention: Building Yocto does not use previous toolchain, please open new tab for shell or new terminal window.
MYD-Y6ULX support full Yocto package
Extract Yocto source package, and extract the Yocto-downloads.tar.xz into Yocto source direcotry.The Yocto-downloads.tar.xz includes all packages when building MYD-
Y6ULX from Yocto.
Attention: The Yocto-downloads.tar.xz file is more large, it is not include in MYD-Y6ULX iso file.Please visit and download it from http://d.myirtech.com/MYD-Y6ULX.
cd $DEV_ROOT
tar xvf 04-Source/fsl-release-yocto.tar.xz
tar xvf 04-Source/Yocto-downloads.tar.xz -C fsl-release-yocto
Last, also needs put the kernel and u-boot source into your home directory in linux.It will be fetched with Yocto.
tar xvf 04-Source/MYiR-iMX-Linux.tar.gz -C ~/
tar xvf 04-Source/MYiR-iMX-uboot.tar.gz -C ~/
Init Yocto build directory
Use script by NXP supported, create a build directory, and Yocto will build all under it. The MACHINE has two value, "myd-y6ull14x14" and "myd-y6ul14x14".
cd fsl-release-bsp
DISTRO=myir-imx-fb MACHINE=myd-y6ull14x14 source fsl-setup-release.sh -b build
tree conf/
conf/
├── bblayers.conf
├── bblayers.conf.org
├── local.conf
├── local.conf.org
├── local.conf.sample
├── sanity_info
└── templateconf.cfg
Build system image with Qt5 package
The first build will cost more time, please take a coffee and wait it completion.
bitbake fsl-image-qt5
Build system image with full command line packages
You doesn't need to modify any file, just let Yocto to build it.
bitbake core-image-base
Image Name Description Used for
core-image-minimal minimal file system used for MYD-Y6ULX to minimal system
core-image-base base file system has more command line feature full commnand line system, no GUI
fsl-image-qt5 system use Qt5 as GUI used for graphics requirment
After build process finish, it will output manifest file.This file has each package name and version be installed to target file system.
The first build process of Yocto will take more time, this depend on your PC cpu core number and RAM size. The Yocto recommend use eight core CPU and SSD hardware
to impove build speed. Additionally, the Yocto will generate cache after first build, the next build process also save more time for you.
All output files are in "tmp/deploy/images/myd-y6ul14x14/" directory after build complete. Below as example:
ls -lh tmp/deploy/images/myd-y6ull14x14/
total 1.4G
-rw-r--r-- 1 kevinchen kevinchen 64M Oct 11 16:16 core-image-base-myd-y6ull14x14-20171011081338.rootfs.ext4
-rw-r--r-- 1 kevinchen kevinchen 4.4K Oct 11 16:16 core-image-base-myd-y6ull14x14-20171011081338.rootfs.manifest
-rw-r--r-- 1 kevinchen kevinchen 80M Oct 11 16:16 core-image-base-myd-y6ull14x14-20171011081338.rootfs.sdcard
-rw-r--r-- 1 kevinchen kevinchen 15M Oct 11 16:16 core-image-base-myd-y6ull14x14-20171011081338.rootfs.tar.bz2
-rw-r--r-- 1 kevinchen kevinchen 11M Oct 11 16:16 core-image-base-myd-y6ull14x14-20171011081338.rootfs.tar.xz
-rw-r--r-- 1 kevinchen kevinchen 64M Oct 11 16:48 core-image-base-myd-y6ull14x14-20171011084756.rootfs.ext4
-rw-r--r-- 1 kevinchen kevinchen 4.4K Oct 11 16:48 core-image-base-myd-y6ull14x14-20171011084756.rootfs.manifest
-rw-r--r-- 1 kevinchen kevinchen 80M Oct 11 16:48 core-image-base-myd-y6ull14x14-20171011084756.rootfs.sdcard
-rw-r--r-- 1 kevinchen kevinchen 15M Oct 11 16:48 core-image-base-myd-y6ull14x14-20171011084756.rootfs.tar.bz2
-rw-r--r-- 1 kevinchen kevinchen 11M Oct 11 16:48 core-image-base-myd-y6ull14x14-20171011084756.rootfs.tar.xz
lrwxrwxrwx 1 kevinchen kevinchen 57 Oct 11 16:48 core-image-base-myd-y6ull14x14.ext4 -> core-image-base-myd-y6ull14x14-20171011084756.rootfs.ext4
lrwxrwxrwx 1 kevinchen kevinchen 61 Oct 11 16:48 core-image-base-myd-y6ull14x14.manifest -> core-image-base-myd-y6ull14x14-20171011084756.rootfs.manifest
lrwxrwxrwx 1 kevinchen kevinchen 59 Oct 11 16:48 core-image-base-myd-y6ull14x14.sdcard -> core-image-base-myd-y6ull14x14-20171011084756.rootfs.sdcard
lrwxrwxrwx 1 kevinchen kevinchen 60 Oct 11 16:48 core-image-base-myd-y6ull14x14.tar.bz2 -> core-image-base-myd-y6ull14x14-20171011084756.rootfs.tar.bz2
lrwxrwxrwx 1 kevinchen kevinchen 59 Oct 11 16:48 core-image-base-myd-y6ull14x14.tar.xz -> core-image-base-myd-y6ull14x14-20171011084756.rootfs.tar.xz
-rw-r--r-- 1 kevinchen kevinchen 532M Oct 11 17:02 fsl-image-qt5-myd-y6ull14x14-20171011090003.rootfs.ext4
-rw-r--r-- 1 kevinchen kevinchen 7.3K Oct 11 17:02 fsl-image-qt5-myd-y6ull14x14-20171011090003.rootfs.manifest
-rw-r--r-- 1 kevinchen kevinchen 548M Oct 11 17:02 fsl-image-qt5-myd-y6ull14x14-20171011090003.rootfs.sdcard
-rw-r--r-- 1 kevinchen kevinchen 111M Oct 11 17:02 fsl-image-qt5-myd-y6ull14x14-20171011090003.rootfs.tar.bz2
-rw-r--r-- 1 kevinchen kevinchen 64M Oct 11 17:02 fsl-image-qt5-myd-y6ull14x14-20171011090003.rootfs.tar.xz
lrwxrwxrwx 1 kevinchen kevinchen 55 Oct 11 17:02 fsl-image-qt5-myd-y6ull14x14.ext4 -> fsl-image-qt5-myd-y6ull14x14-20171011090003.rootfs.ext4
lrwxrwxrwx 1 kevinchen kevinchen 59 Oct 11 17:02 fsl-image-qt5-myd-y6ull14x14.manifest -> fsl-image-qt5-myd-y6ull14x14-20171011090003.rootfs.manifest
lrwxrwxrwx 1 kevinchen kevinchen 57 Oct 11 17:02 fsl-image-qt5-myd-y6ull14x14.sdcard -> fsl-image-qt5-myd-y6ull14x14-20171011090003.rootfs.sdcard
lrwxrwxrwx 1 kevinchen kevinchen 58 Oct 11 17:02 fsl-image-qt5-myd-y6ull14x14.tar.bz2 -> fsl-image-qt5-myd-y6ull14x14-20171011090003.rootfs.tar.bz2
lrwxrwxrwx 1 kevinchen kevinchen 57 Oct 11 17:02 fsl-image-qt5-myd-y6ull14x14.tar.xz -> fsl-image-qt5-myd-y6ull14x14-20171011090003.rootfs.tar.xz
-rw-r--r-- 2 kevinchen kevinchen 1.3M Oct 11 16:47 modules--4.1.15-r0-myd-y6ull14x14-20171011084447.tgz
lrwxrwxrwx 1 kevinchen kevinchen 52 Oct 11 16:47 modules-myd-y6ull14x14.tgz -> modules--4.1.15-r0-myd-y6ull14x14-20171011084447.tgz
-rw-r--r-- 2 kevinchen kevinchen 294 Oct 11 17:01 README_-_DO_NOT_DELETE_FILES_IN_THIS_DIRECTORY.txt
lrwxrwxrwx 1 kevinchen kevinchen 26 Oct 11 16:01 u-boot.imx -> u-boot-nand-2016.03-r0.imx
lrwxrwxrwx 1 kevinchen kevinchen 26 Oct 11 16:01 u-boot.imx-nand -> u-boot-nand-2016.03-r0.imx
lrwxrwxrwx 1 kevinchen kevinchen 24 Oct 11 16:01 u-boot.imx-sd -> u-boot-sd-2016.03-r0.imx
lrwxrwxrwx 1 kevinchen kevinchen 26 Oct 11 16:01 u-boot-myd-y6ull14x14.imx -> u-boot-nand-2016.03-r0.imx
lrwxrwxrwx 1 kevinchen kevinchen 26 Oct 11 16:01 u-boot-myd-y6ull14x14.imx-nand -> u-boot-nand-2016.03-r0.imx
lrwxrwxrwx 1 kevinchen kevinchen 24 Oct 11 16:01 u-boot-myd-y6ull14x14.imx-sd -> u-boot-sd-2016.03-r0.imx
11

-rwxr-xr-x 2 kevinchen kevinchen 395K Oct 11 16:01 u-boot-nand-2016.03-r0.imx
-rwxr-xr-x 2 kevinchen kevinchen 343K Oct 11 16:01 u-boot-sd-2016.03-r0.imx
lrwxrwxrwx 1 kevinchen kevinchen 51 Oct 11 16:47 zImage -> zImage--4.1.15-r0-myd-y6ull14x14-20171011084447.bin
-rw-r--r-- 2 kevinchen kevinchen 6.2M Oct 11 16:47 zImage--4.1.15-r0-myd-y6ull14x14-20171011084447.bin
-rw-r--r-- 2 kevinchen kevinchen 37K Oct 11 16:47 zImage--4.1.15-r0-myd-y6ull-gpmi-weim-20171011084447.dtb
lrwxrwxrwx 1 kevinchen kevinchen 51 Oct 11 16:47 zImage-myd-y6ull14x14.bin -> zImage--4.1.15-r0-myd-y6ull14x14-20171011084447.bin
lrwxrwxrwx 1 kevinchen kevinchen 56 Oct 11 16:47 zImage-myd-y6ull-gpmi-weim.dtb -> zImage--4.1.15-r0-myd-y6ull-gpmi-weim-20171011084447.dtb
Some files are link file in output files.Below is description:
File Name Usage
*.rootfs.manifest The list of system include packages
*.rootfs.ext4 File system package to EXT4 format file
*.rootfs.sdcard Image can be write to SD card and boot from SD card
*.rootfs.tar.bz2 File system package to tar.bz2
*.rootfs.tar.xz File system package to tar.xz
u-boot-emmc-2016.03-r0.imx u-boot used for booting from eMMC
u-boot-nand-2016.03-r0.imx u-boot used for booting from NAND
u-boot-sd-2016.03-r0.imx u-boot used for booting SD card
Bitbake common usage
Bitbake arguments Description
-c fetch Download package from predefined of recipe
-c cleanall Clean all build directory
-c deploy Deploy image or package to target rootfs
-k Continue when error occure
-c compile Recompile image or package
12

3.3.2 Yocto build SDK pakcage
Yocto supports SDK generating function. It used for low-level or application level to compile source code.You doesn't need to manually handle the dependency softwares or
libraries.The SDK package has two different way, one is suit low-level deveop toolchain, used for compile u-boot and linux.Another used for application development, it
contains header files and libraries on target sysroot. The developer will be more convenient to development program to target device. The two kinds SDK package use shell
self-extra file, it will be installed under "/opt" directory.
Build low-level toolchain
bitbake meta-toolchain
The directory "tmp/deploy/sdk" has three files after build finish:
$ ls tmp/deploy/sdk/ -lh
-rw-r--r-- 1 kevinchen kevinchen 9.5K Apr 17 00:00 myir-imx6ulx-fb-glibc-x86_64-meta-toolchain-cortexa7hf-neon-toolchain-4.1.15-2.0.1.host.manifest
-rwxr-xr-x 1 kevinchen kevinchen 76M Apr 17 00:01 myir-imx6ulx-fb-glibc-x86_64-meta-toolchain-cortexa7hf-neon-toolchain-4.1.15-2.0.1.sh
-rw-r--r-- 1 kevinchen kevinchen 1.6K Apr 17 00:00 myir-imx6ulx-fb-glibc-x86_64-meta-toolchain-cortexa7hf-neon-toolchain-4.1.15-2.0.1.target.manifest
Here has two kinds manifest file, "host.manifest" is a list of host software packages, "target.manifest" is a list of target device packages.
Build application-level toolchain
The application-level toolchain use same name with Image.This case you can use "fsl-image-qt5" or "core-iamge-base" as image name argument.
bitbake -c populate_sdk <image name>
The directory "tmp/deploy/sdk/" has three files after build finish:
$ ls tmp/deploy/sdk/ -lh
-rw-r--r-- 1 kevinchen kevinchen 9.5K Apr 17 07:54 myir-imx6ulx-fb-glibc-x86_64-fsl-image-qt5-cortexa7hf-neon-toolchain-4.1.15-2.0.1.host.manifest
-rwxr-xr-x 1 kevinchen kevinchen 587M Apr 17 07:59 myir-imx6ulx-fb-glibc-x86_64-fsl-image-qt5-cortexa7hf-neon-toolchain-4.1.15-2.0.1.sh
-rw-r--r-- 1 kevinchen kevinchen 70K Apr 17 07:54 myir-imx6ulx-fb-glibc-x86_64-fsl-image-qt5-cortexa7hf-neon-toolchain-4.1.15-2.0.1.target.manifest
The ".host.manifest" is a list of host install packages. The ".target.manifest" is a list of target device installed packages.The file "myir-imx6ulx-fb-glibc-x86_64-fsl-image-
qt5-cortexa7hf-neon-toolchain-4.1.15-2.0.1.sh" is SDK toolchain. It can be distributed and installed to other Linux system and compile program to target device.
13

4 Linux Application Development
The hardware peripherals and application examples of MYD-Y6ULX development board.
Before use, you need use Yocto SDK toolchain to compile all the example code, and copy to the development board directory.
Compile example program
Load the toolchain environment to current shell, and check the gcc version to verify environment correct.
$source /opt/myir-imx6ulx-fb/4.1.15-2.0.1/environment-setup-\
cortexa7hf-neon-poky-linux-gnueabi
$arm-poky-linux-gnueabi-gcc --version
$arm-poky-linux-gnueabi-gcc --version
arm-poky-linux-gnueabi-gcc (GCC) 5.3.0
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Compile the sample code:
$cd $DEV_ROOT/04-Sources
$tar xvf example.tar.bz2
$cd example
$make
14

4.1 Test LCD
This example demonstrates the operation of the FrameBuffer of Linux, enabling color and color grid testing.You need connect the LCD to MYD-Y6ULX board LCD
interface(J3).
We have three kinds LCD with touch panel.The MY-TFT043RV2 is default on.
Model Descritpion
MY-TFT070CV2 7-inch capacitive screen
MY-TFT070RV2 7-inch resisitive screen
MY-TFT043RV2 4.3-inch resisitive screen
The LCD screen will display the corresponding color, the following is the terminal output information:
./framebuffer_test
The framebuffer device was opened successfully.
vinfo.xres=480
vinfo.yres=272
vinfo.bits_per_bits=16
vinfo.xoffset=0
vinfo.yoffset=0
red.offset=11
green.offset=5
blue.offset=0
transp.offset=0
finfo.line_length=960
finfo.type = PACKED_PIXELS
The framebuffer device was mapped to memory successfully.
color: red rgb_val: 0000F800
color: green rgb_val: 000007E0
color: blue rgb_val: 0000001F
color: r & g rgb_val: 0000FFE0
color: g & b rgb_val: 000007FF
color: r & b rgb_val: 0000F81F
color: white rgb_val: 0000FFFF
color: black rgb_val: 00000000
Configure for MY-TFT070RV2 module
The Linux source of MYD-Y6ULX series board has alread support display and touch function.The MY-TFT070RV2 touch function through ADC type.You just enable the
relative function in dts file.
The first step, edit "arch/arm/boot/dts/myb-y6ull-14x14.dts" file, modify the status property of tsc node to okay value.
&tsc {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_tsc>;
xnur-gpio = <&gpio1 3 GPIO_ACTIVE_LOW>;
measure-delay-time = <0xfffff>;
pre-charge-time = <0xffff>;
status = "okay";
};
The second step, comment the argument of 4.3 inch screen, and enable argument of 7.0 inch screen.Search and modify the display-timings node of lcfif node, change it
follow below.
display-timings {
native-mode = <&timing0>;
/*
timing0: timing0 {
clock-frequency = <9200000>
hsync-len = <41>;
vback-porch = <2>;
vfront-porch = <4>;
vsync-len = <10>;
hsync-active = <0>;
vsync-active = <0>;
de-active = <1>;
pixelclk-active = <0>;
};
*/
timing0: timing0 {
clock-frequency = <33000000>;
hactive = <800>;
vactive = <480>;
hfront-porch = <210>;
hback-porch = <46>;
hsync-len = <1>;
vback-porch = <22>;
vfront-porch = <23>;
vsync-len = <20>;
hsync-active = <0>;
vsync-active = <0>;
de-active = <1>;
pixelclk-active = <1>;
};
};
Configure for MY-TFT070CV2 module
The touch function of MY-TFT070CV2 module use I2C type.The slave device has already added to i2c2 controller node.You just disable tsc controller and enable argument
of 7 inch screen.
The first step, edit "arch/arm/boot/dts/myb-y6ull-14x14.dts" file, modify the status property of tsc node is disabled value.
&tsc {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_tsc>;
xnur-gpio = <&gpio1 3 GPIO_ACTIVE_LOW>;
measure-delay-time = <0xfffff>;
pre-charge-time = <0xffff>;
status = "disabled";
};
The second step, comment the argument of 4.3 inch screen.And enable the argument of 7.0 inch screen.Search and modify display-timings node of lcdif node, change it
follow below.
15

display-timings {
native-mode = <&timing0>;
/*
timing0: timing0 {
clock-frequency = <9200000>
hsync-len = <41>;
vback-porch = <2>;
vfront-porch = <4>;
vsync-len = <10>;
hsync-active = <0>;
vsync-active = <0>;
de-active = <1>;
pixelclk-active = <0>;
};
*/
timing0: timing0 {
clock-frequency = <33000000>;
hactive = <800>;
vactive = <480>;
hfront-porch = <210>;
hback-porch = <46>;
hsync-len = <1>;
vback-porch = <22>;
vfront-porch = <23>;
vsync-len = <20>;
hsync-active = <0>;
vsync-active = <0>;
de-active = <1>;
pixelclk-active = <1>;
};
};
16

4.2 Test TouchPanel
This example shows you how to test the touch panel on LCD screen module. The MYD-Y6ULX supports capacitive and resistive type.You need follow 4.1 to install the LCD
module.
You can use ts_calibrate and ts_test command to test your LCD and touch panel are working.The "TSLIB_TSDEVICE" point the touch device node, capacitive and resistive
has different device node.
# export TSLIB_TSDEVICE=/dev/input/event1
# ts_calibrate
# ts_test
17

4.3 Ethernet
This example uses the TCP/IP socket API to implement a simple C/S structure of the program. Copy the executable program arm_client to the development board,
pc_server copy to the PC, the development board and PC access network.
The MYD-Y6ULX has two ethernet interfaces, CN1 and CN2.
Configure IP of PC machine and run server program:
$ sudo ifconfig eth0 192.168.1.111
$ ./pc_server
REC FROM: 192.168.1.222
Configure IP of CN2 and run client program on board:
# ifconfig eth0 192.168.1.222
# ./arm_client 192.168.1.111
form server: Make Your idea Real!
18

4.4 Test GPIO-KEY
This example demonstrates how to read key state and key values in Linux user space. After running the gpio_key program, press or release the K3 key, the debug serial
port will output the relevant status information. Press "Ctrl-C" to end the program.
Run the program on board:
# ./gpio_key /dev/input/event2
Hit any key on board ......
key 2 Pressed
key 2 Released
key 2 Pressed
key 2 Released
19

4.5 Test GPIO-LED
This example demonstrates using the Linux system API to operate LED(D30) light on and off. After running the program, D30 flash alternately. Press "Ctrl-C" to end the
program.
# ./gpio_led /sys/class/leds/user/brightness
20
Other manuals for MYD-Y6ULX Linux
1
Table of contents
Other MYiR Motherboard manuals