MYD Y6ULX LinuxDevelopmentGuide - en PDF
MYD Y6ULX LinuxDevelopmentGuide - en PDF
Preface 1.1
1 Software Resource 1.2
2 Deploy Development Environment 1.3
3 Build Linux System 1.4
3.1 U-Boot 1.4.1
3.2 Linux Kernel 1.4.2
3.3 Build Filesystem 1.4.3
3.3.1 Yocto build Linux system 1.4.3.1
3.3.2 Yocto build SDK package 1.4.3.2
4 Linux Application Development 1.5
4.1 Test LCD 1.5.1
4.2 Test TouchPanel 1.5.2
4.3 Test Ethernet 1.5.3
4.4 Test GPIO-KEY 1.5.4
4.5 Test GPIO-LED 1.5.5
4.6 Test USB Host 1.5.6
4.7 Test USB Device 1.5.7
4.8 Test RS485 1.5.8
4.9 Test RS232 1.5.9
4.10 Test CAN bus 1.5.10
4.11 Test Audio 1.5.11
4.12 Test Camera 1.5.12
4.13 Test WiFi 1.5.13
4.14 Test 4G LTE 1.5.14
5 QT Application Development 1.6
5.1 Install QtCreator 1.6.1
5.2 Config QtCreator 1.6.2
5.3 Test Qt exapmle 1.6.3
6 Update System 1.7
6.1 USB Update Method 1.7.1
6.2 SD Card Method 1.7.2
AppendixA 1.8
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
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.
Driver Touch Panel Supports Capacity and Resistive touch panel YES
Driver WiFi module USI module(BCM43362 chip) use SDIO 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 NET Uses TCP/IP Sokect API, support Client and Server demo YES
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.
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
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.
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
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:
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.
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
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.
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
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.
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.
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.
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
bitbake fsl-image-qt5
bitbake core-image-base
core-image-base base file system has more command line feature full commnand line system, no GUI
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
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.
bitbake meta-toolchain
$ 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.
$ 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.
$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.
$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
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
&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>;
};
};
&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:
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
4.6 Test USB Host
Connect the USB flash disk to USB HOST(J6) interface, will output detection device information. At the same time, use this storage device to mount the Linux system under
its read and write.
21
4.7 Test USB Device
This example shows how to use USB device mode through the Micro USB interface(J26) on board.It will attach a specified file or device as a Gadget device. It works as a
storage device connected to the HOST device.
Operation steps on board:
#mkfs.vfat /dev/ram1
#modprobe g_mass_storage file=/dev/ram1 removable=1 \
iSerialNumber="1234"
#dmesg | tail -n 20
[2872436.778616] usb 1-1: USB disconnect, device number 102
[2872436.779156] sd 3:0:0:0: [sdb] Synchronizing SCSI cache
[2872436.779201] sd 3:0:0:0: [sdb] Synchronize Cache(10) failed:
Result: hostbyte=DID_NO_CONNECT driverbyte=DRIVER_OK
[2872442.508567] usb 1-1: new high-speed USB device number 103
using xhci_hcd
[2872442.650549] usb 1-1: New USB device found, idVendor=0525,
idProduct=a4a5
[2872442.650551] usb 1-1: New USB device strings: Mfr=3,
Product=4, SerialNumber=5
[2872442.650552] usb 1-1: Product: Mass Storage Gadget
[2872442.650553] usb 1-1: Manufacturer: Linux 4.1.15-1.2.0+g8d98
da6 with 2184000.usb
[2872442.650554] usb 1-1: SerialNumber: 1234
[2872442.657827] usb-storage 1-1:1.0: USB Mass Storage device
detected
[2872442.657895] usb-storage 1-1:1.0: Quirks match for vid 0525
pid a4a5: 10000
[2872442.657923] scsi host3: usb-storage 1-1:1.0
[2872443.669426] scsi 3:0:0:0: Direct-Access Linux File-
Stor Gadget 0401 PQ: 0 ANSI: 2
[2872443.669886] sd 3:0:0:0: Attached scsi generic sg1 type 0
[2872443.670820] sd 3:0:0:0: [sdb] 131072 512-byte logical
blocks: (67.1 MB/64.0 MiB)
[2872443.779976] sd 3:0:0:0: [sdb] Write Protect is off
[2872443.779979] sd 3:0:0:0: [sdb] Mode Sense: 0f 00 00 00
[2872443.890093] sd 3:0:0:0: [sdb] Write cache: enabled,
read cache: enabled, doesn't support DPO or FUA
[2872444.110372] sdb:
[2872444.330074] sd 3:0:0:0: [sdb] Attached SCSI removable disk
22
4.8 Test RS485
This example demonstrates how to use the Linux serial API to configure the RS485 on the development board to send and receive data. For details, refer to the source
code.
Hardware
MYD-Y6ULX board have a RS485 interface(J10.3 for RS485-A, J10.4 for RS485-B).You need connect the A,B signal wire to another RS485 device or USB to RS485
converter.
Software
Copy and run the program on MYD-Y6ULX Linux system.Below is MYD-Y6ULX as the sender:
23
4.9 Test RS232
This example demonstrates how to use the Linux serial API to configure the RS232 on the development board to send and receive data. For details, refer to the source
code.
Hardware
MYD-Y6ULX board have a RS232 interface(J10.9 for RS232-TX, J10.10 for RS232-RX).You need connect the TXD,RXD signal wire to another RS232 device or USB to
RS232 converter.
Software
Copy and run the program on MYD-Y6ULX Linux system.Below is MYD-Y6ULX as the sender:
24
4.10 Test CAN Bus
This example demonstrates the use of the Linux API, which uses the CAN bus interface on the development board to send and receive data. Copy can_send and
can_receive to the development board.
Hareware
MYD-Y6ULX board has a CAN bus interface(J10.6 for CAN-L, J10.7 for CAN-H).You need connect the H, L data signal to another CAN device or USB to CAN converter.
Software
Configure the CAN0 bitrate is 50kbps and enable it.
Linux has two commands to configure CAN device, canconfig and ip. The MYD-Y6ULX use ip as default. canconfig command usage:
ip command usage:
Next, we use cansend/candump command and can_send/can_receive program to test CAN device.The cansend/candump is buildin system rootfs.The
can_send/can_receive is our example program.
MYD-Y6ULX as sender
Use cansend send data to CAN bus:
can_send program will sending loop, unitl you use "ctrl + c" to stop it.
# ./can_send -d can0 -i 100 0x11 0x22 0x33 0x44 0x55 0x66 0x77 0x88
# candump can0
# can0 100 [8] 01 02 03 04 05 06 07 08
# ./can_receive -d can0
can0 0x100 [8] 0x11 0x22 0x33 0x44 0x55 0x66 0x77 0x88
can0 0x100 [8] 0x11 0x22 0x33 0x44 0x55 0x66 0x77 0x88
can0 0x100 [8] 0x11 0x22 0x33 0x44 0x55 0x66 0x77 0x88
can0 0x100 [8] 0x11 0x22 0x33 0x44 0x55 0x66 0x77 0x88
25
4.11 Test Audio
This example demonstrates the development onboard audio interface using the arecord/aplay program in Linux systems.
Hareware
Connect LINE IN(J5) interface on the MYB-6ULX board, PC Audio-Out via a 3.5mm AUX cable
HEADPHONE(J4) connect your headerphone or speaker
Software
The PC plays the audio file and execute arecord command on board.It will recored data and save to test.wav file.You can use "ctrl + c" stop it after one minute.
# arecord -f cd test.wav
# aplay test.wav
26
4.12 Test Camera
MYD-Y6ULX board has an 8-bit parallel camera interface(J9).It can connects camera module of MY-CAM011B model.The module and board connects with FPC wire.
Attention: Please do not insert other camera model, this operation maybe damage the board or camera module.
This example program use an open source software uvc_stream.It supports show video in web from camera capture.
Hardware
Use FPC wire connects MYB-CAM011B module and camera interface J9 of MYD-Y6ULX.
Software
The uvc_stream uses network show video data.You need setup ethernet IP address of MYD-Y6ULX, the correspond device is eth1. Uses "v4l2-ctl" command to query the
device node of MY-CAM011B on Linux system.It outputs information about video device.The "i.MX6S_CSI" string is camera controller and correspond string "/dev/video1"
is device node of MY-CAM011B module. The uvc_stream parameter '-y' means use yuyv type, the '-P' means setting password of web page. The '-r' means define
resolution, the camera only support 800x600.The uvc_stream default username is uvc_user.
i.MX6S_CSI (platform:21c4000.csi):
/dev/video1
pxp (pxp_v4l2):
/dev/video0
The uvc_stream program supports two kinds web functions, snapshot and streaming. The snapshot function request URL is snapshot.jpeg, and streaming function request
URL is stream.mjpeg.
Let PC and board has same network, open your browser, visit http://192.168.1.42:8080/stream.mjpeg.After enter, you can see the login window, login with uvc_user,
123456.Now, you can see video stream from web on MY-CAM011B captured.
27
4.13 Test WiFi
Attention: The WiFi of carrier board only for NAND version of board.
The MYD-Y6ULX board has a WiFi module (J11).It's supports Client mode.
Hardware Connective
Use SMA interface of wireless antenna connect with J11 position of board.
Client Mode
The Client mode means WiFi module as client device connect to your route or other AccessPoint device.
Our Linux prebuilt system has added driver of WiFi module.It will be auto loaded when system startup. And also use lsmod to confirm it.The wlan0 network device has exist
when driver loaded success.The ifconfig command can be used confirm it.
# ifconfig wlan0
wlan0 Link encap:Ethernet HWaddr a0:2c:36:60:ee:e0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:3388 errors:0 dropped:10 overruns:0 frame:0
TX packets:37 errors:0 dropped:3 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:395459 (386.1 KiB) TX bytes:6074 (5.9 KiB)
Uses wpa_passphrase to generate password and ssid through you inputed arguments. And use wpa_supplicant command to connect WiFi module with AccessPoint.
# cat wifi.conf
network={
ssid="MYiRTech"
#psk="12345678"
psk=b96d9a5de2d9480ad5f987857e20216b47a0c4bf43397825ba909438bc52aaff
}
After the WiFi module connected with AccessPoint, it needs udhcpc service to fetch an AIP address from AccessPoint.
# udhcpc -b -i wlan0 -R
# ifconfig wlan0
wlan0 Link encap:Ethernet HWaddr a0:2c:36:60:ee:e0
inet addr:192.168.1.211 Bcast:192.168.1.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:5577 errors:0 dropped:15 overruns:0 frame:0
TX packets:46 errors:0 dropped:3 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:651690 (636.4 KiB) TX bytes:7472 (7.2 KiB)
28
4.14 Test 4G LTE
The MYD-Y6ULX board support LTE module through PCI-E slot with USB data line.Currently, the MYD-Y6ULX boards only support EC20 model from Quectl.
Attention: The module not default accessory part.You need buy it from MYiR.
Hardware
Install Quectl EC20 module into PCI-E slot(U12).
Use I-PEX interface wire connect LTE module and J25 position of board.
Install SMA wireless antenna to J24 position.
Software
Our Linux prebuilt system has added driver of 4G module.It will be auto loaded when system startup. And also use ls to confirm it.
# ls /dev/ttyUSB*
/dev/ttyUSB0 /dev/ttyUSB1 /dev/ttyUSB2 /dev/ttyUSB3 /dev/ttyUSB4
The Linux system of MYD-Y6ULX series board has provider ppp package.You can just enable ppp0 device, it will auto dial-up.
# ifup ppp0
# ifconfig ppp0
ppp0 Link encap:Point-to-Point Protocol
inet addr:10.163.130.65 P-t-P:10.64.64.64 Mask:255.255.255.255
UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1500 Metric:1
RX packets:5 errors:0 dropped:0 overruns:0 frame:0
TX packets:5 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:3
RX bytes:62 (62.0 B) TX bytes:86 (86.0 B)
# cat /etc/resolv.conf
nameserver 202.96.128.86
nameserver 202.96.134.133
Using the ping command to test whether the module is connected to the 4G network.
# ping myirtech.com
PING myirtech.com (50.6.151.71) 56(84) bytes of data.
64 bytes from 118.123.18.103: icmp_seq=1 ttl=117 time=80.5 ms
64 bytes from 118.123.18.103: icmp_seq=2 ttl=117 time=179 ms
64 bytes from 118.123.18.103: icmp_seq=3 ttl=117 time=378 ms
64 bytes from 118.123.18.103: icmp_seq=4 ttl=117 time=118 ms
64 bytes from 118.123.18.103: icmp_seq=5 ttl=117 time=122 ms
64 bytes from 118.123.18.103: icmp_seq=6 ttl=117 time=177 ms
If you happen any issue on above steps, please check the log to find the reason.
# cat /var/log/quectel-dial.log
29
5 QT application development
Qt is the faster, smarter way to create innovative devices, modern UIs & applications for multiple screens. Cross-platform software development at its best. The MYD-
Y6ULX uses Qt 5.6.2 version. In Qt application development, it is recommended to use QtCreator IDE.It can be developed Qt application more easier, automated cross-
compiler for the development board of the ARM architecture.
This chapter uses Yocto SDK as cross compile tool to work with QtCreator to quickly develop graphical applications. Before starting this chapter, please complete the
Chapter3 to build Qt, get an available ARM version of the Qt graphics library.
Please install the Yocto application-level SDK before you start it.
30
5.1 Install QtCreator
QtCreator installation package is a binary program, can be directly installed to your host PC.
$ cd $DEV_ROOT/04-Sources
$ cp /media/cdrom/03-Tools/Qt/qt-creator-opensource-linux-\
x86_64-4.1.0.run .
$ chmod a+x qt-creator-opensource-linux-x86_64-4.1.0.run
$ sudo ./qt-creator-opensource-linux-x86_64-4.1.0.run
When the installation process is done, click on the next step to complete. The default installation directory is in the "/opt/qtcreator-4.1.0".
In order to QtCreator use Yocto SDK, we need add environment to QtCreator, modify the file "/opt/qtcreator-4.1.0/bin/qtcreator.sh". Add below command before the line
"#! /bin/sh":
$ vi /opt/qtcreator-4.1.0/bin/qtcreator.sh
source /opt/myir-imx6ulx-fb/4.1.15-2.0.1/environment-setup-cortexa7hf-neon-poky-linux-gnueabi
#! /bin/sh
When you use QtCreator, you need start it from terminal to execute "qtcreator.sh".
/opt/qtcreator-4.1.0/bin/qtcreator.sh &
31
5.2 Configure QtCreator
The first step, run QtCreator, followed by "Tool" -> "Options", the Options dialog box appears, click "Build & Run" on the left, right select "Compilers" label. Click on the
right "Add" button, pop-up drop-down list, select "GCC", fill the following input boxes, "Name" is "MYDY6ULx-GCC", click "Compiler path" beside "Browse.." button to
choose "arm-poky-linux-gnueabi-g++" file path. In this case, the path is "/opt/myir-imx6ulx-fb/4.1.15-2.0.1/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-
gnueabi/arm-poky-linux-gnueabi-g++".When fill are complete, click "Apply".
The fourth step, click "Build & Run" menu on left panel will back to "Kit" tab in right panel.The content fill with "Name" is "MYDY6ULx-dev-kit", "Device" choose
"MYDY6ULx Board" option."Sysroot" choose the sysroot of target board.In this case , use "/opt/myir-imx6ulx-fb/4.1.15-2.0.1/sysroots/cortexa7hf-neon-poky-linux-
gnueabi"."Compiler" choose "MYDY6ULx-GCC" before we configured."Qt version" choose "Qt 5.6.2 (MYDY6ulx-qt5)" before configured, "Qt mkspec" is "linux-oe-
g++".Other use default option, then click"Apply" and "OK" button.
32
5.3 Test Qt application
In order to test previous configure is correct, we support a Qt example.You just open, config and compile it.
The first step, in the menu bar, select "File" -> "Open File or Project", in the open dialog box, browse and select "hellowrold" example project, choose "helloworld.pro" file,
click "Open" button.
The second step,choose "MYDY6ULx-dev-kit" option.Then the "helloworld" project will use "MYDY6ULx-dev-kit" option to build it.
$ file ~/build-helloworld-MYDY6ULx_dev_kit-Debug/helloworld
/home/kevinchen/build-helloworld-MYDY6ULx_dev_kit-Debug/
helloworld: ELF 32-bit LSB executable, ARM, EABI5 version 1
(GNU/Linux), dynamically linked, interpreter /lib/ld-linux-
armhf.so.3, for GNU/Linux 2.6.32, BuildID[sha1]=
9c5f22deb1d8272c2a81528c171d215896112784, not stripped
33
6 System update
MYD-Y6ULX series board provides two methods to update system to NAND flash of board, USB and SD card.
USB method: Using NXP MfgTool tool to burn files into flash on download mode of chip.
SD Card method: Using updatable SD image to write files into flash.
34
6.1 USB Update Method
Install tool
The NXP provide a manufacture tool called MfgTool, we use MfgTool 2.7.0 version.The MfgTool suppors Windows and Linux system.It is located in directory "03-
Tools/ManufactoryTool" of resource package.You can copy and extract it to your work directory.
The MYD-Y6ULX series board support NAND and eMMC flash.The MfgTool also support it on each vbs file.
FileName Description
Bit1 OFF
Bit2 ON
Bit3 ON
Bit4 OFF
Bit1 OFF
Bit2 OFF
Bit3 ON
Bit4 OFF
Reconnect the power adapter, the board will boot into linux on NAND or eMMC flash。
35
6.2 SD Card Update
The sdcard image file needs special tool to write Micro SD storage card.The linux user can directly use dd command.The windows user need "Win32ImageWriter" tool.
MYD-Y6ULX series boards provide two sdcard file.It's path in directory 02-Images.
Attention: The date string tag is generated by the tool on file name *.rootfs.sdcard.Please be based on actual.
The "mfgimages-*" directory store need update files.Those name of files are defined in 'Manifest' file, please follow below rules:
ubootfile="u-boot.imx"
kernelfile="zImage"
dtbfile="myd-y6ull-14x14-gpmi-weim.dtb"
rootfsfile="core-image-base.rootfs.tar.xz"
The 'envfile' variable only used for eMMC flash type. The update program will read the Manifest file and load those files be written into flash.
The tool support four arguments. '-p' stands for a platform, the value is 'myd-y6ull'. '-n' stands for the storage device of NAND flash. '-e' stands for the storage device of
eMMC flash. '-d' stands for target files directory.
Attention: the '-n' and '-e' do not both exist in the argument.
Generally, linux use "sd[x][n]" format to naming a storage device.The x means which storage device, represent use a ~ z character.The n means partition that storage
device, use digit start from 1. You can use "dmesg | tail" command to view device name when you plugin Card Reader.In this case, we use "/dev/sdb" as example.
Attention: the "/dev/sdb" do not append any digit
The write speed is relative with USB host version and Micro SD card write speed. We recommend use higher speed class Micro SD storage card.
Windows system
The Windows user can use Win32DiskImager tool to write sdcard image file to Micro SD storage card.The tool is located in "03-Tools" directory.Extract it and double click
"Win32DiskImager.exe" program.After Win32DiskImager window shows up, the right "Device" list is to choose which device needs to operation.The left "Image File" input
box is to show which file needs to be operation through the folder icon to browse and choose file.(Attention: the file choose dialog default use ".img" to filter files, you need
change it to ".*" type)
You need confirm the device and file before write operation.The wrong device will damage your system partition or other storage device.
In this case, "D:" is the Card Reader device.
Attention: You need extract the sdcard.gz file when you use Win32DiskImage write into USB storage.The USB Image Tool support the sdcard.gz file.
You can plug out Card Reader after progress bard finish.
Take the Micro SD card insert into card slot(J5) on MYD-Y6ULX series boards.Then change boot switch as SDCARD type:
36
Boot bit Status
Bit1 ON
Bit2 OFF
Bit3 ON
Bit4 OFF
Use USB to TTL cable connect to Debug port(JP1), configure your serial terminal software.Use USB Micro B cable as power plug into USB OTG port(J7) on board(or use DC
adapter plug into J1 interface).You can view update progress in serial terminal software.
Also, you can view the LED(D12) to get the current update state.In updating is flashing.The update success is light on, the update fail is light off.
Bit1 OFF
Bit2 ON
Bit3 ON
Bit4 OFF
Reconnect the power adapter, the board will boot into linux from NAND flash。
Bit1 OFF
Bit2 OFF
Bit3 ON
Bit4 OFF
Reconnect the power adapter, the board will boot into linux from eMMC flash。
37
Appendix A Warranty & Technical Support Services
MYIR Tech Limited 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.
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 ([email protected]), 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 one year free technical support and after-sales maintenance service from the purchase date. The service covers:
Warm tips:
1. 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.
2. Please do not use finger nails or hard sharp object to touch the surface of the LCD.
3. 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.
4. Do not clean the surface of the screen with chemicals.
5. Please read through the product user manual before you using MYIR’s products.
6. 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 RMA number for return maintenance service after confirmation.
38
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.
Value-added Services
1. MYIR provides services of driver development base on MYIR’s products, like serial port, USB, Ethernet, LCD, etc.
2. MYIR provides the services of OS porting, BSP drivers’ development, API software development, etc.
3. MYIR provides other products supporting services like power adapter, LCD panel, etc.
4. ODM/OEM services.
MYIR Tech Limited
Fax: +86-755-25532724
Website: www.myirtech.com
39