MYiR MYD-AM335X User manual


1.1
1.2
1.3
1.3.1
1.3.2
1.4
1.4.1
1.4.2
1.4.3
1.4.4
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.6
1.6.1
1.6.2
1.6.3
Table of Contents
Introduction
1. Software Resources
2. Deploy development environment
2.1 Install tools
2.2 Setup GCC Toolchain
3. Bulid System
3.1 Bulid Bootloader
3.2 Build Linux Kernel
3.3 Build Filesystem
3.4 Build QT
4. Linux Applications Development
4.1 LCD
4.2 Touch Panel
4.3 RTC
4.4 RS485
4.5 CAN Bus
4.6 Ethernet
4.7 NAND Flash
4.8 KeyPad
4.9 GPIO-LED
4.10 Audio
4.11 USB Host
4.12 USB Device
5. Qt Applications Development
5.1 Install QtCreator
5.2 Config QtCreator
5.3 Build QT Application
2

MYD-AM335X-Linux-4.1.18
Development Guide
Introduction
This section provides an overview of the areas covered by the documentation,what is
contained, the appropriate readers, the documentation version history, and the
applicable hardware version.
This chapter describes how to run Linux system and embedded Linux applications
and the process of drive development in MYD-AM335X series development board. It
includes building the development environment, compiling the source code,
examples of Linux application and image download.
This document is suitable for embedded Linux development engineers with some
development experience.
Version History
Version
Number Description Time
V1.0 Initial Version 2017.4.1
V1.1
1. Add kernel and u-boot repository configuration for
Buildroot
2. Add MEasy HMI demo to rootfs for development
boards
2018.07.01
V1.2 1. Add support of core board with EMMC 2018.07.26
V1.3
1. Add chapters for MYIR peripheral module usage
2. Limit the speed of ETH1 on MYD-AM335X to
100BASE-T.
2018.08.28
V1.4
1. Add support of new EhterNet PHY chip YT8511 in
kernel.
2. Capacitive and resistive touch screen are
compatible in buildroot.
3. Please fetch sources from 2021.11.18
4

https://github.com/MYiR-Dev/myir-ti-
buildroot/releases/tag/MYD-
AM335X_V20R5_20211118
Hardware Version
MYD-AM335X, MYD-AM335X-Y,MYD-AM335X-J.
Note: This document applies to the above three versions of the hardware,
the user can choose the corresponding operation according to the
corresponding board.In this paper, the MYD-AM335X series is used to
represent the three board.
5

1. Software Resources
This section describes the software resources of the MYD-AM335X series
development boards.
Table 1-1 Software Resources.
Category Name Description Source MYD-
AM335X
MYD-
AM335X-
Y
Bootloader U-boot
Responsible for
system
initialization and
boot kernel.
YES √ √
Kernel Linux
4.1.18
Designed for
MYD-AM335X
hardware
YES √ √
Drivers LCD
Controller
LCD driver,for
4.3 inch、7 inch YES √ √
Drivers Touch
Panel
Resistive touch
screen driver YES √ √
Drivers Touch
Panel
Capacitance
touch screen
driver
YES √ √
Drivers RTC RTC clock driver YES √ √
Drivers UART Serial driver YES √ √
Drivers SDIO WiFi WiFi driver YES × √
Drivers RS485 RS485 driver YES √ √
Drivers CAN CAN driver YES √ √
Drivers Ethernet Ethernet driver YES √ √
Drivers MMC/SD MMC/SD driver YES √ √
Drivers NAND
Flash
NAND Flash
driver YES √ √
Drivers Audio Audio driver YES √ √
Drivers GPIO-LED GPIO-LED driver YES √ √
Drivers I2C I2C driver YES √ √
6

Drivers HDMI HDMI driver YES √ ×
Drivers PMU
Power
Management
Unit driver
YES √ √
Drivers USB Host USB Host driver YES √ √
Drivers USB
Device
USB Device
driver(Gadget)YES √ √
Filesystem Rootfs Base on buildroot Bin √ √
Filesystem Rootfs-qt Qt filesystem Bin √ √
Filesystem UBI Provide image
file YES √ √
Filesystem Ramdisk.gz ramdisk
filesystem YES √ √
Demo LCD LCD test
program YES √ √
Demo RTC RTC clock test
program YES √ √
Demo RS485 RS485 test
program YES √ √
Demo CAN CAN test
program YES √ √
Demo Ethernet Ethernet test
program YES √ √
Demo NAND
Flash
NAND Flash test
program YES √ √
Demo GPIO-LED GPIO-LED test
program YES √ √
Demo Audio Audio test
program YES √ √
Demo Qt
QT environment
verification
program
YES √ √
7

