CoreWind Tiny210, Mini210 Development Manual

Page 1
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210 System
System
System
System
System
System
System
System Development
Development
Development
Development manual
V1.0
CoreWind
CoreWind
CoreWind
CoreWind Technology
Technology
Technology
Technology Co.,Limited
Co.,Limited
Co.,Limited
Co.,Limited
Page 2
V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210 System
System
System
System System
System
System
System Development
Development
Development
Development manual
manual
manual
manual
www.armdevs.com
www.armdevs.com
www.armdevs.com
www.armdevs.com
2
© 2011 CoreWind Technology Co.,Limited
All Rights Reserved. No part of this document may be photocopied, reproduced, stored in a retrieval
system, or transmitted, in any form or by any means whether, electronic, mechanical, or otherwise
without the prior written permission of CoreWind.
No warranty of accuracy is given concerning the contents of the information contained in this
publication.
To
the extent permitted by law no liability (including liability to any person by reason of
negligence) will be accepted by Corewind, its subsidiaries or employees for any direct or indirect loss or
damage caused by omissions from or inaccuracies in this document.
CoreWind reserves the right to change details in this publication without notice.
Product and company names herein may be the trademarks of their respective owners.
CoreWind
CoreWind
CoreWind
CoreWind Technology
Technology
Technology
Technology Co.,Limited
Co.,Limited
Co.,Limited
Co.,Limited
Minzhi, Bao'an District,
Shenzhen City, China.
Tel: +86-755-29638421
Mail: market@armdevs.com
Website: http://www.armdevs.com
Page 3
V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210 System
System
System
System System
System
System
System Development
Development
Development
Development manual
manual
manual
manual
www.armdevs.com
www.armdevs.com
www.armdevs.com
www.armdevs.com
3
Table
Table
Table
Table of
of
of
of Content
Content
Content
Content
1 INTRODUCTION ................................................................................................................................................... 6
1.1 About This Document ................................................................................................................................ 6
1.2 Related Document ...................................................................................................................................... 6
2 System support ......................................................................................................................................................... 7
3 Android system development ................................................................................................................................... 8
3.1 Build environment ......................................................................................................................................... 8
3.2 Source code Prepared .................................................................................................................................... 8
3.3 Configure and Compile Linux Kernel ........................................................................................................... 9
3.4 Create Android .............................................................................................................................................. 9
3.5 Create or Run File System .......................................................................................................................... 10
4 Android Application Programming Guide ............................................................................................................. 11
4.1 Install the Application Programming environment ..................................................................................... 11
4.1.1 Step 1: download and install JDK(Java SE Development Kit) ........................................................ 11
4.1.2 Step 2: download and install Android SDK ..................................................................................... 12
4.1.3 Step 3: download and install Android2.3 Package ........................................................................... 13
4.1.4 Step 4: install Eclipse development environment ............................................................................ 13
4.1.5 Step 5: install Android Development Tools ...................................................................................... 14
4.1.6 Step 6: Configure the Eclipse ........................................................................................................... 15
4.1.7 Create Android
AVD
........................................................................................................................ 15
4.1.8 Step 8: Develop the first Android application program .................................................................... 16
4.1.9 Creat Hello Tiny210 project .............................................................................................................. 16
4.1.10 Run HelloTiny210 Application Program in
AVD
........................................................................... 18
4.1.11 Step 8: Create the Debugging environment for Tiny210 ................................................................ 18
4.2 Program access to hardware in Andorid ...................................................................................................... 23
4.2.1 How to use the library (libfriendlyarm-hardware.so) ................................................................... 24
4.2.2 library(libfriendlyarm-hardware.so) API introduce .......................................................................... 25
4.2.3 API Demo introduce ......................................................................................................................... 29
Chapter 5 Linux ........................................................................................................................................................ 31
5.1 Set up Fedora 9.0 Development Environment ............................................................................................ 31
5.1.1 Install Fedora 9.0 .............................................................................................................................. 31
5.1.2 Add User Account ............................................................................................................................ 45
5.1.3Access Windows Files ....................................................................................................................... 48
5.1.4 Configure NFS Service .................................................................................................................... 54
5.1.5 Set Up Cross Compile Environment ................................................................................................ 58
5.2 Uncompress Source Code and Install Application Utilities ........................................................................ 59
5.2.1 Uncompress Source Code ................................................................................................................ 59
5.2.2 Create Target File System ................................................................................................................ 61
5.2.3 Install Target File System ................................................................................................................. 62
5.2.4 Install LogoMaker ............................................................................................................................ 62
5.3 Configure and Compile Kernel ................................................................................................................... 63
5.3.1 Configure and Compile Kernel ........................................................................................................ 63
5.3.2 Location of the Driver ...................................................................................................................... 63
Page 4
V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210 System
System
System
System System
System
System
System Development
Development
Development
Development manual
manual
manual
manual
www.armdevs.com
www.armdevs.com
www.armdevs.com
www.armdevs.com
4
5.4 Configure and Compile Busybox ................................................................................................................ 65
5.5 Make Y AFFS2 Image ............................................................................................................................... 66
5.6 Sample Linux Programs .............................................................................................................................. 66
5.6.1 "Hello, World" .................................................................................................................................. 67
5.6.2 LED Test Program ............................................................................................................................ 70
5.6.3 User Button Test Program ................................................................................................................ 71
5.6.4 PWM Buzzer Program ..................................................................................................................... 72
5.6.5 I2C-EEPROM Program .................................................................................................................... 76
5.6.6 Pipe Programming Manipulating LED from HTML ................................................................. 78
5.7 Compile Qtopia-2.2.0 .................................................................................................................................. 82
5.7.1 Uncompress and Install Source Code ............................................................................................... 83
5.7.2Compile and Run Qtopia-2.2.0 for x86 ............................................................................................. 83
5.7.3 Compile and Run Qtopia-2.2.0 for ARM ......................................................................................... 84
5.8 Compile QtE-4.7.0 ...................................................................................................................................... 86
5.8.1 Uncompress and Install Source Code ............................................................................................... 86
5.8.2 Compile and Run QtE-4.7.0 for ARM ............................................................................................. 86
5.9 Compile Qtopia4(Qt-Extended-4.4.3) ......................................................................................................... 87
5.9.1 Uncompress and Install Source Code ............................................................................................... 87
5.9.2 Compile and Run Qt-Extened-4.4.3 for x86 .................................................................................... 87
5.9.3 Compile and Run Qt-Extened-4.4.3 for ARM ................................................................................. 88
Chapter 6 WinCE ...................................................................................................................................................... 90
6.1 set up WinCE 6 Development Environment ............................................................................................... 90
6.1.1 Install Visual Studio 2005 and Patches ............................................................................................ 92
6.1.2 Install Windows CE 6.0 and Patches .............................................................................................. 100
6.2 Configure and Compile WinCE 6.0 Kernel and Bootloader ..................................................................... 120
6.2.1 Compile Default Kernel ................................................................................................................. 121
6.2.2 Modify serial port output in BSP ................................................................................................... 127
6.2.3 Create SDK .................................................................................................................................... 128
6.2.4 Install SDK ..................................................................................................................................... 129
Page 5
V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210 System
System
System
System System
System
System
System Development
Development
Development
Development manual
manual
manual
manual
www.armdevs.com
www.armdevs.com
www.armdevs.com
www.armdevs.com
5
Document
Document
Document
Document version
version
version
version
Table
Table
Table
Table 0-1
0-1
0-1
0-1 Document
Document
Document
Document Revision
Revision
Revision
Revision Notes
Notes
Notes
Notes
Date
Date
Date
Date Description
Description
Description
Description
2012.10 Linux android and Wince development manual
2011.12 Second version
Please check for a newer revision of this manual at CoreWind's web site :
http://armdevs.com/info194.html
Compare the revision notes of the updated manual from the web site to those of the printed or electronic
version you have.
Page 6
V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210 System
System
System
System System
System
System
System Development
Development
Development
Development manual
manual
manual
manual
www.armdevs.com
www.armdevs.com
www.armdevs.com
www.armdevs.com
6
1
1
1
1 INTRODUCTION
INTRODUCTION
INTRODUCTION
INTRODUCTION
1.1
1.1
1.1
1.1 About
About
About
About This
This
This
This Document
Document
Document
Document
This document is part of a set of reference documents providing information necessary to operate and
use CoreWind's Tiny210/Mini210 board.
1.2
1.2
1.2
1.2 Related
Related
Related
Related Document
Document
Document
Document
For additional information not covered in this manual, please refer to the documents listed in Table 1.1.
Table
Table
Table
Table 1-1
1-1
1-1
1-1 Related
Related
Related
Related Document
Document
Document
Document
Document
Document
Document
Document Location
Location
Location
Location
Tiny210 Test Method http://armdevs.com/info194.html
Page 7
V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210 System
System
System
System System
System
System
System Development
Development
Development
Development manual
manual
manual
manual
www.armdevs.com
www.armdevs.com
www.armdevs.com
www.armdevs.com
7
2
2
2
2 System
System
System
System support
support
support
support
The TIny210/Mini210 support the follow system:
1. Android 4.0
2. Android 2.3
3. Linux
4. WinCE 6.0
Page 8
V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210 System
System
System
System System
System
System
System Development
Development
Development
Development manual
manual
manual
manual
www.armdevs.com
www.armdevs.com
www.armdevs.com
www.armdevs.com
8
3
3
3
3 Android
Android
Android
Android system
system
system
system development
development
development
development
3.1
3.1
3.1
3.1 Build
Build
Build
Build environment
environment
environment
environment
1. copy the cross tools arm-linux-gcc-4.5.1-v6-vfp-20101103.tgz
arm-linux-gcc-4.5.1-v6-vfp-20101103.tgz
arm-linux-gcc-4.5.1-v6-vfp-20101103.tgz
arm-linux-gcc-4.5.1-v6-vfp-20101103.tgz ,
,
,
, mktools-YYYYMMDD.tar.gz
mktools-YYYYMMDD.tar.gz
mktools-YYYYMMDD.tar.gz
mktools-YYYYMMDD.tar.gz ( position:
position:
position:
position:
CD:/
CD:/
CD:/
CD:/ android
android
android
android /
/
/
/ ) to /tmp folder.
2. uncompress it with the follow command:
# cd /tmp
# sudo tar xvzf arm-linux-gcc-4.5.1-v6-vfp-20101103.tgz – C /
# sudo tar xvzf mktools-YYYYMMDD.tar .gz – C /
Notice, you should use the root user to do it.
3. Add Path in your environment file
Modify your ~/.bashrc file to add a new path with editor (gedit or vi)
PATH=$PATH:/opt/FriendlyARM/toolschain/4.5.1/bin
To
apply this change, login again or restart the .bashrc
# source .bashrc
4. Check the tool-chain path to see if it is set up correctly or not, whether it show gcc version
4.5.1
# arm-linux-gcc – v
3.2
3.2
3.2
3.2 Source
Source
Source
Source code
code
code
code Prepared
Prepared
Prepared
Prepared
Let s first create a working directory“/opt/FriendlyARM/ Tiny210 /android Type the command below in a terminal:
# mkdir–p /opt/FriendlyARM/Tiny210/android
# chmod 777 /opt/FriendlyARM/Tiny210/android
The code that will be uncompressed in later steps will all be in this directory.
(1) Get a Copy of Android Souce Code Package Create a temporary directory /tmp/android in PC.
#mkdir /tmp/android
Copy all the files under Android from the shipped CD to /tmp/Android
( 2 ) Uncompress Android Kernel
Execute the command below in /opt/FriendlyARM/ Tiny210 /android
#cd /opt/FriendlyARM/Tiny210/android
#tar xvzf /tmp/android/linux-2.6.35.7-android-2011-09-30.tgz
This will create a linux-2.6.3 5 -android directory which contains a complete copy of source code
Page 9
V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210 System
System
System
System System
System
System
System Development
Development
Development
Development manual
manual
manual
manual
www.armdevs.com
www.armdevs.com
www.armdevs.com
www.armdevs.com
9
Note: 2011 0925 is the date when we released it
( 3 ) Uncompress Android System Execute the command below in /opt/FriendlyARM/ Tiny210 /android
#cd /opt/FriendlyARM/Tiny210/android
#tar xvzf /tmp/android/android-2.3.1-fs-20110925.tar .gz
This will create a Android-2.3 .1 directory Note: 2011 092 5 is the date when we released it. This source code contains a copy of Android-2.3 .1 source code and compiling scripts.
( 4 ) Uncompress Android root filesystem Execute the command below in /opt/FriendlyARM/ Tiny210 /android
#cd /opt/FriendlyARM/Tiny210/android
#tar xvzf /tmp/android/rootfs_android-20110925.tar .gz
This will create a rootfs_android directory Note: 2011 0925 is the date when we released it.
3.3
3.3
3.3
3.3 Configure
Configure
Configure
Configure and
and
and
and Compile
Compile
Compile
Compile Linux
Linux
Linux
Linux Kernel
Kernel
Kernel
Kernel
Android's Linux kernel is a little bit different from a standard one but its configuration method is the same. If you
are not familiar with configuring a Linux kernel we suggest you use our default configuration file.
To
compile a kernel, please follow the steps below:
# cd /opt/FriendlyARM/Tiny210/android/ linux-2.6.35.7-android
# cp mini210_android_defconfig .config
# make
This will generate a zImage
zImage
zImage
zImage under "arch/arm/boot".
If you need to use the
AV
Camera in for Tiny210SDK2 board, you should use the command:
# cp mini210-tvp5150_android_defconfig .config
# make
3.4
3.4
3.4
3.4 Create
Create
Create
Create Android
Android
Android
Android
Compiling Android may not be an easy task for beginners. Therefore we have a complete copy of the source code
and two compiling scripts: build-android
build-android
build-android
build-android and genrootfs.sh.
genrootfs.sh.
genrootfs.sh.
genrootfs.sh.
Execute the command below:
# cd /opt/FriendlyARM/Tiny210/android/Android-2.3.1
# ./build-android
This will begin to compile Android-2.3. This process may take a while.
We
recommend users to use a multi-core
CPU and Linux instead of using a simulator.
After it is done, run the following script:
#./genrootfs.sh
This will create a target file system we need and a rootfs_dir directory. It is the same as rootfs_android .
Page 10
V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210 System
System
System
System System
System
System
System Development
Development
Development
Development manual
manual
manual
manual
www.armdevs.com
www.armdevs.com
www.armdevs.com
www.armdevs.com
10
With the mkyaffs2image-128M utility, you can make a yaffs2 image, that can be burn into Tiny210 board.
#cd /opt/FriendlyARM/Tiny210/android/Android-2.3.1
#mkyaffs2image-128M rootfs_dir rootfs_android.img
This will generate a rootfs_android.img file in the current directory.
3.5
3.5
3.5
3.5 Create
Create
Create
Create or
or
or
or Run
Run
Run
Run File
File
File
File System
System
System
System
With the mkyaffs2image-128M utility, you can make a yaffs2 image, that can be burn into Tiny210 board.
#cd /opt/FriendlyARM/Tiny210/android/Android-2.3.1
#mkyaffs2image-128M rootfs_dir rootfs_android.img
This will generate a rootfs_android.img file in the current directory.
Page 11
V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210 System
System
System
System System
System
System
System Development
Development
Development
Development manual
manual
manual
manual
www.armdevs.com
www.armdevs.com
www.armdevs.com
www.armdevs.com
11
4
4
4
4 Android
Android
Android
Android Application
Application
Application
Application Programming
Programming
Programming
Programming Guide
Guide
Guide
Guide
This chapter will introduce how to build Android development environment,including download and install
Android SDK and Eclipse.
4.1
4.1
4.1
4.1 Install
Install
Install
Install the
the
the
the Application
Application
Application
Application Programming
Programming
Programming
Programming environment
environment
environment
environment
This page will introduce how to build the Android application in Windows 7 system.It is for Android 2.3 .I f the
system is not Android 2.3, you can get the code from CD or the follow website:
http://www.minidevs.com/resources/Download.html If you buy Tiny210 , the Android source code and cross
compile tools are supplied in DVD.
The Method is for Fedora14,not for Fedora9. All software package mentioned in this Article can be found in
Android folder of the DVD.
4.1.1
4.1.1
4.1.1
4.1.1 Step
Step
Step
Step 1:
1:
1:
1: download
download
download
download and
and
and
and install
install
install
install JDK(Java
JDK(Java
JDK(Java
JDK(Java SE
SE
SE
SE Development
Development
Development
Development Kit)
Kit)
Kit)
Kit)
Go to the website: http://www.oracle.com/technetwork/java/javase/downloads/index.html , then Download it as follow picture:
1. Select the "JDK"
2. Select "Accept License Agreement",then select JDK download links according the platform. Download JDK installation program jdk-6u25-windows-i586.exe for Windows7 32bit Version. After download
completed,double click the installation program, then install it according to the wizard tips.
Page 12
V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210 System
System
System
System System
System
System
System Development
Development
Development
Development manual
manual
manual
manual
www.armdevs.com
www.armdevs.com
www.armdevs.com
www.armdevs.com
12
3. After the installation, follow the steps to add JDK command into Path environment variables :
1) Right click "My Computer"-> Property ,then select "Advanced system settings" option on the left navigation.
2) Click the lower right corner of the "Environment V ariables" option.
3) In the "system variables",double click "Path environment variable", add the content:"C:\Program
Files\Java\jdk1.6.0_25\;" in the front of the variable value.Please note there is a semicolon in the content.
4) Click "OK" to complete the environment variable settings
4.1.2
4.1.2
4.1.2
4.1.2 Step
Step
Step
Step 2:
2:
2:
2: download
download
download
download and
and
and
and install
install
install
install Android
Android
Android
Android SDK
SDK
SDK
SDK
File name: installer_r11-windows.exe (position: CD:/Android/) Go to the website: http://developer.android.com/sdk/ , download it as the below picture:
Page 13
V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210 System
System
System
System System
System
System
System Development
Development
Development
Development manual
manual
manual
manual
www.armdevs.com
www.armdevs.com
www.armdevs.com
www.armdevs.com
13
Double click the installation program installer_r11-windows.exe, then install it according to the wizard tips.It is
installed in the directory C:\Program Files\Android\android-sdk by default. If meet can not find the JDK
error,please go back once again then click "Next".
Since the SDK is installed in C drive by default, please run SDK Manager as an administrator, otherwise
download and install Packages will fail because it can't write data to the C drive.Start SDK as an administrator
according to the following steps:
1) Right-click the SDK Manager ,click "Properties"
2) Select "Compatibility"tab in the SDK Manager Properties dialog box,select "Run this program as
administrator"
3) When start SDK,it will open the confirmation dialog box,click "Yes" to run the program as an administrator.
4.1.3
4.1.3
4.1.3
4.1.3 Step
Step
Step
Step 3:
3:
3:
3: download
download
download
download and
and
and
and install
install
install
install Android2.3
Android2.3
Android2.3
Android2.3 Package
Package
Package
Package
Run SDK Manager as administrator, select "Available Package" in the Android SDK and
AVD
Manager's dialog,
click ">"in the front of Android Repository to expand the options:
Click "Install Selected " button in the above dialog,then select "Accept All" in the "Choose Package to install',
click "Install" to download and install the Android SDK, wait it finished, then reboot the ADB.
4.1.4
4.1.4
4.1.4
4.1.4 Step
Step
Step
Step 4:
4:
4:
4: install
install
install
install Eclipse
Eclipse
Eclipse
Eclipse development
development
development
development environment
environment
environment
environment
File name: eclipse-java-helios-SR1-win32.zip (Posion: CD:/Android/)
You
can download Eclipse from the website: http://www.eclipse.org/downloads/ , refer to the picture and select the
Windows categori es, then download Eclipse IDE for Java Developers
Page 14
V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210 System
System
System
System System
System
System
System Development
Development
Development
Development manual
manual
manual
manual
www.armdevs.com
www.armdevs.com
www.armdevs.com
www.armdevs.com
14
Uncompress the eclipse-java-helios-SR1-win32.zip file to the D:/ folder.Then you can run the eclipse.exe in the
folder D:/eclipse/eclipse.exe .
When start Eclipse,please set the workspace path to save all the source code you create. The main menu of Eclipse
is as below:
4.1.5
4.1.5
4.1.5
4.1.5 Step
Step
Step
Step 5:
5:
5:
5: install
install
install
install Android
Android
Android
Android Development
Development
Development
Development Tools
Tools
Tools
Tools
File name: ADT_9.0.0.zip
ADT_9.0.0.zip
ADT_9.0.0.zip
ADT_9.0.0.zip (Posion:
(Posion:
(Posion:
(Posion: CD:/Android/)
CD:/Android/)
CD:/Android/)
CD:/Android/)
You
can download it from the follow ing website: http://developer.android.com/sdk/eclipse-adt.html#installing
Page 15
V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210 System
System
System
System System
System
System
System Development
Development
Development
Development manual
manual
manual
manual
www.armdevs.com
www.armdevs.com
www.armdevs.com
www.armdevs.com
15
Then uncompress ADT_9.0.0.zip to the eclipse installed folder(d:/eclipse).
4.1.6
4.1.6
4.1.6
4.1.6 Step
Step
Step
Step 6:
6:
6:
6: Configure
Configure
Configure
Configure the
the
the
the Eclipse
Eclipse
Eclipse
Eclipse
Run the eclipse.exe in D:/eclipse, then c lick "Windows->Preferences" in main menu to open the Preferences
dialog, then select "Android" and set the configure file as follow s , set the SDK location and then click Apply button. The default path is : C:\Program Files\Android\ android-sdk
Click "OK" to finish configuration.
4.1.7
4.1.7
4.1.7
4.1.7 Create
Create
Create
Create Android
Android
Android
Android
AVD
AVD
AVD
AVD
Click SDK Manager, then click "New..." in the "Android SDK and
AVD
Manager", it will open "Create new
Android Virtual Device(AVD)" dialog,input as follows:
Name
Name
Name
Name Android-AVD
Target
Target
Target
Target : Android 2.3.1 - API Level 9
SD
SD
SD
SD card
card
card
card size
size
size
size : 512
Click "Create A VD"
Page 16
V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210 System
System
System
System System
System
System
System Development
Development
Development
Development manual
manual
manual
manual
www.armdevs.com
www.armdevs.com
www.armdevs.com
www.armdevs.com
16
We
will find the device in the dialog.
Then we can run it by clicking the Start button and click launch to open it.
4.1.8
4.1.8
4.1.8
4.1.8 Step
Step
Step
Step 8:
8:
8:
8: Develop
Develop
Develop
Develop the
the
the
the first
first
first
first Android
Android
Android
Android application
application
application
application program
program
program
program
4.1.9
4.1.9
4.1.9
4.1.9 Creat
Creat
Creat
Creat Hello
Hello
Hello
Hello Tiny210
Tiny210
Tiny210
Tiny210 project
project
project
project
In the eclipse menu, click "File->New->Project", then open the "New project dialog".
Page 17
V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210 System
System
System
System System
System
System
System Development
Development
Development
Development manual
manual
manual
manual
www.armdevs.com
www.armdevs.com
www.armdevs.com
www.armdevs.com
17
Then select
"Android->Android Project", and click "Next", it will open "New Android Project"
I nput as follows :
1) Project Name: Hello Tiny210
2) Build Target: Android 2.3.1
3) Appication name: Hello Tiny210
4) Package name: com. Tiny210
5) Create Activity: MainActivity
Then click "Finish" button, it will go to the eclipe main interface.
Page 18
V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210 System
System
System
System System
System
System
System Development
Development
Development
Development manual
manual
manual
manual
www.armdevs.com
www.armdevs.com
www.armdevs.com
www.armdevs.com
18
Click "X" button after Welcome to close the welcome interface.You will see project interface.Then click "src ->
com. Tiny210 -> MainActivity.java" to get the source code.
4.1.10
4.1.10
4.1.10
4.1.10 Run
Run
Run
Run HelloTiny210
HelloTiny210
HelloTiny210
HelloTiny210 Application
Application
Application
Application Program
Program
Program
Program in
in
in
in
AVD
AVD
AVD
AVD
It need the platform-tools, install it as " 4.1.11.2 Test ADB with Tiny210 "
for the project, click "Run->Run As->Android Application". to run it on the A VD. After the Android system
booted, it will run HelloTiny210 Application Program automatically.
4.1.11
4.1.11
4.1.11
4.1.11 Step
Step
Step
Step 8:
8:
8:
8: Create
Create
Create
Create the
the
the
the Debugging
Debugging
Debugging
Debugging environment
environment
environment
environment for
for
for
for Tiny210
Tiny210
Tiny210
Tiny210
4.1.11.1
4.1.11.1
4.1.11.1
4.1.11.1 Install
Install
Install
Install the
the
the
the USB
USB
USB
USB ADB
ADB
ADB
ADB driver
driver
driver
driver
The USB Driver for Windows is available for download as an optional SDK component.
You
need the driver only
if you are developing on Windows and want to connect an Android-powered device (ADP , Tiny210, Nexus One,
or Nexus S) to your development environment over USB.
To
download the driver, use the Android SDK and
AVD
Manager tool that is included with the Android SDK:
1 Launch the SDK and
AVD
Manager by double-clicking SDK
SDK
SDK
SDK Manager.exe
Manager.exe
Manager.exe
Manager.exe , at the root of your SDK
directory.
Page 19
V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210 System
System
System
System System
System
System
System Development
Development
Development
Development manual
manual
manual
manual
www.armdevs.com
www.armdevs.com
www.armdevs.com
www.armdevs.com
19
2 Expand the Third party Add-ons and Google Inc. add-ons.
3 Check Google
Google
Google
Google Usb
Usb
Usb
Usb Driver
Driver
Driver
Driver package
package
package
package and click Install selected.
4 Proceed to install the package. When done, the driver files are downloaded into the C:\Program
Files\Android\android-sdk\extras\google\usb_drive r directory.
Once you've downloaded your USB driver, follow the instructions below to install or upgrade the driver, based on
your version of Windows and whether you're installing for the first time or upgrading an existing driver.
To
install the Android USB driver on Windows 7 for the first time:
1 Connect Tiny210 to your computer's USB port by miniUSB cable.
2 Right-click on
Computer
from your desktop or Windows Explorer, and select Manage
Manage
Manage
Manage .
3 Select Devices
Devices
Devices
Devices in the left pane.
4 Locate and expand
Other device
in the right pane.
5 Right-click the device name (such as
S5P OTG-USB
) and select Update
Update
Update
Update Driver
Driver
Driver
Driver Software
Software
Software
Software . This will
launch the Hardware Update Wizard.
6 Select Browse
Browse
Browse
Browse my
my
my
my computer
computer
computer
computer for
for
for
for driver
driver
driver
driver software
software
software
software and click Next
Next
Next
Next .
7 Click Browse
Browse
Browse
Browse and locate the USB driver folder. (The Google USB Driver is located in " C:\Program
C:\Program
C:\Program
C:\Program
Files\Android\android-sdk\extras\google\usb_driver
Files\Android\android-sdk\extras\google\usb_driver
Files\Android\android-sdk\extras\google\usb_driver
Files\Android\android-sdk\extras\google\usb_driver " )
8 Click Next
Next
Next
Next to install the driver.
4.1.11.2
4.1.11.2
4.1.11.2
4.1.11.2 Add
Add
Add
Add adb
adb
adb
adb command
command
command
command into
into
into
into Path
Path
Path
Path environment
environment
environment
environment variables
variables
variables
variables
1) Right-click My Computer->Properties, then select "Advanced system setting" option.
2) Click the "Environment V ariables" option on the lower right corner.
3) Double click Path environment variable, add the content in the front of the variable value: " C:\Program
Files\Android\android-sdk-windows\platform-tools"
Page 20
V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210 System
System
System
System System
System
System
System Development
Development
Development
Development manual
manual
manual
manual
www.armdevs.com
www.armdevs.com
www.armdevs.com
www.armdevs.com
20
4) Click "OK" to finished.
Test
Test
Test
Test the
the
the
the adc
adc
adc
adc command
command
command
command
Click the Start menu,input "cmd" in the search box,press Enter in the cmd.exe to start DOS window. Input "adb"
then press Enter,it will display the following information if the Environment V ariables set ok.
4.1.11.4
4.1.11.4
4.1.11.4
4.1.11.4
Test
Test
Test
Test
ADB
ADB
ADB
ADB function
function
function
function with
with
with
with Tiny210
Tiny210
Tiny210
Tiny210
Check
Check
Check
Check the
the
the
the device
device
device
device connection
connection
connection
connection status
status
status
status
Start Tiny210 to enter the Android system, connect mini USB cable from the board to PC,input the command in
the DOS window to verify the development board is connected:
# adb devices
It will display the following information if the board is connected:
Enter
Enter
Enter
Enter ADB
ADB
ADB
ADB Shell
Shell
Shell
Shell
Input the command to enter the Tiny210 terminal:
# adb shell
Input exit in the Tiny210 terminal to return to DOS p rompt .
Install
Install
Install
Install software
software
software
software with
with
with
with ADB
ADB
ADB
ADB
Install D:\sinaweibo_2.0.4.apk for example, input adb
adb
adb
adb install
install
install
install D:\sinaweibo_
D:\sinaweibo_
D:\sinaweibo_
D:\sinaweibo_ 2.0.4.apk
2.0.4.apk
2.0.4.apk
2.0.4.apk in the DOS
window.
Page 21
V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210 System
System
System
System System
System
System
System Development
Development
Development
Development manual
manual
manual
manual
www.armdevs.com
www.armdevs.com
www.armdevs.com
www.armdevs.com
21
4.1.11.4
4.1.11.4
4.1.11.4
4.1.11.4 Run
Run
Run
Run application
application
application
application program
program
program
program in
in
in
in Tiny210
Tiny210
Tiny210
Tiny210 by
by
by
by USB
USB
USB
USB ADB
ADB
ADB
ADB
Run Eclipse, it will open HelloTiny210 project automatically. Right lick HelloTiny210
HelloTiny210
HelloTiny210
HelloTiny210 project in the Eclipse main
interface, select Properties
Properties
Properties
Properties , it will pop-up the Properties for HelloTiny210 window:
Click " Run->Debug
Run->Debug
Run->Debug
Run->Debug Settings
Settings
Settings
Settings ",select HelloTiny210,then click Edit button,click " Target
Target
Target
Target " in the Edit Configuration
window, click " Manual
Manual
Manual
Manual " for the Development Target Selection Mode, as follows:
Page 22
V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210 System
System
System
System System
System
System
System Development
Development
Development
Development manual
manual
manual
manual
www.armdevs.com
www.armdevs.com
www.armdevs.com
www.armdevs.com
22
Click OK and exit it.
Select HelloTiny210
HelloTiny210
HelloTiny210
HelloTiny210 project,then select Run->Run
Run->Run
Run->Run
Run->Run As->Android
As->Android
As->Android
As->Android Application
Application
Application
Application ,select " Choose
Choose
Choose
Choose a
a
a
a running
running
running
running
Android
Android
Android
Android device
device
device
device " in Android Device Chooser dialog, select the Android device(2.3.1) in the list,click "OK"
Wait for a moment,the HelloTiny210 application will run in Tiny210 board.
Page 23
V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210 System
System
System
System System
System
System
System Development
Development
Development
Development manual
manual
manual
manual
www.armdevs.com
www.armdevs.com
www.armdevs.com
www.armdevs.com
23
4.1.11.6
4.1.11.6
4.1.11.6
4.1.11.6 Debug
Debug
Debug
Debug Android
Android
Android
Android application
application
application
application program
program
program
program in
in
in
in Tiny210
Tiny210
Tiny210
Tiny210
Exit HelloTiny210 program to Eclipse main interface, click " Open
Open
Open
Open Perspective->Debug
Perspective->Debug
Perspective->Debug
Perspective->Debug " in the Eclipse main
interface to enter the debug view.Try to set a breakpoint in the source code, finally click " Run->Debug
Run->Debug
Run->Debug
Run->Debug " in the
menu. The program will suspend on the breakpoint,as below:
4.2
4.2
4.2
4.2 Program
Program
Program
Program access
access
access
access to
to
to
to hardware
hardware
hardware
hardware in
in
in
in Andorid
Andorid
Andorid
Andorid
For Programming access to Tiny210 hardware in android, we create a hardware deveice
library(libfriendlyarm-hardware.so), currently supported hardware devices, including : serial devices, buzzer
devices, EEPROM, ADC equipment.
Page 24
V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210 System
System
System
System System
System
System
System Development
Development
Development
Development manual
manual
manual
manual
www.armdevs.com
www.armdevs.com
www.armdevs.com
www.armdevs.com
24
iTest application was developed with the library, you can run the iTest to understand the function of this library on
android system.
This section describes how to use Android applications libfriendlyarm-hardware.so library.
4.2.1
4.2.1
4.2.1
4.2.1 How
How
How
How to
to
to
to use
use
use
use the
the
the
the library
library
library
library (libfriendlyarm-hardware.so)
(libfriendlyarm-hardware.so)
(libfriendlyarm-hardware.so)
(libfriendlyarm-hardware.so)
The library libfriendlyarm-hardware.so was at the follow position in android source code.
device/Samsung/smdkv210/prebuilt/libfriendly
device/Samsung/smdkv210/prebuilt/libfriendly
device/Samsung/smdkv210/prebuilt/libfriendly
device/Samsung/smdkv210/prebuilt/libfriendly a
a
a
a rm-hardware.so
rm-hardware.so
rm-hardware.so
rm-hardware.so
On development board position:
/system/lib/libfriendlyarm-hardware.so
/system/lib/libfriendlyarm-hardware.so
/system/lib/libfriendlyarm-hardware.so
/system/lib/libfriendlyarm-hardware.so
If you develop the application program in Eclipse, you can do the follow steps to use
"libfriendlyarm-hardware.so".
1) Find your Android application folder(Such as LEDDemo folder),
creats the libs
libs
libs
libs folder in this folder, and then creats armeabi
armeabi
armeabi
armeabi folder in libs
libs
libs
libs folder,
finally copy "libfriendlyarm-hardware.so" to the armeabi
armeabi
armeabi
armeabi folders.
2) Back to your application folder, Create three directories "com\friendlyarm\AndroidSDK
"com\friendlyarm\AndroidSDK
"com\friendlyarm\AndroidSDK
"com\friendlyarm\AndroidSDK " in the src
src
src
src folder,
then create a file " HardwareControler .java
HardwareControler.java
HardwareControler.java
HardwareControler.java " in the folder " src\com\friendlyarm\AndroidSDK",
src\com\friendlyarm\AndroidSDK",
src\com\friendlyarm\AndroidSDK",
src\com\friendlyarm\AndroidSDK", add
add
add
add the
the
the
the
follow
follow
follow
follow source
source
source
source code
code
code
code to
to
to
to this
this
this
this file.
file.
file.
file.
package com.friendlyarm.AndroidSDK;
import android.util.Log;
public class HardwareControler
{
/* Serial Port */
static public native int openSerialPort( String devName, long baud, int dataBits, int
stopBits );
/* LED */
static public native int setLedState( int ledID, int ledState );
/* PWM */
static public native int PWMPlay(int frequency);
static public native int PWMStop();
/* ADC */
static public native int readADC();
/* I2C */
static public native int openI2CDevice();
static public native int writeByteDataToI2C(int fd, int pos, byte byteData);
static public native int readByteDataFromI2C(int fd, int pos);
/* 通用接口 */
Page 25
V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210 System
System
System
System System
System
System
System Development
Development
Development
Development manual
manual
manual
manual
www.armdevs.com
www.armdevs.com
www.armdevs.com
www.armdevs.com
25
static public native int write(int fd, byte[] data);
static public native int read(int fd, byte[] buf, int len);
static public native int select(int fd, int sec, int usec);
static public native void close(int fd);
static {
try {
System.loadLibrary("friendlyarm-hardware");
} catch (UnsatisfiedLinkError e) {
Log.d("HardwareControler", "libfriendlyarm-hardware library not found!");
}
}
}
Then, run the Eclipse, click "Refresh" for your program project.
If you want to use the HardwareControler API in your program, you should import the HardwareControler library
with the follow code:
Then you can write your application with the HardwareControler API, next chaper will introduce the
HardwareControler API.
4.2.2
4.2.2
4.2.2
4.2.2 library(libfriendlyarm-hardware.so)
library(libfriendlyarm-hardware.so)
library(libfriendlyarm-hardware.so)
library(libfriendlyarm-hardware.so) API
API
API
API introduce
introduce
introduce
introduce
In the application layer, through the previous section of HardwareControler class to call
libfriendlyarm-hardware.so library interfaces, the follow chapter will list HardwareControler class interface
definition, these interfaces are class methods, so do not need to create HardwareControler object instance:
4.2.2.1
4.2.2.1
4.2.2.1
4.2.2.1 Serial
Serial
Serial
Serial Port
Port
Port
Port API
API
API
API introduce
introduce
introduce
introduce
The API of the serial port is as follow:
API
API
API
API interface
interface
interface
interface
int openSerialPort( String devName, long baud, int dataBits, int stopBits )
Description
Description
Description
Description
Open the specified serial device, and returns the file descriptor.
Parameters
Parameters
Parameters
Parameters
devName : Serial port device name, such as:
import com.friendlyarm.AndroidSDK.HardwareControler;
Page 26
V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210 System
System
System
System System
System
System
System Development
Development
Development
Development manual
manual
manual
manual
www.armdevs.com
www.armdevs.com
www.armdevs.com
www.armdevs.com
26
/dev/s3c2410_serial1
/dev/s3c2410_serial2
/dev/s3c2410_serial3
/dev/ttyUSB0
/dev/ttyUSB1
/dev/ttyUSB2
/dev/ttyUSB3
baud: baud rate
dataBits: Data bits ( value is 5~8 , default value is 8 )
stopBits: Stop bits ( value 1~2 , default value is 1)
Return
Return
Return
Return value
value
value
value
On success , the File descriptor of the serial port is returned, then the File descriptor can be read, write, select.
On error, -1 is returned
API
API
API
API interface
interface
interface
interface
int write(int fd, byte[] data)
Description
Description
Description
Description
writes data to fd device .
Parameters
Parameters
Parameters
Parameters
fd:
fd:
fd:
fd: the File descriptor , data will be writed from this fd.
Data
Data
Data
Data : the writed data
Return
Return
Return
Return value
value
value
value
On success, the number of bytes written are returned (zero indicates nothing was written).
On error, -1 is returned
API
API
API
API interface
interface
interface
interface
int read(int fd,byte[] buf,int len)
Description
Description
Description
Description
read
read
read
read () attempts to read up to
count
bytes from file descriptorfdinto the buffer starting at
buf
.
Parameters
Parameters
Parameters
Parameters
fd:
fd:
fd:
fd: the File descriptor , the data will be readed from this fd.
buf
buf
buf
buf : buffers for Storing data
Len
Len
Len
Len : the number of bytes read
Return
Return
Return
Return value
value
value
value
On success, the number of bytes read is returned ( zero indicates end of file
).
On error, -1 is returned
API
API
API
API interface
interface
interface
interface
int select (int fd, int sec ,int usec )
Description
Description
Description
Description
Check whether there is data that can be read from the File descriptor fd.
Parameters
Parameters
Parameters
Parameters
fd:
fd:
fd:
fd: the File descriptor , the data will be seleclt from this fd.
sec
sec
sec
sec : Waiting time for the data, Units: seconds
Page 27
V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210 System
System
System
System System
System
System
System Development
Development
Development
Development manual
manual
manual
manual
www.armdevs.com
www.armdevs.com
www.armdevs.com
www.armdevs.com
27
usec
usec
usec
usec : Waiting time for the data, Units: ns, 1ms=1000ns
Return
Return
Return
Return value
value
value
value
On success, 1 or 0 is returned, if no data, return 0. If have data, return 1.
On error, -1 is returned
API
API
API
API interface
interface
interface
interface
int close (int fd)
Description
Description
Description
Description
Close the specified serial device ( file descriptor fd)
Parameters
Parameters
Parameters
Parameters
fd:
fd:
fd:
fd: the File descriptor .
Return
Return
Return
Return value
value
value
value
no
API
API
API
API use
use
use
use method
method
method
method
1. use "openSerialPort" to open the serial port
2. Use "select" to check serial status whether have data, if have, use "read" to read the data.
3. If want to send data to the serial port, use "write" function.
4. When finished to use the serial port, use "close" to close the serial port.
Page 28
V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210 System
System
System
System System
System
System
System Development
Development
Development
Development manual
manual
manual
manual
www.armdevs.com
www.armdevs.com
www.armdevs.com
www.armdevs.com
28
4.2.2.2LED
4.2.2.2LED
4.2.2.2LED
4.2.2.2LED API
API
API
API introduce
introduce
introduce
introduce
The API of the LED is as follow:
API
API
API
API interface
interface
interface
interface
int setLedState(int ledID,int ledState )
Description
Description
Description
Description
Turn on/off the LED
Parameters
Parameters
Parameters
Parameters
ledID:
ledID:
ledID:
ledID: Specifies which LED switches
ledState
ledState
ledState
ledState : 1 means turn on, 0 means turn off
Return
Return
Return
Return value
value
value
value
On success, 0 is returned.
On error, -1 is returned
4.2.2.3
4.2.2.3
4.2.2.3
4.2.2.3 Buzzer
Buzzer
Buzzer
Buzzer control(PWM
control(PWM
control(PWM
control(PWM API
API
API
API introduce)
introduce)
introduce)
introduce)
The API of the Buzzer control is as follow:
API
API
API
API interface
interface
interface
interface
int PWMPlay(int frequency);
Description
Description
Description
Description
Specified frequency for buzzer sound
Parameters
Parameters
Parameters
Parameters
frequency:
frequency:
frequency:
frequency:
Specifies frequency for buzzer sound
Return
Return
Return
Return value
value
value
value
On success, 0 is returned.
On error, -1 is returned
API
API
API
API interface
interface
interface
interface
int PWM Stop ();
Description
Description
Description
Description
Stop the buzzer sound
Parameters
Parameters
Parameters
Parameters :
:
:
: no
Return
Return
Return
Return value
value
value
value
On success, 0 is returned.
On error, -1 is returned
4.2.2.4
4.2.2.4
4.2.2.4
4.2.2.4 ADC
ADC
ADC
ADC API
API
API
API introduce
introduce
introduce
introduce
The API of the Buzzer control is as follow:
API
API
API
API interface
interface
interface
interface
int readADC ();
Description
Description
Description
Description
Read ADC
Parameters
Parameters
Parameters
Parameters :
:
:
: No
Return
Return
Return
Return value
value
value
value
On success, the result for ADC read is returned.
On error, -1 is returned
4.2.2.5
4.2.2.5
4.2.2.5
4.2.2.5 EEPROM
EEPROM
EEPROM
EEPROM API
API
API
API introduce
introduce
introduce
introduce
The API of the EEPROM is as follow:
Page 29
V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210 System
System
System
System System
System
System
System Development
Development
Development
Development manual
manual
manual
manual
www.armdevs.com
www.armdevs.com
www.armdevs.com
www.armdevs.com
29
API
API
API
API interface
interface
interface
interface
int open I2CDevice () ;
Description
Description
Description
Description
Open the IIC device, and returns the file descriptor.
Parameters
Parameters
Parameters
Parameters :
:
:
: No
Return
Return
Return
Return value
value
value
value
On success , the File descriptor of the IIC is returned, then the File descriptor can be read, write, select.
On error, -1 is returned
API
API
API
API interface
interface
interface
interface
int writeByteDataToI2C(int fd,int pos,byte byteData);
Description
Description
Description
Description
Write a byte data to IIC device.
Parameters
Parameters
Parameters
Parameters
fd:
fd:
fd:
fd: the File descriptor , the data will be write to this fd.
pos:
pos:
pos:
pos: Specified the postion which the data will be write,(0-255)
byteData: a byte data will be write
Return
Return
Return
Return value
value
value
value
On success , 1 is returned.
On error, -1 is returned
API
API
API
API interface
interface
interface
interface
int readByteDataFromI2C(int fd,int pos);
Description
Description
Description
Description
read a byte data to IIC device.
Parameters
Parameters
Parameters
Parameters
fd:
fd:
fd:
fd: the File descriptor , the data will be read to this fd.
pos:
pos:
pos:
pos: Specified the postion which the data will be read,(0-255)
Return
Return
Return
Return value
value
value
value
On success , the read data is returned.
On error, -1 is returned
API
API
API
API interface
interface
interface
interface
int close (int fd)
Description
Description
Description
Description :
:
:
: Close the specified fd( file descriptor fd)
Parameters
Parameters
Parameters
Parameters
fd:
fd:
fd:
fd: the File descriptor .
Return
Return
Return
Return value
value
value
value :
:
:
: no
API
API
API
API use
use
use
use method
method
method
method
1 use "openI2CDevice" to open the IIC device 2 Use "writeByteDataToI2C" to write data to EEPROM. 3 Use "readByteDataFromI2C" to read data from EEPROM.
4
4
4
4 When finished to use the EEPROM, use "close" to close the it.
4.2.3
4.2.3
4.2.3
4.2.3 API
API
API
API Demo
Demo
Demo
Demo introduce
introduce
introduce
introduce
At the Postion: CD:/Android/LEDDemo, it is a demo for l ibfriendlyarm-hardware.so API introduce, you can
open it with Eclipse.
Page 30
V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210 System
System
System
System System
System
System
System Development
Development
Development
Development manual
manual
manual
manual
www.armdevs.com
www.armdevs.com
www.armdevs.com
www.armdevs.com
30
Page 31
V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210 System
System
System
System System
System
System
System Development
Development
Development
Development manual
manual
manual
manual
www.armdevs.com
www.armdevs.com
www.armdevs.com
www.armdevs.com
31
Chapter
Chapter
Chapter
Chapter 5
5
5
5 Linux
Linux
Linux
Linux
5.1
5.1
5.1
5.1 Set
Set
Set
Set up
up
up
up Fedora
Fedora
Fedora
Fedora 9.0
9.0
9.0
9.0 Development
Development
Development
Development Environment
Environment
Environment
Environment
This section will guide you through the steps on how to install Fedora 9.0 on a PC and set up your Linux
development environment. All our software development and testing for the Mini6410 were based on Fedora 9.0.
We
didn ’ t test it on other platforms.
We
strongly suggest you use this platform as we do, which you can download
from its website
(ftp://download.fedora.redhat.com/pub/fedora/linux/releases/9/Fedora/i386/iso/Fedora-9-i386-DVD.iso).
The reason why we chose Fedora 9.0 is that it is easy to be installed and set up. Fedora 10 and later versions are
more complicated and therefore may not be easy for beginners and Fedora 8 and earlier versions are a little bit
obsolete. Please follow the steps below to install.
5.1.1
5.1.1
5.1.1
5.1.1 Install
Install
Install
Install Fedora
Fedora
Fedora
Fedora 9.0
9.0
9.0
9.0
Step1 Insert the first disk in the CDROM/DVD, set the boot sequence to CDROM in the BIOS. After reboot the
system, it will prompt the user to the following interface, just press "enter"
Step2 The system will check the installation disk. It can be ignored, just press "Skip" to the next step
Page 32
V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210 System
System
System
System System
System
System
System Development
Development
Development
Development manual
manual
manual
manual
www.armdevs.com
www.armdevs.com
www.armdevs.com
www.armdevs.com
32
Step3 it enters the graphic interface, click on the "Next" button.
Step4 set the installation language. In this example, we chose the simplified English.
Page 33
V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210 System
System
System
System System
System
System
System Development
Development
Development
Development manual
manual
manual
manual
www.armdevs.com
www.armdevs.com
www.armdevs.com
www.armdevs.com
33
Step5 set the keyboard, in this example, we chose the U.S. key board.
Step 6 configure the network.
Page 34
V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210 System
System
System
System System
System
System
System Development
Development
Development
Development manual
manual
manual
manual
www.armdevs.com
www.armdevs.com
www.armdevs.com
www.armdevs.com
34
In our example, we didn ’ t set it as "DHCP", we used a static IP instead, and typed the IP and subnet mask as
follows.
Click on the OK button and go on to set the machine name, gateway and DNS.
Page 35
V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210 System
System
System
System System
System
System
System Development
Development
Development
Development manual
manual
manual
manual
www.armdevs.com
www.armdevs.com
www.armdevs.com
www.armdevs.com
35
Step 7 set the time zone.
We
chose "Asia/Shanghai".
Step 8 set up the administrator ’ s password, i.e. the root’s password. "root" is the super user. It should be at least 6
characters
Page 36
V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210 System
System
System
System System
System
System
System Development
Development
Development
Development manual
manual
manual
manual
www.armdevs.com
www.armdevs.com
www.armdevs.com
www.armdevs.com
36
Step 9 disk partition.
We
followed the default option. Before do this, please back up disk data.
Click on "Next", it will warn the user that all the data will be deleted. Usually we would do this installation in
VMWARE, so we chose "Write changes to disk" and disk format would begin.
Page 37
V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210 System
System
System
System System
System
System
System Development
Development
Development
Development manual
manual
manual
manual
www.armdevs.com
www.armdevs.com
www.armdevs.com
www.armdevs.com
37
Here is the format process:
Step 11 select the installation type, in this example, we chose "customize"
Page 38
V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210 System
System
System
System System
System
System
System Development
Development
Development
Development manual
manual
manual
manual
www.armdevs.com
www.armdevs.com
www.armdevs.com
www.armdevs.com
38
Step 12 configure the "server" item as follows:
Step 13 begin installation
Page 39
V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210 System
System
System
System System
System
System
System Development
Development
Development
Development manual
manual
manual
manual
www.armdevs.com
www.armdevs.com
www.armdevs.com
www.armdevs.com
39
Step14: installation complete.
Step15: after installation completed, click on the reboot button on the page shown in step 14
Page 40
V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210 System
System
System
System System
System
System
System Development
Development
Development
Development manual
manual
manual
manual
www.armdevs.com
www.armdevs.com
www.armdevs.com
www.armdevs.com
40
Step16: skip this license page and go "forward"
Step17: create new users.
We
ignored user creation and went to the next step.
Page 41
V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210 System
System
System
System System
System
System
System Development
Development
Development
Development manual
manual
manual
manual
www.armdevs.com
www.armdevs.com
www.armdevs.com
www.armdevs.com
41
Press "continue" to go on.
Step18: setup date and time.
We
ignored this and went to the next step.
Page 42
V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210 System
System
System
System System
System
System
System Development
Development
Development
Development manual
manual
manual
manual
www.armdevs.com
www.armdevs.com
www.armdevs.com
www.armdevs.com
42
Step19: confirm hardware information.
We
just clicked on "Finish".
On the popup window shown below, just click on the red marked button.
Page 43
V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210 System
System
System
System System
System
System
System Development
Development
Development
Development manual
manual
manual
manual
www.armdevs.com
www.armdevs.com
www.armdevs.com
www.armdevs.com
43
Step 20: on the login page, login as "root"
Input the password we just created for "root"
Page 44
V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210 System
System
System
System System
System
System
System Development
Development
Development
Development manual
manual
manual
manual
www.armdevs.com
www.armdevs.com
www.armdevs.com
www.armdevs.com
44
When login as "root", the following popup window will show up, just click on "Continue"
Below is the interface the user will see after a successful login.
Page 45
V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210 System
System
System
System System
System
System
System Development
Development
Development
Development manual
manual
manual
manual
www.armdevs.com
www.armdevs.com
www.armdevs.com
www.armdevs.com
45
5.1.2
5.1.2
5.1.2
5.1.2 Add
Add
Add
Add User
User
User
User Account
Account
Account
Account
To
create a new user (not root) account, here are the steps:
Step 1: go to "Users and Groups"
Page 46
V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210 System
System
System
System System
System
System
System Development
Development
Development
Development manual
manual
manual
manual
www.armdevs.com
www.armdevs.com
www.armdevs.com
www.armdevs.com
46
Step 2: open the "Users Manager" window
Step 3: click on the "Add User" button, type the user name and password
Page 47
V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210 System
System
System
System System
System
System
System Development
Development
Development
Development manual
manual
manual
manual
www.armdevs.com
www.armdevs.com
www.armdevs.com
www.armdevs.com
47
Click on "OK", you will see that a new "plg" user has been created, and a "plg" directory has been created in the
"/home" directory too.
Page 48
V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210 System
System
System
System System
System
System
System Development
Development
Development
Development manual
manual
manual
manual
www.armdevs.com
www.armdevs.com
www.armdevs.com
www.armdevs.com
48
5.1.3Access
5.1.3Access
5.1.3Access
5.1.3Access Windows
Windows
Windows
Windows Files
Files
Files
Files
You
can easily access shared files in Windows from either a virtual machine or a real Fedora9 system as long as
they can communicate.
To
connect to a Windows from a virtual machine, the easiest way is to set "Guest" to
"Bridge" in the network configuration.
Page 49
V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210 System
System
System
System System
System
System
System Development
Development
Development
Development manual
manual
manual
manual
www.armdevs.com
www.armdevs.com
www.armdevs.com
www.armdevs.com
49
To
access shared files in Windows, please following the steps below:
Step 1: set a shared directory in Windows. Here we set a "share_f9"
Page 50
V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210 System
System
System
System System
System
System
System Development
Development
Development
Development manual
manual
manual
manual
www.armdevs.com
www.armdevs.com
www.armdevs.com
www.armdevs.com
50
Step 2: set Fedora9
Open the window below:
Page 51
V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210 System
System
System
System System
System
System
System Development
Development
Development
Development manual
manual
manual
manual
www.armdevs.com
www.armdevs.com
www.armdevs.com
www.armdevs.com
51
Select "Windows share" in the "service type" field
Input the shared file ’ s name and its windows machine IP
Page 52
V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210 System
System
System
System System
System
System
System Development
Development
Development
Development manual
manual
manual
manual
www.armdevs.com
www.armdevs.com
www.armdevs.com
www.armdevs.com
52
Click on "connect", the following window will show up:
Go ahead and "connect" again, you will see the shared files you just set in your windows system.
Page 53
V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210 System
System
System
System System
System
System
System Development
Development
Development
Development manual
manual
manual
manual
www.armdevs.com
www.armdevs.com
www.armdevs.com
www.armdevs.com
53
If you want to access this directory from the command line utility, you can do it by hitting the TAB key.
To
disconnect the shared directory, right click on the shared directory and following the operations in the
screenshot below:
Page 54
V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210 System
System
System
System System
System
System
System Development
Development
Development
Development manual
manual
manual
manual
www.armdevs.com
www.armdevs.com
www.armdevs.com
www.armdevs.com
54
5.1.4
5.1.4
5.1.4
5.1.4 Configure
Configure
Configure
Configure NFS
NFS
NFS
NFS Service
Service
Service
Service
If you have installed Fedora9 on your system, all the corresponding NFS components will be installed by default,
you can just follow the steps below to setup and configure the NFS service.
Step 1: Setting Up a Shared Directory
Note: to access a shared directory, you need to follow what were described in 4.2 to install the target file system.
(1)
(1)
(1)
(1) Set
Set
Set
Set up
up
up
up Shared
Shared
Shared
Shared Directories
Directories
Directories
Directories
Run the command below:
#gedit
#gedit
#gedit
#gedit /etc/exports
/etc/exports
/etc/exports
/etc/exports
This command edits the NFS configuration file. Add the following line
(
Note
if this file is opened for the first time, it will be empty
):
/opt/FriendlyARM/Mini6410/linux/root_qtopia_qt4 *(rw,sync,no_root_squash)
" /opt/FriendlyARM/mini6410/linux/root_qtopia_qt4
/opt/FriendlyARM/mini6410/linux/root_qtopia_qt4
/opt/FriendlyARM/mini6410/linux/root_qtopia_qt4
/opt/FriendlyARM/mini6410/linux/root_qtopia_qt4 " is a NFS shared directory, it can be
mounted as the root file system through NFS;
* means all clients can mount to this directory.
"rw" means all clients that have been mounted to this directory have the read and write rights to this directory.
"no_root_squash" means all clients that have been mounted to this directory can be set to a root user
Step
Step
Step
Step 2:
2:
2:
2: Starting
Starting
Starting
Starting NFS
NFS
NFS
NFS
You
can start the NFS service through either command line or graphic interface.
We
set up the NFS service to let
others access shared directories. By default Fedora starts it firewall which will disable the NFS service. So you
need to disable the firewall by typing "lokkit" in a command line window.
Page 55
V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210 System
System
System
System System
System
System
System Development
Development
Development
Development manual
manual
manual
manual
www.armdevs.com
www.armdevs.com
www.armdevs.com
www.armdevs.com
55
Select (*) Disabled, and click on the "OK" button to disable the firewall permanently. Now you can start the NFS
service:
(1)
(1)
(1)
(1) Start
Start
Start
Start and
and
and
and Stop
Stop
Stop
Stop the
the
the
the NFS
NFS
NFS
NFS service
service
service
service
Run the command below:
#/etc/init.d/nfs
#/etc/init.d/nfs
#/etc/init.d/nfs
#/etc/init.d/nfs start
start
start
start
This command will start the NFS service. The user can verify whether the service is running by commanding:
# mount -t nfs localhost: /opt/FriendlyARM/mini6410/linux/root_qtopia_qt4
/opt/FriendlyARM/mini6410/linux/root_qtopia_qt4
/opt/FriendlyARM/mini6410/linux/root_qtopia_qt4
/opt/FriendlyARM/mini6410/linux/root_qtopia_qt4 /mnt/
If no err messages come up, the user can then browse the contents of the "/mnt" directory and verify if the contents
are the same as the " /opt/FriendlyARM/mini6410/linux/root_qtopia_qt4
/opt/FriendlyARM/mini6410/linux/root_qtopia_qt4
/opt/FriendlyARM/mini6410/linux/root_qtopia_qt4
/opt/FriendlyARM/mini6410/linux/root_qtopia_qt4 " directory.
Stop the service by commanding:
# /etc/init.d/nfs
/etc/init.d/nfs
/etc/init.d/nfs
/etc/init.d/nfs stop
stop
stop
stop
(2)
(2)
(2)
(2) Starting
Starting
Starting
Starting the
the
the
the NFS
NFS
NFS
NFS service
service
service
service through
through
through
through the
the
the
the graphic
graphic
graphic
graphic interface
interface
interface
interface
To
auto run the service on system startup, the user can execute the command below:
#
#
#
# serviceconf
serviceconf
serviceconf
serviceconf
Open the system configuration window, on the left side of the window, check the NFS box, click on the "Enable"
button to start it.
Page 56
V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210 System
System
System
System System
System
System
System Development
Development
Development
Development manual
manual
manual
manual
www.armdevs.com
www.armdevs.com
www.armdevs.com
www.armdevs.com
56
Step 3: Booting System via NFS
After setting up and running the NFS service, the user can set the NFS as the root file system to boot the board.
To
boot the system via NFS, the board can fully utilize a "big" hard disk because the user can use the host PC ’ s hard
disk, this trick is widely used in Linux development.
Switch the target board ’ s boot mode to the "SDBOOT" side ( note: you need to enter the super terminal menu,
please refer to 2.4 ), connect the power cable, serial port cable and the network cable, and open a super terminal.
Type the following command:
console=ttySAC0
console=ttySAC0
console=ttySAC0
console=ttySAC0
root=/dev/nfs
root=/dev/nfs
root=/dev/nfs
root=/dev/nfs
nfsroot=192.168.1.111:/opt/FriendlyARM/mini6410/linux/root_qtopia_qt4
nfsroot=192.168.1.111:/opt/FriendlyARM/mini6410/linux/root_qtopia_qt4
nfsroot=192.168.1.111:/opt/FriendlyARM/mini6410/linux/root_qtopia_qt4
nfsroot=192.168.1.111:/opt/FriendlyARM/mini6410/linux/root_qtopia_qt4
ip=192.168.1.70:192.168.1.111:192.168.1.111:255.255.255.0:mini6410.arm9.net:et
ip=192.168.1.70:192.168.1.111:192.168.1.111:255.255.255.0:mini6410.arm9.net:et
ip=192.168.1.70:192.168.1.111:192.168.1.111:255.255.255.0:mini6410.arm9.net:et
ip=192.168.1.70:192.168.1.111:192.168.1.111:255.255.255.0:mini6410.arm9.net:et
h0:off
h0:off
h0:off
h0:off
"nfsroot" is the board ’ s
IP.
If you started a virtual machine this IP would be your virtual machine
’sIP.
The number strings after "ip=" are detailed as below:
The first item, in this example "192.168.1.70" is the target’s temporary IP (please make sure this IP doesn ’ t
conflict with other IPs within the same network);
The second item, in this example "192.168.1.111" is the host ’ s
IP,
The third item, in this example "192.168.1.111" is the target board ’ s gateway
IP,
Page 57
V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210 System
System
System
System System
System
System
System Development
Development
Development
Development manual
manual
manual
manual
www.armdevs.com
www.armdevs.com
www.armdevs.com
www.armdevs.com
57
The fourth item, in this example "255.255.255.0" is the subnet mask,
The fifth item is the board’s machine name (the user can give whatever name he likes)
"eth0" is the network adaptor ’ s name.
This command is so long that it could be easily typed wrong. In this shipped CD, this command has been written
in the "nfs.txt" file for the customer’s convenience. The user can copy it directly. After "enter" these parameters
will be saved in the NAND Flash.
Then type "b" and press "enter" to boot the system via NFS.
Page 58
V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210 System
System
System
System System
System
System
System Development
Development
Development
Development manual
manual
manual
manual
www.armdevs.com
www.armdevs.com
www.armdevs.com
www.armdevs.com
58
5.1.5
5.1.5
5.1.5
5.1.5 Set
Set
Set
Set Up
Up
Up
Up Cross
Cross
Cross
Cross Compile
Compile
Compile
Compile Environment
Environment
Environment
Environment
To
compile kernels, Qtopia/Qt4, bootloader and other programs in Linux you need a a cross compile environment.
We
used arm-linux-gcc-4.5.1 and its by defauly supports armv6 command sets. The following steps will introduce
how to build a compile environment.
Step 1: copy the compressed file "arm-linux-gcc-4.5.1-v6-vfp-20101103.tgz" in the shipped CD into a system ’ s
directory, e.g "tmp\", enter this directory and execute the following commands:
#cd
#cd
#cd
#cd \tmp
\tmp
\tmp
\tmp
#tar
#tar
#tar
#tar xvzf
xvzf
xvzf
xvzf arm-linux-gcc-4.5.1-v6-vfp-20101103.tgz
arm-linux-gcc-4.5.1-v6-vfp-20101103.tgz
arm-linux-gcc-4.5.1-v6-vfp-20101103.tgz
arm-linux-gcc-4.5.1-v6-vfp-20101103.tgz
C
C
C
C /
/
/
/
Note: there is a space after " C " and " C " is a capital letter.
These commands will install "arm-linux-gcc" in the " /opt/FriendlyARM/toolschain/4.5.1
/opt/FriendlyARM/toolschain/4.5.1
/opt/FriendlyARM/toolschain/4.5.1
/opt/FriendlyARM/toolschain/4.5.1 "
Step 2: run the command below to add the compiler
s path to system variables:
#gedit
#gedit
#gedit
#gedit /root/.bashrc
/root/.bashrc
/root/.bashrc
/root/.bashrc
This is to edit the "/root/.bashrc" file. Update the last line with "export
PA TH=$PA TH:/opt/FriendlyARM/toolschain/4.5.1/bin" in the opened file, save and exit the file.
Logout and login the system again (no need to reboot the system, just go to "start"-> "logout"), the above settings
will take into effect. Type "arm-linux-gcc – v", if the messages depicted in the screen shot below appear, it
indicates the compile environment has been set up successfully.
Page 59
V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210 System
System
System
System System
System
System
System Development
Development
Development
Development manual
manual
manual
manual
www.armdevs.com
www.armdevs.com
www.armdevs.com
www.armdevs.com
59
5.2
5.2
5.2
5.2 Uncompress
Uncompress
Uncompress
Uncompress Source
Source
Source
Source Code
Code
Code
Code and
and
and
and Install
Install
Install
Install Application
Application
Application
Application Utilities
Utilities
Utilities
Utilities
This section will introduce how to uncompress all the source code that users may need and install some
application utilities including:
- Linux kernel source code
- Qtopia-2.2.0 source code (for x86 and arm)
- arm-qt-extended-4.4.3 source code (i.e. Qtopia4, for x86 and arm)
- QtE-4.7.0 (for ARM)
- Busybox-1.17 source code
- Sample programs code
- Target file system directory
- File system image maker (for YAFFS2 and UBIFS)
- Linux logo maker: logo_maker
Note: all source code and utilities should be uncompressed and compiled with arm-linux-gcc-4.5.1
5.2.1
5.2.1
5.2.1
5.2.1 Uncompress
Uncompress
Uncompress
Uncompress Source
Source
Source
Source Code
Code
Code
Code
Firstly, create a working directory: /opt/FriendlyARM/tin210/linux
After execute command "mkdir – p /opt/FriendlyARM/tin210/linux", all the source code in the following steps will
be uncompressed in this work directory
(1) Get Linux source code ready
In Fedora9, create a temporary director "/tmp/linux" by running the following command
Page 60
V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210 System
System
System
System System
System
System
System Development
Development
Development
Development manual
manual
manual
manual
www.armdevs.com
www.armdevs.com
www.armdevs.com
www.armdevs.com
60
#mkdir /tmp/linux
Copy all the files in the linux directory in the shipped CD to "/tmp/linux"
(2) Uncompress the Linux kernel source code
In the work directory /opt/FriendlyARM/tin210/linux, run the commands below:
#cd /opt/FriendlyARM/ tin2 10/linux
#tar xvzf /tmp/linux/ linux-2.6.35.7-20111118.tar.gz
A
linux-2.6.35.7 directory will be created, it includes a complete copy of linux kernel source code.
Note: 20111118 is the date when released the new version, the file name in the shipped CD may be different.
( 3 ) Uncompress and Install the target file system
In the work directory /opt/FriendlyARM/tin210/linux, run the commands below:
#cd /opt/FriendlyARM/ tin2 10/linux
#tar xvzf /tmp/linux/ rootfs_qtopia_qt4-20111118.tgz
An rootfs_qtopia_qt4 directory will be created, it includes a complete copy of linux kernel source code.
Note: 20111118 is the date when released the new version, the file name in the shipped CD may be different.
( 4 ) Uncompress and install Qtopia source code
In the work directory /opt/FriendlyARM/tin210/linux, run the commands below:
#cd /opt/FriendlyARM/tiny210/linux
#tar xvzf /tmp/linux/ x86-qtopia-20100420.tar.gz
#tar xvzf /tmp/linux/ arm-qtopia-20101105.tar.gz
An x86-qtopia and an arm-qtopia directory will be created, and their source code will be uncompressed into these
two directories.
Note: in this release, supports for mouse and tp are all included in one package. And the source code for the
embedded browser konquor is included too.
( 5 ) Uncompress and install qt-extended-4.4.3 source code
In the work directory /opt/FriendlyARM/tin210/linux, run the commands below:
#cd /opt/FriendlyARM/ tin2 10/linux
#tar xvzf /tmp/linux/x86-qt-extended-4.4.3-20101003.tgz
#tar xvzf /tmp/linux/arm-qt-extended-4.4.3-20101105.tgz
An x86-qt-extended-4.4.3 and an arm-qt-extended-4.4.3 will be created, and their source code will be
uncompressed into these two directories.
( 6 ) Uncompress and install QtE-4.7.0 source code
Page 61
V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210 System
System
System
System System
System
System
System Development
Development
Development
Development manual
manual
manual
manual
www.armdevs.com
www.armdevs.com
www.armdevs.com
www.armdevs.com
61
In the work directory /opt/FriendlyARM/Tiny210/linux, run the commands below:
#cd /opt/FriendlyARM/ tin2 10/linux
#tar xvzf /tmp/linux/x86-qte-4.6.1-20100516.tar.gz
#tar xvzf /tmp/linux/arm-qte-4.7.0-20101105.tar.gz
An x86-qte-4.6.1 and an arm-qte-4.7.0 will be created, and their source code will be uncompressed into these two
directories.
( 7 ) Uncompress and install busybox source code
The Busybox is a compact Linux tool kit. Here we used busybox-1.13.3. Users can download its latest version
from http://www.busybox.net
In the work directory /opt/FriendlyARM/tin210/linux, run the commands below:
#cd /opt/FriendlyARM/ tin2 10/linux
#tar xvzf /tmp/linux/busybox-1.17.2-20101120.tgz
A
busybox-1.17.2 directory will be created, and its source code will extracted into this directory.
Note: for the sake of users, we have made a default configuration file: fa.config.
( 8 ) Uncompress and install Linux sample programs
In the work directory /opt/FriendlyARM/mini6410/linux, run the commands below:
#cd /opt/FriendlyARM/ tin2 10/linux
#tar xvzf /tmp/linux/ examples-mini210-20111118.tgz
An examples directory will be created, all the source code will be extracted into this directory.
5.2.2
5.2.2
5.2.2
5.2.2 Create
Create
Create
Create T arget
Target
Target
Target File
File
File
File System
System
System
System
run the commands below:
#cd /opt/FriendlyARM/tiny210/linux
#tar xvzf /tmp/linux/ rootfs_qtopia_qt4-20111118.tgz
Note: 20111118 is the date when released the new version, the file name in the shipped CD may be different. The
file system includes qtopia-2.2.0, Qtopia4 and QtE-4.7.0, busybox and some command line utilities. It has the
following excellent features:
- auto detection of NFS reboot or local reboot
- auto detection of touch screen and launching the calibration utility if necessary. If no touch screen is connected
system will enable the mouse.
- auto detection of common or high speed SD cards (up to maximum memory of 32G) and flash drives
- auto detection of USB mouse or touch screen
Page 62
V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210 System
System
System
System System
System
System
System Development
Development
Development
Development manual
manual
manual
manual
www.armdevs.com
www.armdevs.com
www.armdevs.com
www.armdevs.com
62
- support co-existence of a USB mouse and a touch screen
5.2.3
5.2.3
5.2.3
5.2.3 Install
Install
Install
Install Target
Target
Target
Target File
File
File
File System
System
System
System
To
burn a target file system to the board you need to make the file system an image first.
We
offered one tool that
can be used to make file images:mkyaffs2image-128M .
mkyaffs2image-128M is for SLC Nand Flash to make yaffs2 iamges and don ’ t apply to MLC2 Nand Flash. The generated image file ’ s structure is "1 Page= 2K Byte 1 Block=128K" for SLC Nand Flash(such as Samsung
s
K9F2G08 k9K8G08).
Copy mktools-YYYYMMDD.tar.gz file in Android directory to the Fedora/tmp directory,then execute the
following command to install mktools tool chain:
#tar
#tar
#tar
#tar xvzf
xvzf
xvzf
xvzf /tmp/mktools-YYYYMMDD.tar.gz
/tmp/mktools-YYYYMMDD.tar.gz
/tmp/mktools-YYYYMMDD.tar.gz
/tmp/mktools-YYYYMMDD.tar.gz
C
C
C
C /
/
/
/
(Notice:
(Notice:
(Notice:
(Notice: YYYYMMDD
YYYYMMDD
YYYYMMDD
YYYYMMDD is
is
is
is the
the
the
the actual
actual
actual
actual date)
date)
date)
date)
This will create those tools in the "/usr/sbin" directory.
Note: "C" is capitalized following a space and "C" means "change". If your system has been installed a Mini2440
or Mini6410
s mkyaffs2image it will be overwritten. But you don ’ t need to worry about it since they are identical
5.2.4
5.2.4
5.2.4
5.2.4 Install
Install
Install
Install LogoMaker
LogoMaker
LogoMaker
LogoMaker
LogoMaker is a tool for making linux logos. There are many resources describing how to convert image files such
as bmp, jpg, png and so on to linux logos using command line tools.
We
created this graphic version which is
based on Fedora9.
Execute the command below:
# tar
tar
tar
tar xvzf
xvzf
xvzf
xvzf /tmp/linux/logomaker.tgz
/tmp/linux/logomaker.tgz
/tmp/linux/logomaker.tgz
/tmp/linux/logomaker.tgz
C
C
C
C /
Note: "C" is capitalized and means "change".
After executing the above commands, LogoMaker will be installed in the /usr/sbin directory. It only has one file.
After installing it, type "logomake" in a command line window, you will see the following screenshot
Page 63
V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210 System
System
System
System System
System
System
System Development
Development
Development
Development manual
manual
manual
manual
www.armdevs.com
www.armdevs.com
www.armdevs.com
www.armdevs.com
63
5.3
5.3
5.3
5.3 Configure
Configure
Configure
Configure and
and
and
and Compile
Compile
Compile
Compile Kernel
Kernel
Kernel
Kernel
5.3.1
5.3.1
5.3.1
5.3.1 Configure
Configure
Configure
Configure and
and
and
and Compile
Compile
Compile
Compile Kernel
Kernel
Kernel
Kernel
Linux kernel and Android kernel is using the same source code except the configuration.
To
compile a kernel
please follow the steps below:
#cd
#cd
#cd
#cd /opt/FriendlyARM/tiny210/android/
/opt/FriendlyARM/tiny210/android/
/opt/FriendlyARM/tiny210/android/
/opt/FriendlyARM/tiny210/android/ linux-2.6.35.7
linux-2.6.35.7
linux-2.6.35.7
linux-2.6.35.7
#cp
#cp
#cp
#cp mini210_linux_defconfig
mini210_linux_defconfig
mini210_linux_defconfig
mini210_linux_defconfig .config
.config
.config
.config ;
;
;
;
You
can execute make menuconfig to modify the configuration.then output make to compile
#make
#make
#make
#make
After the compilation is done, an image file zImage will be generate under "arch/arm/boot". . Copy the zImage to
the images/Linux in SD card to replace of the old zImage to burn it Tiny210
5.3.2
5.3.2
5.3.2
5.3.2 Location
Location
Location
Location of
of
of
of the
the
the
the Driver
Driver
Driver
Driver
No. Ddevice: or others Location of the Driver corresponding Remark
Page 64
V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210 System
System
System
System System
System
System
System Development
Development
Development
Development manual
manual
manual
manual
www.armdevs.com
www.armdevs.com
www.armdevs.com
www.armdevs.com
64
source code in the kernel Device name on the
board
1
Yaffs
file system Linux-2.6.35.7/fs/yaffs2
2
LCD FrameBuffer Linux-2.6.35.7/drivers/video
/samsung
/dev/fb0
3
Serial port(includes 4
serial ports)
Linux-2.6.35.7/drivers/serial
/samsung.c
/dev/ttySAC0,1,2,3 Tiny210
comes with
4 serial
ports
4
NIC driver Linux-2.6.35.7/drivers/net/d
m9000.c
5
Audio driver(ALSA
interface)
Linux-2.6.35.7/sound/soc/s5
pv2xx
6
One wire touch
driver
Linux-2.6.35.7/drivers/input
/touchscreen/Mini210_1wir
e_host.c
/dev/touchscreen-1wi
re
7
SD driver Linux-2.6.35.7/drivers/mmc
/host/sdhci-s3c.c
/dev/mmcblk0 Support
High-speed
SD
card,upto
32G
8
RTC driver Linux-2.6.35.7/drivers/rtc/rt
c-s3c.c
/dev/rtc
9
Watchdog driver Linux-2.6.35.7/drivers/watc
hdog/s3c2410_wdt.c
/dev/watchdog
10
LED driver Linux-2.6.35.7/drivers/char/
mini210_leds.c
/dev/leds
11
Button driver Linux-2.6.35.7/drivers/char/
mini210_buttons.c
/dev/buttons
12
PWM Control buzzer Linux-2.6.35.7/drivers/char/
mini210_pwm.c
/dev/pwm
13
ADC driver Linux-2.6.35.7/drivers/char/
mini210_adc.c
/dev/adc
14
LCD backlight driver Linux-2.6.35.7/drivers/input
/touchscreen/mini210_1wire
_host.c
/dev/backlight-1wire
15
I2C-EEPROM driver Linux-2.6.35.7/drivers/i2c/b
usses/i2c-s3c2410.c
/dev/i2c/0
16
USB camera Linux-2.6.35.7/drivers/medi
a/video/gspca
/dev/video0
17
USB wireless LAN Linux-2.6.35.7/drivers/net/w
ireless
18
SD WiFi driver Linux-2.6.35.7/drivers/net/w
ireless/libertas
Page 65
V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210 System
System
System
System System
System
System
System Development
Development
Development
Development manual
manual
manual
manual
www.armdevs.com
www.armdevs.com
www.armdevs.com
www.armdevs.com
65
19
USB to serial port
driver
Linux-2.6.35.7/drivers/ /dev/ttyUSB0
20
USB mouse and
keyboard, Scanner
Linux-2.6.35.7/drivers/hid/u
sbhid
USB mouse:
/dev/input/mice
USB keyboard:
/dev/input
21 SPI driver Linux-2.6.35.7/drivers/spi/
22
Multimedia driver Linux-2.6.35.7/drivers/medi
a/video/samsung
Includes 2D,3D, Image Flip,
JPEG hard codec, MFC,
camera,
TV,
PP (Post
Processor), the CMM, etc.
23
Nand Flash driver Linux-2.6.35.7/drivers/mtd/
nand
24
Flash ECC check Linux-2.6.35.7/drivers/mtd/
nand/s3c_nand.c
25
USB bluetooth driver Linux-2.6.35.7/drivers/bluet
ooth/
26
3G driver Linux-2.6.35.7/drivers/usb/s
erial
5.4
5.4
5.4
5.4 Configure
Configure
Configure
Configure and
and
and
and Compile
Compile
Compile
Compile Busybox
Busybox
Busybox
Busybox
In general a direct download of busybox from its website may be compiled through and its
configurations need to be modified.
We
made one for users: fa.config. Both our 2440 and
6410 systems use this file. Please follow the steps below to install.
Enter the busybox directory:
#cp
#cp
#cp
#cp fa.config
fa.config
fa.config
fa.config .config
.config
.config
.config
#make
#make
#make
#make
A
moment later an object file of busybox will be generated, which is identical to the one
preinstalled in the system
Page 66
V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210 System
System
System
System System
System
System
System Development
Development
Development
Development manual
manual
manual
manual
www.armdevs.com
www.armdevs.com
www.armdevs.com
www.armdevs.com
66
5.5
5.5
5.5
5.5 Make
Make
Make
Make YAFFS2
YAFFS2
YAFFS2
YAFFS2 Image
Image
Image
Image
Enter "/opt/FriendlyARM/tiny210/linux" and execute the following command:
#cd
#cd
#cd
#cd /opt/FriendlyARM/mini210/linux/
/opt/FriendlyARM/mini210/linux/
/opt/FriendlyARM/mini210/linux/
/opt/FriendlyARM/mini210/linux/
#mkyaffs2image-128M
#mkyaffs2image-128M
#mkyaffs2image-128M
#mkyaffs2image-128M rootfs_qtopia_qt4
rootfs_qtopia_qt4
rootfs_qtopia_qt4
rootfs_qtopia_qt4 rootfs_qtopia_qt4.img
rootfs_qtopia_qt4.img
rootfs_qtopia_qt4.img
rootfs_qtopia_qt4.img
This will compress the whole "rootfs_qtopia_qt4" into a yaffs2 rootfs_qtopia_qt4.img file. It is the same as the one in "/images/Linux/" in SD card. Download it to your board s
NAND Flash.
Note: mkyaffs2image-128M is only for SLC Nand Flash to make yaffs2 imges and don't apply to
MLC2 Nand Flash.
5.6
5.6
5.6
5.6 Sample
Sample
Sample
Sample Linux
Linux
Linux
Linux Programs
Programs
Programs
Programs
This section lists some sample Linux programs for users reference.
You
can find those programs under "/opt/FriendlyARM/tiny210/examples".All the
following programs are compiled with arm-linux-gcc-4.5.1-v6-vfp.
We
don t guarantee they
can be compiled and run with other corss compilers.
Page 67
V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210 System
System
System
System System
System
System
System Development
Development
Development
Development manual
manual
manual
manual
www.armdevs.com
www.armdevs.com
www.armdevs.com
www.armdevs.com
67
5.6.1
5.6.1
5.6.1
5.6.1 "Hello,
"Hello,
"Hello,
"Hello, World"
World"
World"
World"
Create hello.c file under /tmp/ directory, its contents are as follows:
#include <stdio.h>
int main(void) {
printf("hello, World!\n");
}
Step1: Compile Hello,W orld
Enter the directory where the source code is located and execute "make":
#cd
#cd
#cd
#cd /tmp/
/tmp/
/tmp/
/tmp/
#arm-linux-gcc
#arm-linux-gcc
#arm-linux-gcc
#arm-linux-gcc hello.c
hello.c
hello.c
hello.c
o
o
o
o hello
hello
hello
hello
A
"hello" executable file will be generated and you can check whether it is for ARM by
commanding "file". Executable file running on development board output:
hello: ELF 32-bit LSB executable, ARM, version 1 (SYSV), dynamically linked
(uses shared libs), for GNU/Linux 2.6.14, not stripped
Step2: Download "Hello,World" to Board
You
can download your executable to the board in any of the following ways:
- FTP file transfer (recommended)
- Copy to a media (such as flash drives)
- File transfer via serial port
- Run via NFS
Page 68
V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210 System
System
System
System System
System
System
System Development
Development
Development
Development manual
manual
manual
manual
www.armdevs.com
www.armdevs.com
www.armdevs.com
www.armdevs.com
68
(1) FTP File Transfer
Note: login your board via
FTP,
transfer your executable to it and change its file property to
executable.
First, execute your commands in PC
Go to your board and execute the following commands:
(2) Copy to Flash Drive
Page 69
V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210 System
System
System
System System
System
System
System Development
Development
Development
Development manual
manual
manual
manual
www.armdevs.com
www.armdevs.com
www.armdevs.com
www.armdevs.com
69
Note: copy your executable to a flash drive, mount it to your board and copy the file to
"/bin"
1. Copy to Flash Drive
Connect your flash drive to your PC and execute the following commands
#mount
#mount
#mount
#mount /dev/sda1
/dev/sda1
/dev/sda1
/dev/sda1 /mnt
/mnt
/mnt
/mnt ;
;
;
; mount
mount
mount
mount your
your
your
your drive
drive
drive
drive
#cp
#cp
#cp
#cp hello
hello
hello
hello /mnt
/mnt
/mnt
/mnt ;
;
;
; copy
copy
copy
copy your
your
your
your file
file
file
file to
to
to
to the
the
the
the drive
drive
drive
drive
#umount
#umount
#umount
#umount /mnt
/mnt
/mnt
/mnt ;
;
;
; unmount
unmount
unmount
unmount your
your
your
your drive
drive
drive
drive
2. Copy to Board Insert your drive to your board s USB host, it will be automatically mounted under
"/udisk". Please execute the following command
#cd
#cd
#cd
#cd /udisk
/udisk
/udisk
/udisk
#./hello
#./hello
#./hello
#./hello execute
execute
execute
execute "hello"
"hello"
"hello"
"hello"
Note: if you take out your drive directly you need to go back to the root directory and
execute "umount /udisk" for the next mount
(3) File Transfer via Serial Port
Download your file to the board via serial port and change its property to executable
#chmod
#chmod
#chmod
#chmod +x
+x
+x
+x hello
hello
hello
hello
Note: some users do this via a USB to Serial connector. This may not be successful due to
the connector's quality issues therefore we recommend file transfer via FTP
Page 70
V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210 System
System
System
System System
System
System
System Development
Development
Development
Development manual
manual
manual
manual
www.armdevs.com
www.armdevs.com
www.armdevs.com
www.armdevs.com
70
(4) Run via NFS
It is very popular to launch programs via NFS in Linux. This saves download time
especially for large size files. Please set up your NFS server and type the commands below
(in our example the IP was 192.168.1.111): #mount t nfs o nolock
192.168.1.111:/opt/FriendlyARM/tiny210/linux/rootfs_qtopia_qt4 /mnt
If the mounting is successful you can enter "/mnt" to manipulate your files. Please copy
"hello" to "opt/FriendlyARM/tiny210/linux/rootfs_qtopia_qt4" and type the following
commands:
#cd
#cd
#cd
#cd /mnt
/mnt
/mnt
/mnt
#./hello
#./hello
#./hello
#./hello
5.6.2
5.6.2
5.6.2
5.6.2 LED
LED
LED
LED Test
Test
Test
Test Program
Program
Program
Program
The source code of "Hello,World" is under
"/opt/FriendlyARM/mini6410/linux/examples/hello". Its contents are as follows:
Program Description:
Source Code Location /opt/FriendlyARM/tiny210/linux/linux-2.6.35.7/drivers/char
Driver mini210_leds.c
Device Type misc
Device Name /dev/leds
Test Program Source Code
Location
/opt/FriendlyARM/tiny210/linux/examples/leds
Test Program Name led.c
Executable File Name led Test Program s Location in Board
Note: the LED driver has been compiled into the kernel by default and you cannot load it via
insmod
Program:
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/ioctl.h>
int main(int argc, char **argv)
{
int on;
int led_no;
int fd;
/* Check parameters */
Page 71
V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210 System
System
System
System System
System
System
System Development
Development
Development
Development manual
manual
manual
manual
www.armdevs.com
www.armdevs.com
www.armdevs.com
www.armdevs.com
71
if (argc != 3 || sscanf(argv[1], "%d", &led_no) != 1 || sscanf(argv[2],"%d", &on) != 1 ||
on < 0 || on > 1 || led_no < 0 || led_no > 3) {
fprintf(stderr, "Usage: leds led_no 0|1\n");
exit(1);
}
/*Open /dev/leds file*/
fd = open("/dev/leds0", 0);
if (fd < 0) {
fd = open("/dev/leds", 0);
}
if (fd < 0) {
perror("open device leds");
exit(1);
}
/*Manipulate led via ioctl and input parameters */
ioctl(fd, on, led_no);
/*Close device*/
close(fd);
return 0;
}
You
can compile the program, download it and run
5.6.3
5.6.3
5.6.3
5.6.3 User
User
User
User Button
Button
Button
Button Test
Test
Test
Test Program
Program
Program
Program
Program Description:
Source Code Location /opt/FriendlyARM/tiny210/linux/linux-2.6.35.7/drivers/char
Driver mini210_buttons.c
Device Type misc
Device Name /dev/buttons
Test Program Source Code
Location
/opt/FriendlyARM/tiny210/linux/examples/buttons
Test Program Name Buttons_test.c
Executable File Name buttons Test Program s Location in Board
Note: the buttons driver has been compiled into the kernel by default and you cannot load it via
insmod
Program:
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/ioctl.h>
#include <sys/types.h>
Page 72
V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210 System
System
System
System System
System
System
System Development
Development
Development
Development manual
manual
manual
manual
www.armdevs.com
www.armdevs.com
www.armdevs.com
www.armdevs.com
72
#include <sys/stat.h>
#include <fcntl.h>
#include <sys/select.h>
#include <sys/time.h>
#include <errno.h>
int main(void)
{
int buttons_fd;
char buttons[6] = {'0', '0', '0', '0', '0', '0'};
buttons_fd = open("/dev/buttons", 0);
if (buttons_fd < 0) {
perror("open device buttons");
exit(1);
}
for (;;) {
char current_buttons[6];
int count_of_changed_key;
int i;
if (read(buttons_fd, current_buttons,
perror("read buttons:");
exit(1);
}
for (i = 0, count_of_changed_key = 0
if (buttons[i] != current_buttons[i]) {
buttons[i] = current_buttons[i];
printf("%skey %d is %s", count_of_c
count_of_changed_key++;
}
}
if (count_of_changed_key) {
printf("\n");
}
}
close(buttons_fd);
return 0;
}
You
can compile the program, download it and run
5.6.4
5.6.4
5.6.4
5.6.4 PWM
PWM
PWM
PWM Buzzer
Buzzer
Buzzer
Buzzer Program
Program
Program
Program
Program Description:
Page 73
V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210 System
System
System
System System
System
System
System Development
Development
Development
Development manual
manual
manual
manual
www.armdevs.com
www.armdevs.com
www.armdevs.com
www.armdevs.com
73
Source Code Location /opt/FriendlyARM/tiny210/linux/linux-2.6.35.7/drivers/char
Driver Mini210_pwm.c
Device Type misc
Device Name /dev/pwm
Test Program Source Code
Location
/opt/FriendlyARM/tiny210/linux/examples/pwm
Test Program Name pwm_test.c
Executable File Name Pwm_test Test Program s Location in Board
Note: the PWM Buzzer driver has been compiled into the kernel by default and you cannot load it
via insmod
Program:
#include <stdio.h>
#include <termios.h>
#include <unistd.h>
#include <stdlib.h>
#define PWM_IOCTL_SET_FREQ 1
#define PWM_IOCTL_STOP 2
#define ESC_KEY 0x1b
static int getch(void)
{
struct termios oldt,newt;
int ch;
if (!isatty(STDIN_FILENO)) {
fprintf(stderr, "this problem should be run at a terminal\n");
exit(1);
}
// save terminal setting
if(tcgetattr(STDIN_FILEN
perror("save the term
exit(1);
}
// set terminal as need
newt = oldt;
newt.c_lflag &= ~( ICANON
|
ECHO );
if(tcsetattr(STDIN_FILENO,TCSANOW, &newt) <
perror("set terminal");
exit(1);
}
Page 74
V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210 System
System
System
System System
System
System
System Development
Development
Development
Development manual
manual
manual
manual
www.armdevs.com
www.armdevs.com
www.armdevs.com
www.armdevs.com
74
ch = getchar();
// restore termial setting
if(tcsetattr(STDIN_FILENO,TCSANOW,&oldt) < 0
perror("restore the termial setting");
exit(1);
}
return ch;
}
static int fd = -1;
static void close_buzzer(void);
static void open_buzzer(void)
{
fd = open("/dev/pwm", 0);
if (fd < 0) {
perror("open pwm_buzzer device");
exit(1);
}
// any function exit call will stop the buz
atexit(close_buzzer);
}
static void close_buzzer(void)
{
if (fd >= 0) {
ioctl(fd, PWM_IOCTL_STOP);
close(fd);
fd = -1;
}
}
static void set_buzzer_freq(int freq)
{
// this IOCTL command is the key to set frequency
int ret = ioctl(fd, PWM_IOCTL_SET_FREQ, freq);
if(ret < 0) {
perror("set the frequency of the buzzer");
exit(1);
}
}
static void stop_buzzer(void)
Page 75
V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210 System
System
System
System System
System
System
System Development
Development
Development
Development manual
manual
manual
manual
www.armdevs.com
www.armdevs.com
www.armdevs.com
www.armdevs.com
75
{
int ret = ioctl(fd, PWM_IOCTL_STOP);
if(ret < 0) {
perror("stop the buzzer");
exit(1);
}
}
int main(int argc, char **argv)
{
int freq = 1000 ;
open_buzzer();
printf( "\nBUZZER TEST ( PWM Control )\n" );
printf( "Press +/- to increase/reduce the frequency of the BUZZER\
printf( "Press 'ESC' key to Exit this program\n\n" );
while( 1 )
{
int key;
set_buzzer_freq(freq);
printf( "\tFreq = %d\n", freq );
key = getch();
switch(key) {
case '+':
if( freq < 20000 )
freq += 10;
break;
case '-':
if( freq > 11 )
freq -= 10 ;
break;
case ESC_KEY:
case EOF:
stop_buzzer();
exit(0);
default:
Page 76
V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210 System
System
System
System System
System
System
System Development
Development
Development
Development manual
manual
manual
manual
www.armdevs.com
www.armdevs.com
www.armdevs.com
www.armdevs.com
76
break;
}
}
}
You
can compile the program, download it and run
5.6.5
5.6.5
5.6.5
5.6.5 I2C-EEPROM
I2C-EEPROM
I2C-EEPROM
I2C-EEPROM Program
Program
Program
Program
Program Description:
Source Code Location /opt/FriendlyARM/tiny210/linux/linux-2.6.35.7/drivers/i
2c/busses
Driver I2c-s3c2410.c
Device Type Char device
Device Name /dev/i2c/0
Test Program Source Code Location /opt/FriendlyARM/tiny210/linux/examples/i2c
Test Program Name eeprog.c 24cXX.c
Executable file Name i2c Test Program s Location in Board
Note: the I2c driver has been compiled into the kernel by default and you cannot load it via
insmod
Program:
Note: the following program depends on "24cxx.c" in the same directory.
#include <stdio.h>
#include <fcntl.h>
#include <getopt.h>
#include <unistd.h>
#include <stdlib.h>
#include <errno.h>
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
#include "24cXX.h"
#define usage_if(a) do { do_usage_if( a , __LINE__); } while(0);
void do_usage_if(int b, int line)
{
const static char *eeprog_usage =
"I2C-24C08(256 bytes) Read/Write Program, ONLY FOR TEST!\n"
"FriendlyARM Computer Tech. 2009\n";
if(!b)
return;
fprintf(stderr, "%s\n[line %d]\n", eeprog_usage, line);
exit(1);
Page 77
V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210 System
System
System
System System
System
System
System Development
Development
Development
Development manual
manual
manual
manual
www.armdevs.com
www.armdevs.com
www.armdevs.com
www.armdevs.com
77
}
#define die_if(a, msg) do { do_die_if( a , msg, __LINE__); } while(0);
void do_die_if(int b, char* msg, int line)
{
if(!b)
return;
fprintf(stderr, "Error at line %d: %s\n", line, msg);
fprintf(stderr, " sysmsg: %s\n", strerror(errno));
exit(1);
}
static int read_from_eeprom(struct eeprom *e, int addr, int size)
{
int ch, i;
for(i = 0; i < size; ++i, ++addr)
{
die_if((ch = eeprom_read_byte(e, addr)) < 0, "read error");
if( (i % 16) == 0 )
printf("\n %.4x| ", addr);
else if( (i % 8) == 0 )
printf(" ");
printf("%.2x ", ch);
fflush(stdout);
}
fprintf(stderr, "\n\n");
return 0;
}
static int write_to_eeprom(struct eeprom *e, int addr)
{
int i;
for(i=0, addr=0; i<256; i++, addr++)
{
if( (i % 16) == 0 )
printf("\n %.4x| ", addr);
else if( (i % 8) == 0 )
printf(" ");
printf("%.2x ", i);
fflush(stdout);
die_if(eeprom_write_byte(e, addr, i), "write error");
}
Page 78
V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210 System
System
System
System System
System
System
System Development
Development
Development
Development manual
manual
manual
manual
www.armdevs.com
www.armdevs.com
www.armdevs.com
www.armdevs.com
78
fprintf(stderr, "\n\n");
return 0;
}
int main(int argc, char** argv)
{
struct eeprom e;
int op;
op = 0;
usage_if(argc != 2 || argv[1][0] != '-' || argv[1][2] != '\0');
op = argv[1][1];
fprintf(stderr, "Open /dev/i2c/0 with 8bit mode\n");
die_if(eeprom_open("/dev/i2c/0", 0x50, EEPROM_TYPE_8BIT_ADDR, &e) < 0,
"unable to open eeprom device file "
"(check that the file exists and that it's readable)");
switch(op)
{
case 'r':
fprintf(stderr, " Reading 256 bytes from 0x0\n");
read_from_eeprom(&e, 0, 256);
break;
case 'w':
fprintf(stderr, " Writing 0x00-0xff into 24C08 \n");
write_to_eeprom(&e, 0);
break;
default:
usage_if(1);
exit(1);
}
eeprom_close(&e);
return 0;
}
5.6.6
5.6.6
5.6.6
5.6.6 Pipe
Pipe
Pipe
Pipe Programming
Programming
Programming
Programming Manipulating
Manipulating
Manipulating
Manipulating LED
LED
LED
LED from
from
from
from HTML
HTML
HTML
HTML
Program Description:
Source Code Location /opt/FriendlyARM/tiny210/linux/examples/led-player
Driver
Page 79
V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210 System
System
System
System System
System
System
System Development
Development
Development
Development manual
manual
manual
manual
www.armdevs.com
www.armdevs.com
www.armdevs.com
www.armdevs.com
79
Device Type
Device Name
Test Program Source Code Location
Test Program Name led-player.c
Executable file Name led-player Test Program s Location in Board
Program:
#include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <sys/ioctl.h> #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> #include <sys/select.h > #include <sys/time.h> #include <string.h> static int led_fd; static int type = 1; static void push_leds(void) { static unsigned step; unsigned led_bitmap; int i; switch(type) { case 0: if (step >= 6) { step = 0; } if (step < 3) { led_bitmap = 1 << step; } else { led_bitmap = 1 << (6 - step); } break; case 1: if (step > 255) { step = 0; } led_bitmap = step; break; default: led_bitmap = 0;
Page 80
V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210 System
System
System
System System
System
System
System Development
Development
Development
Development manual
manual
manual
manual
www.armdevs.com
www.armdevs.com
www.armdevs.com
www.armdevs.com
80
} step++; for (i = 0; i < 4; i++) { ioctl(led_fd, led_bitmap & 1, i); led_bitmap >>= 1; } } int main(void) { int led_control_pipe; int null_writer_fd; // for read endpoint not blocking when control process exit double period = 0.5; led_fd = open("/dev/leds0", 0); if (led_fd < 0) { led_fd = open("/dev/leds", 0); } if (led_fd < 0) { perror("open device leds"); exit(1); } unlink("/tmp/led-control"); mkfifo("/tmp/led-control", 0666); led_control_pipe = open("/tmp/led-control", O_RDONLY
|
O_NONBLOCK); if (led_control_pipe < 0) { perror("open control pipe for read"); exit(1); } null_writer_fd = open("/tmp/led-control", O_WRONLY
|
O_NONBLOCK); if (null_writer_fd < 0) { perror("open control pipe for write"); exit(1); } for (;;) { fd_set rds; struct timeval step; int ret; FD_ZERO(&rds); FD_SET(led_control_pipe, &rds); step.tv_sec = period; step.tv_usec = (period - step.tv_sec) * 1000000L; ret = select(led_control_pipe + 1, &rds, NULL, NULL, &step); if (ret < 0) { perror("select"); exit(1);
Page 81
V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210 System
System
System
System System
System
System
System Development
Development
Development
Development manual
manual
manual
manual
www.armdevs.com
www.armdevs.com
www.armdevs.com
www.armdevs.com
81
} if (ret == 0) { push_leds(); } else if (FD_ISSET(led_control_pipe, &rds)) { static char buffer[200]; for (;;) { char c; int len = strlen(buffer); if (len >= sizeof buffer - 1) { memset(buffer, 0, sizeof buffer); break; } if (read(led_control_pipe, &c, 1) != 1) { break; } if (c == '\r') { continue; } if (c == '\n') { int tmp_type; double tmp_period; if (sscanf(buffer,"%d%lf", &tmp_type, &tmp_period) == 2) { type = tmp_type; period = tmp_period; } fprintf(stderr, "type is %d, period is %lf\n", type, period); memset(buffer, 0, sizeof buffer); break; } buffer[len] = c; } } } close(led_fd); return 0; }
"make" will generate a led-player executable which is run as a server under "/sbin". The leds.cgi gateway source
code is under "/www/leds.cgi" on the board. It is a shell script and can be invoked by leds.html as an action. Here
is the shell file
Page 82
V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210 System
System
System
System System
System
System
System Development
Development
Development
Development manual
manual
manual
manual
www.armdevs.com
www.armdevs.com
www.armdevs.com
www.armdevs.com
82
#!/bin/sh
type=0 period=1
case $QUERY_STRING in
*ping*)
type=0 ;;
*counter*)
type=1 ;;
*stop*)
type=2 ;;
esac
case $QUERY_STRING in
*slow*)
period=0.25 ;;
*normal*)
period=0.125 ;;
*fast*)
period=0.0625 ;;
esac
/bin/echo $type $period > /tmp/led-control
echo "Content-type: text/html; charset=gb2312" echo /bin/cat led-result.template
exit 0
5.7
5.7
5.7
5.7 Compile
Compile
Compile
Compile Qtopia-2.2.0
Qtopia-2.2.0
Qtopia-2.2.0
Qtopia-2.2.0
To
make it easy for users we compile all the steps into one build script. Executing this script will compile
thewhole qtopia platform and its utilities.
You
can start them by commanding "run". The compiling scripts for x86
and arm are a little bit different.
Page 83
V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210 System
System
System
System System
System
System
System Development
Development
Development
Development manual
manual
manual
manual
www.armdevs.com
www.armdevs.com
www.armdevs.com
www.armdevs.com
83
5.7.1
5.7.1
5.7.1
5.7.1 Uncompress
Uncompress
Uncompress
Uncompress and
and
and
and Install
Install
Install
Install Source
Source
Source
Source Code
Code
Code
Code
Please refer to Section 5.5.1
5.7.2Compile
5.7.2Compile
5.7.2Compile
5.7.2Compile and
and
and
and Run
Run
Run
Run Qtopia-2.2.0
Qtopia-2.2.0
Qtopia-2.2.0
Qtopia-2.2.0 for
for
for
for x86
x86
x86
x86
All our programs have been verified on Fedora9.
We
didn ’ t try them on other platforms.
We
strongly recommend
our users to use Fedora9 and download it from
ftp://download.fedora.redhat.com/pub/fedora/linux/releases/9/Fedora/i386/iso/Fedora-9-i386-DVD.iso.
Enter the working directory and run the following command
# cd
cd
cd
cd /opt/FriendlyARM/
/opt/FriendlyARM/
/opt/FriendlyARM/
/opt/FriendlyARM/ tiny210
tiny210
tiny210
tiny210 /linux/x86-qtopia
/linux/x86-qtopia
/linux/x86-qtopia
/linux/x86-qtopia
# ./build-all
./build-all
./build-all
./build-all (this process takes about 30 minutes)
Note: ./build-all will automatically compile the complete Qtopia and its embedded web
browser.
You
can execute "./build" first and then "./build-konq" to compile them separately.
To
run your qtopia you can type the
command below:
#./ run
run
run
run
You
will see the following screen
Page 84
V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210 System
System
System
System System
System
System
System Development
Development
Development
Development manual
manual
manual
manual
www.armdevs.com
www.armdevs.com
www.armdevs.com
www.armdevs.com
84
Follow the default options to continue and you will see the following screen
5.7.3
5.7.3
5.7.3
5.7.3 Compile
Compile
Compile
Compile and
and
and
and Run
Run
Run
Run Qtopia-2.2.0
Qtopia-2.2.0
Qtopia-2.2.0
Qtopia-2.2.0 for
for
for
for ARM
ARM
ARM
ARM
Please make sure your compiler is arm-linux-gcc-4.4.1 and platform is Fedora 9. Enter the working directory and
type the command below
Page 85
V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210 System
System
System
System System
System
System
System Development
Development
Development
Development manual
manual
manual
manual
www.armdevs.com
www.armdevs.com
www.armdevs.com
www.armdevs.com
85
# cd
cd
cd
cd /opt/FriendlyARM/
/opt/FriendlyARM/
/opt/FriendlyARM/
/opt/FriendlyARM/ tiny210
tiny210
tiny210
tiny210 /linux/arm-qtopia
/linux/arm-qtopia
/linux/arm-qtopia
/linux/arm-qtopia
# ./build-all
./build-all
./build-all
./build-all (this process takes about 30 minutes)
#./mktarget
#./mktarget
#./mktarget
#./mktarget (this makes a file system image and will generate "target-qtopia-konq.tgz")
Note: "./build-all" will automatically compile a complete Qtopia system and the web browser and generate Jpeg,
GIF, PNG image files.
You
can execute "./build" first and then "./build-konq" to compile them separately.
To
remove your old Qtopia system you just need to delete all the files under "/opt". Then you can uncompress
your target-qtopia-konq.tgz to the board ’ s root directory via a flash drive. In our example we had it under
/home/plg. Please run the command below:
# tar
tar
tar
tar xvzf
xvzf
xvzf
xvzf /home/plg/target-qtopia-konq.tgz
/home/plg/target-qtopia-konq.tgz
/home/plg/target-qtopia-konq.tgz
/home/plg/target-qtopia-konq.tgz
C
C
C
C /
"C" means "Change" and "/" after "C" means it will be uncompressed to the root directory. Afteryouare done,
reboot your board and you will see that all your GUI components are in English now and there is a browser under
the "FriendlyARM" tag. This is your own Qtopia.
Note: your new system may load parameters from "/etc/pointercal", you can delete that file too and will be
directed to the calibration screen after reboot.
Page 86
V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210 System
System
System
System System
System
System
System Development
Development
Development
Development manual
manual
manual
manual
www.armdevs.com
www.armdevs.com
www.armdevs.com
www.armdevs.com
86
The above procedure is a simplied one.
We
hide all technical details in the build-all script you can look into it for
more details
5.8
5.8
5.8
5.8 Compile
Compile
Compile
Compile QtE-4.7.0
QtE-4.7.0
QtE-4.7.0
QtE-4.7.0
5.8.1
5.8.1
5.8.1
5.8.1 Uncompress
Uncompress
Uncompress
Uncompress and
and
and
and Install
Install
Install
Install Source
Source
Source
Source Code
Code
Code
Code
Please refer to section 5.5.1
5.8.2
5.8.2
5.8.2
5.8.2 Compile
Compile
Compile
Compile and
and
and
and Run
Run
Run
Run QtE-4.7.0
QtE-4.7.0
QtE-4.7.0
QtE-4.7.0 for
for
for
for ARM
ARM
ARM
ARM
Note: please use our arm-linux-gcc-4.5.1 and Fedora9 to compile.
We
offered a build-all script for users to easily
compile QtE-4.7.0. Please enter the source code directory and type the following command:
# cd
cd
cd
cd /opt/FriendlyARM/
/opt/FriendlyARM/
/opt/FriendlyARM/
/opt/FriendlyARM/ tiny210
tiny210
tiny210
tiny210 /linux/arm-qte-4.7.0
/linux/arm-qte-4.7.0
/linux/arm-qte-4.7.0
/linux/arm-qte-4.7.0
# ./build-all
./build-all
./build-all
./build-all
The build process takes a while. And after it is done, please run the mktarget script and a target-qte-4.7.0.tgz will
be generated. Please follow the command below:
# tar
tar
tar
tar xvzf
xvzf
xvzf
xvzf target-qte-4.7.0.tgz
target-qte-4.7.0.tgz
target-qte-4.7.0.tgz
target-qte-4.7.0.tgz
C
C
C
C /
A
Trolltech directory will be generated under "/usr/local/", which includes all needed libraries and executables.
Since our shipped Linux already includes QtE-4.7.0, to test your build you can delete the one on your board by
"rm" the whole "/usr/local/Trolltech" directory.
Before running QtE-4..6.3, please stop the current running Qtopia-2.2.0. Go to "Settings" -> "Shutdown" and you
will see the following screen. Click on "Terminate Server" to shut down Qtopia-2.2.0.
Page 87
V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210 System
System
System
System System
System
System
System Development
Development
Development
Development manual
manual
manual
manual
www.armdevs.com
www.armdevs.com
www.armdevs.com
www.armdevs.com
87
Or you can shut it down: either by commenting out the qtopia option in the init script "/etc/init.d/rcS" and
rebooting the system or commanding "kill all" to terminate related process (there are many options: you can even
delete the whole "/opt", shut down qtopia-2.2.0 and run "qt4"
5.9
5.9
5.9
5.9 Compile
Compile
Compile
Compile Qtopia4(Qt-Extended-4.4.3)
Qtopia4(Qt-Extended-4.4.3)
Qtopia4(Qt-Extended-4.4.3)
Qtopia4(Qt-Extended-4.4.3)
5.9.1
5.9.1
5.9.1
5.9.1 Uncompress
Uncompress
Uncompress
Uncompress and
and
and
and Install
Install
Install
Install Source
Source
Source
Source Code
Code
Code
Code
Please refer to section 5.5.1
5.9.2
5.9.2
5.9.2
5.9.2 Compile
Compile
Compile
Compile and
and
and
and Run
Run
Run
Run Qt-Extened-4.4.3
Qt-Extened-4.4.3
Qt-Extened-4.4.3
Qt-Extened-4.4.3 for
for
for
for x86
x86
x86
x86
Note: please use our arm-linux-gcc-4.5.1 and Fedora9 to compile.
We
offered a build-all script for users to easily
compile Qt-Extened-4.4.3. Please enter the source code directory and type the following command:
Page 88
V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210 System
System
System
System System
System
System
System Development
Development
Development
Development manual
manual
manual
manual
www.armdevs.com
www.armdevs.com
www.armdevs.com
www.armdevs.com
88
# cd
cd
cd
cd /opt/FriendlyARM/mini6410/linux/x86-qt-extended-4.4.3
/opt/FriendlyARM/mini6410/linux/x86-qt-extended-4.4.3
/opt/FriendlyARM/mini6410/linux/x86-qt-extended-4.4.3
/opt/FriendlyARM/mini6410/linux/x86-qt-extended-4.4.3
# ./build-all
./build-all
./build-all
./build-all
The build process takes a while.Torun your compiled system please type the command below:
# ./run
./run
./run
./run
Now you will see the following screen:
5.9.3
5.9.3
5.9.3
5.9.3 Compile
Compile
Compile
Compile and
and
and
and Run
Run
Run
Run Qt-Extened-4.4.3
Qt-Extened-4.4.3
Qt-Extened-4.4.3
Qt-Extened-4.4.3 for
for
for
for ARM
ARM
ARM
ARM
Note: please use our arm-linux-gcc-4.5.1 and Fedora9 to compile.
We
offered a build-all script for users to easily
compile Qt-Extened-4.4.3. Please enter the source code directory and type the following command:
# cd
cd
cd
cd /opt/FriendlyARM/
/opt/FriendlyARM/
/opt/FriendlyARM/
/opt/FriendlyARM/ tiny210
tiny210
tiny210
tiny210 /linux/arm-qt-extended-4.4.3
/linux/arm-qt-extended-4.4.3
/linux/arm-qt-extended-4.4.3
/linux/arm-qt-extended-4.4.3
# ./build-all
./build-all
./build-all
./build-all
The build process takes a while.Torun your compiled system please type the command below:
#./ run
run
run
run
And after it is done, please run the mktarget script and a target-qtopia4.tgz will be generated. Please follow the
command below:
# tar
tar
tar
tar xvzf
xvzf
xvzf
xvzf target-qtopia4.tgz
target-qtopia4.tgz
target-qtopia4.tgz
target-qtopia4.tgz
C
C
C
C /
Page 89
V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210 System
System
System
System System
System
System
System Development
Development
Development
Development manual
manual
manual
manual
www.armdevs.com
www.armdevs.com
www.armdevs.com
www.armdevs.com
89
A
Qtopia4.4.3 directory will be generated under "/opt", which includes all needed libraries and executables. Since
our shipped Linux already includes QtE-4.7.0, to test your build you can delete the one on your board by "rm" the
whole "/opt/Qtopia4.4.3" directory.
Before running Qtopia4, please stop the current running Qtopia-2.2.0. Go to "Settings" -> "Shutdown" and you
will see the following screen. Click on "Terminate Server" to shut down Qtopia-2.2.0.
Or you can shut it down: either by commenting out the qtopia option in the init script "/etc/init.d/rcS" and
rebooting the system or commanding "kill all" to terminate related process (there are many options: you can even
delete the whole "/opt", shut down qtopia-2.2.0 and run "qtopia4 &"
Page 90
V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210 System
System
System
System System
System
System
System Development
Development
Development
Development manual
manual
manual
manual
www.armdevs.com
www.armdevs.com
www.armdevs.com
www.armdevs.com
90
Chapter
Chapter
Chapter
Chapter 6
6
6
6 WinCE
WinCE
WinCE
WinCE
6.1
6.1
6.1
6.1 set
set
set
set up
up
up
up WinCE
WinCE
WinCE
WinCE 6
6
6
6 Development
Development
Development
Development Environment
Environment
Environment
Environment
NOTE: The 6410 platform WinCE development environment can not coexist with 210
development environment .I f your Windows development platform have installed 6410 development environment before the installation of Tiny210 the
BSP,
please delete the following directory: C: \ WINCE600 \ PLATFORM \ COMMON \ SRC \ SOC \ S3C6410_SEC_V1 (For other drive WINCE600 ,please modify its drive number ) BSP development for both platforms must be on the same machine , please use WMWare virtual machine.
Note: the following softare and installation steps are based on Windows 7 (flagship version).
We
recommend users
to copy the installation software to your hard disk to install
Installation of Windows CE 6.0 is complicated and has lots of requirements for hardware therefore we strongly
suggest users exactly follow our installation steps:
Below are the basic system requirements
CPU: Intel Core Duo E8400
RAM: DDR2 4GB
Hard Disk: 500GB
Software List (We don ’ t offer Windows Embedded 6.0 CE 6 installation files and users may need to download its
trial version from Microsoft ’ s website):
ü Visual Studio 2005
(trial version download website:
http://download.microsoft.com/download/e/1/4/e1405d9e-47e3-404c-8b09-489437b27fb0/En_vs_2005_Pro_90_T
rial.img )
Page 91
V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210 System
System
System
System System
System
System
System Development
Development
Development
Development manual
manual
manual
manual
www.armdevs.com
www.armdevs.com
www.armdevs.com
www.armdevs.com
91
ü Visual Studio 2005 Service Pack 1(file name: VS80sp1-KB926601-X86-ENU.exe)
Download website:
http://www.microsoft.com/downloads/details.aspx?familyid=bb4a75ab-e2d4-4c96-b39d-37baf6b5b1dc&displayla
ng=en ü Visual Studio 2005 Service Pack 1 Update for Windows Vista ( 文件名 VS80sp1-KB932232-X86-ENU.exe)
Download website:
http://www.microsoft.com/downloads/details.aspx?FamilyID=90E2942D-3AD1-4873-A2EE-4ACC0AACE5B6&
displaylang=en)
ü Visual Studio 2005 Service Pack 1
ATL
Security Update (VS80sp1-KB971090-X86-INTL.exe)
Download website:
http://www.microsoft.com/downloads/details.aspx?familyid=7C8729DC-06A2-4538-A90D-FF9464DC0197&dis
playlang=en
ü Windows Embedded CE 6.0
Trial version download website:
http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=7e286847-6e06-4a0c-8cac-ca7d4c
09cb56
ü Windows Embedded CE 6.0 Platform Builder Service Pack 1
Download website:
http://www.microsoft.com/downloads/details.aspx?FamilyId=BF0DC0E3-8575-4860-A8E3-290ADF242678&dis
playlang=en
ü Windows Embedded CE 6.0 R2
Download website:
http://www.microsoft.com/downloads/details.aspx?FamilyId=F41FC7C1-F0F4-4FD6-9366-B61E0AB59565&dis
playlang=en
ü Windows Embedded CE 6.0 R3
Download website:
http://www.microsoft.com/downloads/details.aspx?FamilyID=BC247D88-DDB6-4D4A-A595-8EEE3556FE46&a
mp;displaylang=ja&displaylang=en
ü Tencent QQ (third part software)
Download website:
http://www.microsoft.com/downloads/details.aspx?FamilyID=527042f7-bb5b-4831-a6ad-5081808824ec&displayl
ang=en
ü WesttekFileViewers6.exe(office file manager, third part software)
Download website:
http://www.microsoft.com/downloads/details.aspx?FamilyID=d2fd14eb-7d5c-428b-951c-343f910047c1&displayl
ang=en
The above list also indicates the order of installing these software components:Visual Studio 2005and its patches
first, then Windows CE 6.0 and its patches and finally the third party software
Note: the Platform Builder for Windows CE 6.0 is different from its previous versions such as Windows CE
5.0/4.2. It is not a standalone software application but a plugin of VS2005 and therefore depends on VS2005.
You
need to install VS2005 first. All the configurations and compilation described below are with VS2005.
Here are the steps:
Page 92
V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210 System
System
System
System System
System
System
System Development
Development
Development
Development manual
manual
manual
manual
www.armdevs.com
www.armdevs.com
www.armdevs.com
www.armdevs.com
92
6.1.1
6.1.1
6.1.1
6.1.1 Install
Install
Install
Install Visual
Visual
Visual
Visual Studio
Studio
Studio
Studio 2005
2005
2005
2005 and
and
and
and Patches
Patches
Patches
Patches
Step1 enter the Visual Studio 2005 directory and double click on “ setup.exe
Step2 click on “ Install Visual Studio 2005 to continue
Page 93
V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210 System
System
System
System System
System
System
System Development
Development
Development
Development manual
manual
manual
manual
www.armdevs.com
www.armdevs.com
www.armdevs.com
www.armdevs.com
93
Step3 click on “ Next to continue
Step4: check the redly marked box and enter your serial number, click on “ Next to continue
Page 94
V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210 System
System
System
System System
System
System
System Development
Development
Development
Development manual
manual
manual
manual
www.armdevs.com
www.armdevs.com
www.armdevs.com
www.armdevs.com
94
Step5: select your installation features, please check “ Full and click on “ Next to continue
Step6: the following screen kicks off the installation of Visual Studio 2005
Page 95
V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210 System
System
System
System System
System
System
System Development
Development
Development
Development manual
manual
manual
manual
www.armdevs.com
www.armdevs.com
www.armdevs.com
www.armdevs.com
95
Step7: after Visual Studio 2005 installation is done please click on “ Finish on the dialog shown below
Click on “ Exit on the dialog shown below
Page 96
V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210 System
System
System
System System
System
System
System Development
Development
Development
Development manual
manual
manual
manual
www.armdevs.com
www.armdevs.com
www.armdevs.com
www.armdevs.com
96
Step8: now we will begin to install “ Visual Studio 2005 Service Pack 1 ” . Double click on
“ VS80sp1-KB926601-X86-ENU.exe to begin installation
Step9: click on “ OK on the following dialog
Page 97
V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210 System
System
System
System System
System
System
System Development
Development
Development
Development manual
manual
manual
manual
www.armdevs.com
www.armdevs.com
www.armdevs.com
www.armdevs.com
97
Step10: click on “ I accept on the license dialog
Step11: the following dialog kicks off the installation. The whole process may take a while.
Step12: after installation is done click on “ OK on the following dialog
Step13: now we will begin to install the second patch “ Visual Studio 2005 Service Pack 1 Update for Windows
Page 98
V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210 System
System
System
System System
System
System
System Development
Development
Development
Development manual
manual
manual
manual
www.armdevs.com
www.armdevs.com
www.armdevs.com
www.armdevs.com
98
Vista ” . Double click on “ VS80sp1-KB932232-X86-ENU.exe
Step14: click on “ OK to continue
Step15: on the following license dialog click on “ I accept
Page 99
V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210 System
System
System
System System
System
System
System Development
Development
Development
Development manual
manual
manual
manual
www.armdevs.com
www.armdevs.com
www.armdevs.com
www.armdevs.com
99
Step16: the following screen kicks off the installation. This may take a while
Step17: after the installation is done click on “ OK to finish
Step18: now we will begin to install the third patch “ Visual Studio 2005 Service Pack 1
ATL
Security Update ” .
Double click on “ VS80sp1-KB971090-X86-INTL.exe
Step19: click on “ OK to continue
Page 100
V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210
Tiny210-Mini210 System
System
System
System System
System
System
System Development
Development
Development
Development manual
manual
manual
manual
www.armdevs.com
www.armdevs.com
www.armdevs.com
www.armdevs.com
100
Step20: on the license dialog click on “ I accept
Step21: the following screen kicks off the installation. This may take a while
Step22: after the installation is done click on “ OK to finish
We
have completed our installation of Visual Studio 2005 and its patches on Windows7
6
6
6
6 .1.2
.1.2
.1.2
.1.2 Install
Install
Install
Install Windows
Windows
Windows
Windows CE
CE
CE
CE 6.0
6.0
6.0
6.0 and
and
and
and Patches
Patches
Patches
Patches
This section will guide you through the steps on how to install Windows CE 6.0 Platform Builder.
Note: to install Windows CE 6.0 and its patches on Windows 7 you need to do it as administrator.
You
cannot just
double click on the setup.exe to install. Please strictly follow the steps below
Step1: go to “ Start ” -> “ Programs ” -> “ Accessories ” , locate the command line utility, right click on it and select “ run
Loading...