2. Deploy development environment
This section describes the tools and environment, tool chain settings, development
environment validation.
PC development environment: Ubuntu12.04/Ubuntu14.04/Ubuntu16.04 64bit
Desktop
Cross compiler: gcc5.3(Linaro GCC 2016.02)
Hardware debugging environment structures
MYD-AM335X Hardware debugging environment structures:
Connect the debug serial port J12 to the PC,set the baudrate of serial port on host
PC to 115,200-8-n-1. Specific as follows:
8

Figure 2-1 MYD-AM335X Hardware Debugging Interface
MYD-AM335X-Y Hardware debugging environment structures:
Connect the debug serial port J10 to the PC,set the baudrate of serial port on host
PC to 115,200-8-n-1. Specific as follows:
Figure 2-2 MYD-AM335X-Y Hardware Debugging Interface
MYD-AM335X-J Hardware debugging environment structures:
9

Connect the debug serial port J3 to the PC,set the baudrate of serial port on host PC
to 115,200-8-n-1. Specific as follows:
Figure 2-3 MYD-AM335X-J Hardware Debugging Interface
Create a working directory:
Create a work directory and copy the resources from 04-Linux_Source of our release
package to the work directory on ubuntu host PC, here is defined by customers
according to their development environment.
$ mkdir -p <WORKDIR>
$ cp /media/cdrom/04-Linux_Source/* <WORKDIR> -rf
$ ls <WORKDIR>
Bootloader/ Examples/ Filesystem/ Kernel/ Patches/ ToolChain/
10

2.1 Install tools
Install other development tools
For the sake of convenience we install all the tools and libraries before as shown
below:
Ubuntu 12.04 64Bit Desktop
sudo apt-get install build-essential git-core libncurses5-dev
$ sudo apt-get install flex bison texinfo zip unzip zlib1g-dev gettext
$ sudo apt-get install gperf libsdl-dev libesd0-dev libwxgtk2.6-dev
$ sudo apt-get install uboot-mkimage
$ sudo apt-get install g++ xz-utils
Ubuntu 14.04 64Bit Desktop
$ sudo apt-get install build-essential git-core libncurses5-dev u-boot-tools
$ sudo apt-get install flex bison texinfo zip unzip zlib1g-dev gettext
$ sudo apt-get insta 64Bit Desktopll gperf libsdl-dev libesd0-dev
$ sudo apt-get install g++ xz-utils
$ sudo apt-get install subversion
Ubuntu 16.04 64Bit Desktop
$ sudo apt-get install build-essential git-core libncurses5-dev u-boot-tools
$ sudo apt-get install flex bison texinfo zip unzip zlib1g-dev gettext
$ sudo apt-get install gperf libsdl-dev libesd0-dev
$ sudo apt-get install g++ xz-utils
$ sudo apt-get install subversion
On 64bit Ubuntu OS, some 32bit runtime libraries should be installed as shown
below:
$sudo apt-get install libc6-i386 lib32stdc++6 lib32z1
11

2.2 Setup GCC Toolchain
Set environment variables:
$ cd <WORKDIR>/Toolchain
$ tar xvf gcc-linaro-5.3-2016.02-x86_64_arm-linux-gnueabihf.tar.xz
$ export PATH=$PATH:<WORKDIR>/Toolchain/gcc-linaro-5.3-2016.02-x86_64_arm-linux-gnueab
ihf/bin
$ export ARCH=arm
$ export CROSS_COMPILE=arm-linux-gnueabihf-
After executing the "export" command,type "arm" then press TAB to check if it’s
correctly set. This setting is valid only for the this terminal, for a permanent
modification, please modify user profiles.
eg:Set user environment variables
vi ~/.profile
At the end to add:
export ARCH=arm
export CROSS_COMPILE=arm-linux-gnueabihf-
export PATH=$PATH:<WORKDIR>/Toolchain/
gcc-linaro-5.3-2016.02-x86_64_arm-linux-gnueabihf/bin
source ~/.profile or Reset Ubuntu
Test:
$echo $ARCH
arm
$echo $CROSS_COMPILE
arm-linux-gnueabihf-
Cross compiler verification:
arm-linux-gnueabihf-gcc -v
12

$ arm-linux-gnueabihf-gcc -v
Using built-in specs.
COLLECT_GCC=arm-linux-gnueabihf-gcc
……
Thread model: posix
gcc version 5.3.1 20160113 (Linaro GCC 5.3-2016.02)
13

3. Bulid System
There are many open source tools for building an embedded Linux system, they are
more convenient for embedded software engineers to build bootloader, kernel,
filesystem all in one step. Currently, OpenWRT, Buildroot , Yocto are more
commonly used.
Buildroot is a simple, efficient and easy-to-use tool to generate embedded Linux
systems through cross-compilation,thanks to its kernel-like menuconfig, gconfig and
xconfig configuration interfaces, building a basic system with Buildroot is easy, so it's
very popular among embedded software engineers.
The following sections will explain U-boot, kernel, filesystem respectively, in the part
of filesystem, we build a filesystem with QT5 included, customers can develop QT5
application based on this filesystem easily.
14

3.1 Bulid Bootloader
Enter the directory of bootloader, uncompress the source code package as shown
below:
$ cd <WORKDIR>/Bootloader
$ tar -jxvf myir-u-boot.tar.bz2
$ cd myir-u-boot
Compile U-Boot:
The configuration of U-boot for MYD-AM335X series is located at myir-u-
boot/configs/, the corresponding configuration file name are shown below:
Table 3-1-1 U-boot Config Files for MYIR Development Boards
Board Configuration File Name
MYD-AM335X(NAND) myd_c335x_defconfig
MYD-AM335X(EMMC) myd_c335x_emmc_defconfig
MYD-AM335X-J(NAND) myd_j335x_defconfig
MYD-AM335X-J(EMMC) myd_j335x_emmc_defconfig
MYD-AM335X-Y(NAND) myd_y335x_defconfig
MYD-AM335X-Y(EMMC) myd_y335x_emmc_defconfig
Compile U-boot for MYD-AM335X development board with NAND:
$ make distclean
$ make myd_c335x_defconfig
$ make
After compiling is completed, MLO and u-boot.img files will be generated in myir-u-
boot directory.
15

3.2 Build Linux Kernel
Enter the work directory and uncompress the Linux Kernel source code package:
$ cd <WORKDIR>/
$ tar -jxvf myir-kernel.tar.bz2
$ cd myir-kernel
Compile Kernel:
The configuration of Kernel for MYD-AM335X series is located at myir-
kernel/arch/arm/configs/,customers can compile Kernel as shown below:
Table 3-2-1 Kernel Config Files for MYIR Development Boards
Board Type Configuration File Name
MYD-AM335X myd_c335x_defconfig
MYD-AM335X-Y myd_y335x_defconfig
MYD-AM335X-J myd_j335x_defconfig
Compile Kernel for MYD-AM335X development board:
If users want to compile and install kernel modules, they should set INSTALL_MOD_PATH ,
it is useful for debug kernel modules with NFS.
$ export INSTALL_MOD_PATH=$HOME/export/rootfsa/
$ make distclean
$ make myd_c335x_defconfig
$ make zImage dtbs
$ make modules
$ make modules_install
The kernel modules have a version magic, it should match the version of zImage. So
if users change the version of kernel, they should recompile the zImage and kernel
modules together. If the version does not match, the kernel will complain as below:
[ 2750.480576] ti_am335x_adc: disagrees about version of symbol dev_warn
[ 2750.487670] ti_am335x_adc: Unknown symbol dev_warn (err -22)
[ 2750.493977] ti_am335x_adc: disagrees about version of symbol dev_err
16

[ 2750.502474] ti_am335x_adc: Unknown symbol dev_err (err -22)
The configuration for different boards are shown in the table above. After compiling,
the kernel image is generated at arch/arm/boot/zImage , the DTB files are generated at
arch/arm/boot/dts/myd_c335x.dtb, arch/arm/boot/dts/myd_c335x_emmc.dtb . The dtb file
arch/arm/boot/dts/myd_c335x.dtb is for core board with NAND, the dtb file
arch/arm/boot/dts/myd_c335x_emmc.dtb is for core board with EMMC.
Patch files for different hardware features:
The default configuration is 7-inch screen,256N256D,without SGX. Users can
generate a different screen and NAND DDR device tree file from the patch file in
<WORKDIR>/04-Linux_source/Patches ,and then compile the kernel using the device tree
file.The following is a list of related patches:
Table 3-2-2 Kernel Patches for MYIR Development Boards
Board Type MYD-AM335X MYD-
AM335X-Y
MYD-
AM335X-J
HDMI patches myd_c335x_hdmi_display.diff No
expansion
No
expansion
4.3 inch
screen patch myd-am335x-lcd4.3.diff
myd-
am335x-y-
lcd4.3.diff
myd-
am335x-j-
lcd4.3.diff
SGX patch myd-am335x-sgx.diff
myd-
am335x-y-
sgx.diff
myd-
am335x-j-
sgx.diff
For example: Patch for MYD-AM335X-Y with SGX , 4.3-inch screen:
$ patch -p1 < <WORKDIR>/Patches/myd-am335x-y-lcd4.3.diff
$ patch -p1 < <WORKDIR>/Patches/myd-am335x-y-sgx.diff
Compile device tree:
make dtbs
And use the arch/arm/boot/dts directory of the device tree file to replace the system
image device tree file.
17

3.3 Build Filesystem
This section covers the building of filesystem with Buildroot.
3.3.1 Preparation before Building Buildroot
Note1: After modifying source code of Kernel or U-boot, Buildroot can not
update and build it automatically. Customers should commit it to the master
branch of their local git repo manually.
Note2: If the source code of Kernel is updated, before building Buildroot again,
customers should remove the package "myir-buildroot/dl/linux-master.tar.gz"
and the "myir-buildroot/output/build/linux-master" and
"myirbuildroot\output\build\linux-headers-master" directories manually. The
same to rebuilding of U-boot.
Note3:Before building u-boot and kernel with buildroot, users need to create
their own git repository for u-boot and kernel, then replace the git path in the
configuration files.
Copy the Buildroot source package customized by MYIR Tech from 04-
Linux_Source/Filesystem/myir-buildroot.tar.gz of our release package to work
directory and uncompress it. The content of myir-buildroot.tar.gz is shown below:
$ ls -al <WORKDIR>/Filesystem/myir-buildroot
arch CHANGES configs dl linux output support
board Config.in COPYING docs Makefile package system
boot Config.in.legacy DEVELOPERS fs Makefile.legacy README toolchain
For more details about the file structure of Buildroot , please refer to Buildroot
manual https://buildroot.org/downloads/manual/manual.html.The board support files
for MYD AM335X series development boards are located at <WORKDIR>/Filesystem/myir-
buildroot/board/myir/myd_c335x , <WORKDIR>/Filesystem/myir-
buildroot/board/myir/myd_y335x , <WORKDIR>/Filesystem/myir-buildroot/board/myir/myd_j335x
3.3.2 Buildroot Configuration
18

The configuration files for Buildroot are all located at <WORKDIR>/Filesystem/myir-
buildroot/configs/ .
Table 3-3-1 Buildroot Config Files for MYIR Development Boards
Config File Description
myd_c335x_defconfig Buildroot configuration without QT5 for MYC-
AM335X CPU Module with NAND Flash
myd_c335x_emmc_defconfig Buildroot configuration without QT5 for MYC-
AM335X CPU Module With EMMC
myd_c335x_qt5_defconfig Buildroot configuration with QT5 for MYD-
AM335X development board with NAND
myd_j335x_defconfig Buildroot configuration without QT5 for MYC-
AM335X-J CPU Module with NAND Flash
myd_j335x_emmc_defconfig Buildroot configuration without QT5 for MYC-
AM335X-J CPU Module with EMMC
myd_j335x_qt5_defconfig
Buildroot configuration with QT5 for MYD-
AM335X-J development board with NAND
Flash
myd_y335x_defconfig Buildroot configuration without QT5 for MYC-
AM335X-Y CPU Module with NAND Flash
myd_y335x_defconfig Buildroot configuration without QT5 for MYC-
AM335X-Y CPU Module with EMMC
myd_y335x_qt5_defconfig
Buildroot configuration with QT5 for MYD-
AM335X-Y development board with NAND
Flash
$ cd myir-buildroot
$ make clean
$ make myd_y335x_defconfig
Customers can change the configuration by its kernel-like menuconfig with the
command make menuconfig . The main configuration for MYD-AM335X-Y development
board are listed below.
Configuration for Cross Compiler:
19

Buildroot can use internal cross compile toolchain generated by Buildroot itself, it can
also use external cross compile toolchain. In this document, we choose the internal
cross compile toochain, it will be generated and stored to <WORKDIR>/Filesystem/myir-
buildroot/output/host/usr/bin/ after compiling.
Figure 3-3-1 Configuration for Cross Compiler
Configuration for System:
The configuration for system includes the name of the target system, the welcome
message, the init subsystem(busybox/systemV/systemd) and device manage
system, customers can also set the password for root user by configuration. For
MYD-AM335X-Y development board, the password for root is set to myirtech as
shown below. If customers do not need to set password, they no need to config the
password.
20
This manual suits for next models
2
Table of contents
Other MYiR Motherboard manuals
Popular Motherboard manuals by other brands

Gigabyte
Gigabyte GA-MA785G-UD3H user manual

VIA Technologies
VIA Technologies VAB-820 quick start guide

Luminary Micro
Luminary Micro Stellaris Series user manual

Selcon
Selcon PRG-E Series Technical sheet

Silicon Laboratories
Silicon Laboratories Si5344-EVB user guide

Portwell
Portwell WADE-8210-H110 user guide