Sie sind auf Seite 1von 132

Tiny210-Mini210 System

V1.0
System Development manual

CoreWind Technology Co.,Limited


Tiny210-Mini210 System System Development manual
www.armdevs.com

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 Technology Co.,Limited


Minzhi, Bao'an District,
Shenzhen City, China.
Tel: +86-755-29638421
Mail: market@armdevs.com
Website: http://www.armdevs.com

2 V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210 System System Development manual
www.armdevs.com

Table of 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 HelloTiny210 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
3 V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210 System System Development manual
www.armdevs.com
5.4 Configure and Compile Busybox................................................................................................................65
5.5 Make YAFFS2 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

4 V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210 System System Development manual
www.armdevs.com

Document version

Table 0-1 Document Revision Notes


Date 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.

5 V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210 System System Development manual
www.armdevs.com

1 INTRODUCTION

1.1 About This 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 Related Document


For additional information not covered in this manual, please refer to the documents listed in Table 1.1.
Table 1-1 Related Document
Document Location
Tiny210 Test Method http://armdevs.com/info194.html

6 V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210 System System Development manual
www.armdevs.com

2 System support
The TIny210/Mini210 support the follow system:
1. Android 4.0
2. Android 2.3
3. Linux
4. WinCE 6.0

7 V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210 System System Development manual
www.armdevs.com

3 Android system development

3.1 Build environment


arm-linux-gcc-4.5.1-v6-vfp-20101103.tgz,, mktools-YYYYMMDD.tar.gz
1. copy the cross tools arm-linux-gcc-4.5.1-v6-vfp-20101103.tgz position:
mktools-YYYYMMDD.tar.gz(position:
CD:/android
android//) to /tmp folder.
CD:/android

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 Source code Prepared


Lets 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.35-android directory which contains a complete copy of source
code
8 V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210 System System Development manual
www.armdevs.com
Note: 20110925 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: 20110925 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: 20110925 is the date when we released it.

3.3 Configure and Compile Linux 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 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 Create 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 and 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.
9 V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210 System System Development manual
www.armdevs.com

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 Create or Run File 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.

10 V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210 System System Development manual
www.armdevs.com

4 Android Application Programming Guide


This chapter will introduce how to build Android development environment,including download and install
Android SDK and Eclipse.

4.1 Install the Application Programming environment


This page will introduce how to build the Android application in Windows 7 system.It is for Android 2.3.If 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 Step 1: download and install JDK(Java SE Development 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.

11 V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210 System System Development manual
www.armdevs.com

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 Variables" 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 Step 2: download and install Android 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:

12 V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210 System System Development manual
www.armdevs.com

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 Step 3: download and install Android2.3 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 Step 4: install Eclipse development 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 categories, then download Eclipse IDE for Java Developers

13 V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210 System System Development manual
www.armdevs.com

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 Step 5: install Android Development Tools


File name: ADT_9.0.0.zip (Posion: CD:/Android/)
You can download it from the following website: http://developer.android.com/sdk/eclipse-adt.html#installing

14 V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210 System System Development manual
www.armdevs.com

Then uncompress ADT_9.0.0.zip to the eclipse installed folder(d:/eclipse).

4.1.6 Step 6: Configure the Eclipse


Run the eclipse.exe in D:/eclipse, then click "Windows->Preferences" in main menu to open the Preferences
dialog, then select "Android" and set the configure file as follows, 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 Create Android 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 Android-AVD
Name
Target: Android 2.3.1 - API Level 9
Target
SD card size
size: 512
Click "Create AVD"

15 V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210 System System Development manual
www.armdevs.com

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 Step 8: Develop the first Android application program

4.1.9 Creat Hello Tiny210 project


HelloTiny210
In the eclipse menu, click "File->New->Project", then open the "New project dialog".

16 V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210 System System Development manual
www.armdevs.com

Then select
"Android->Android Project", and click "Next", it will open "New Android Project"

Input as follows:
1) Project Name: HelloTiny210
2) Build Target: Android 2.3.1
3) Appication name: HelloTiny210
4) Package name: com.Tiny210
5) Create Activity: MainActivity
Then click "Finish" button, it will go to the eclipe main interface.

17 V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210 System System Development manual
www.armdevs.com
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 Run HelloTiny210 Application Program in 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 AVD. After the Android system
booted, it will run HelloTiny210 Application Program automatically.

4.1.11 Step 8: Create the Debugging environment for Tiny210


4.1.11.1 Install the USB ADB 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 Manager.exe


Manager.exe, at the root of your SDK
directory.
18 V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210 System System Development manual
www.armdevs.com
2 Expand the Third party Add-ons and Google Inc. add-ons.
3 Check Google Usb Driver 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_driver 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.
3 Select 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 Driver Software
Software. This will
launch the Hardware Update Wizard.

6 Select Browse my computer for driver software and click Next


Next.
7 Click Browse and locate the USB driver folder. (The Google USB Driver is located in "C:\Program
Files\Android\android-sdk\extras\google\usb_driver
Files\Android\android-sdk\extras\google\usb_driver")
8 Click Next to install the driver.

4.1.11.2 Add adb command into Path environment variables


1) Right-click My Computer->Properties, then select "Advanced system setting" option.
2) Click the "Environment Variables" 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"

19 V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210 System System Development manual
www.armdevs.com
4) Click "OK" to finished.

Test the adc 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 Variables set ok.

4.1.11.4 Test ADB function with Tiny210


Check the device connection 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 ADB Shell


Input the command to enter the Tiny210 terminal:
# adb shell
Input exit in the Tiny210 terminal to return to DOS prompt .

Install software with ADB


Install D:\sinaweibo_2.0.4.apk for example, input adb install D:\sinaweibo_ 2.0.4.apk in the DOS
window.

20 V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210 System System Development manual
www.armdevs.com

4.1.11.4 Run application program in Tiny210 by USB ADB


Run Eclipse, it will open HelloTiny210 project automatically. Right lick HelloTiny210 project in the Eclipse main
interface, select Properties
Properties, it will pop-up the Properties for HelloTiny210 window:

Run->Debug Settings
Click "Run->Debug Target
Settings",select HelloTiny210,then click Edit button,click "Target
Target" in the Edit Configuration
Manual
window, click "Manual
Manual" for the Development Target Selection Mode, as follows:

21 V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210 System System Development manual
www.armdevs.com

Click OK and exit it.


Select HelloTiny210 project,then select Run->Run As->Android Application Choose a running
Application,select "Choose
device" in Android Device Chooser dialog, select the Android device(2.3.1) in the list,click "OK"
Android device

Wait for a moment,the HelloTiny210 application will run in Tiny210 board.

22 V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210 System System Development manual
www.armdevs.com

4.1.11.6 Debug Android application program in Tiny210


Open Perspective->Debug
Exit HelloTiny210 program to Eclipse main interface, click "Open Perspective->Debug" in the Eclipse main
Run->Debug
interface to enter the debug view.Try to set a breakpoint in the source code, finally click "Run->Debug
Run->Debug" in the
menu. The program will suspend on the breakpoint,as below:

4.2 Program access to hardware in 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.

23 V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210 System System Development manual
www.armdevs.com
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 How to use the library (libfriendlyarm-hardware.so)


(libfriendlyarm-hardware.so)
The library libfriendlyarm-hardware.so was at the follow position in android source code.
device/Samsung/smdkv210/prebuilt/libfriendlyaarm-hardware.so
device/Samsung/smdkv210/prebuilt/libfriendly

On development board position:


/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 folder in this folder, and then creats armeabi folder in libs folder,
finally copy "libfriendlyarm-hardware.so" to the armeabi folders.
2) Back to your application folder, Create three directories "com\friendlyarm\AndroidSDK
"com\friendlyarm\AndroidSDK" in the src folder,
HardwareControler.java
then create a file "HardwareControler.java src\com\friendlyarm\AndroidSDK", add the
HardwareControler.java" in the folder "src\com\friendlyarm\AndroidSDK",
follow source code to this 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);

/* */

24 V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210 System System Development manual
www.armdevs.com
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:

import com.friendlyarm.AndroidSDK.HardwareControler;

Then you can write your application with the HardwareControler API, next chaper will introduce the
HardwareControler API.

4.2.2 library(libfriendlyarm-hardware.so) API 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 Serial Port API introduce
The API of the serial port is as follow:
API interface
int openSerialPort( String devName, long baud, int dataBits, int stopBits )
Description
Open the specified serial device, and returns the file descriptor.
Parameters
devName: Serial port device name, such as:

25 V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210 System System Development manual
www.armdevs.com
/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 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 interface
int write(int fd, byte[] data)
Description
writes data to fd device .
Parameters
fd: the File descriptor, data will be writed from this fd.
Data
Data: the writed data
Return value
On success, the number of bytes written are returned (zero indicates nothing was written).
On error, -1 is returned

API interface
int read(int fd,byte[] buf,int len)
Description
read() attempts to read up to count bytes from file descriptor fd into the buffer starting at buf.
read
Parameters
fd: the File descriptor, the data will be readed from this fd.
buf
buf: buffers for Storing data
Len: the number of bytes read
Len
Return value
On success, the number of bytes read is returned (zero indicates end of file ).
On error, -1 is returned
API interface
int select(int fd, int sec,int usec)
Description
Check whether there is data that can be read from the File descriptor fd.
Parameters
fd: the File descriptor, the data will be seleclt from this fd.
sec
sec: Waiting time for the data, Units: seconds

26 V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210 System System Development manual
www.armdevs.com
usec
usec: Waiting time for the data, Units: ns, 1ms=1000ns
Return value
On success, 1 or 0 is returned, if no data, return 0. If have data, return 1.
On error, -1 is returned
API interface
int close(int fd)
Description
Close the specified serial device(file descriptor fd)
Parameters
fd: the File descriptor.
Return value
no

API use 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.

27 V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210 System System Development manual
www.armdevs.com
4.2.2.2LED API introduce
The API of the LED is as follow:
API interface
int setLedState(int ledID,int ledState )
Description
Turn on/off the LED
Parameters
ledID: Specifies which LED switches
ledState: 1 means turn on, 0 means turn off
ledState
Return value
On success, 0 is returned.
On error, -1 is returned

4.2.2.3 Buzzer control(PWM API introduce)


The API of the Buzzer control is as follow:
API interface
int PWMPlay(int frequency);
Description
Specified frequency for buzzer sound
Parameters
frequency: Specifies frequency for buzzer sound
Return value
On success, 0 is returned.
On error, -1 is returned
API interface
int PWMStop();
Description
Stop the buzzer sound
Parameters:: no
Parameters
Return value
On success, 0 is returned.
On error, -1 is returned
4.2.2.4 ADC API introduce
The API of the Buzzer control is as follow:
API interface
int readADC();
Description
Read ADC
Parameters:: No
Parameters
Return value
On success, the result for ADC read is returned.
On error, -1 is returned
4.2.2.5 EEPROM API introduce
The API of the EEPROM is as follow:
28 V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210 System System Development manual
www.armdevs.com
API interface
int openI2CDevice();
Description
Open the IIC device, and returns the file descriptor.
Parameters:: No
Parameters
Return 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 interface
int writeByteDataToI2C(int fd,int pos,byte byteData);
Description
Write a byte data to IIC device.
Parameters
fd: the File descriptor, the data will be write to this fd.
pos: Specified the postion which the data will be write,(0-255)
byteData: a byte data will be write
Return value
On success, 1 is returned.
On error, -1 is returned
API interface
int readByteDataFromI2C(int fd,int pos);
Description
read a byte data to IIC device.
Parameters
fd: the File descriptor, the data will be read to this fd.
pos: Specified the postion which the data will be read,(0-255)
Return value
On success, the read data is returned.
On error, -1 is returned
API interface
int close(int fd)
Description:: Close the specified fd(file descriptor fd)
Description
Parameters
fd: the File descriptor.
value:: no
Return value
API use method
1use "openI2CDevice" to open the IIC device
2Use "writeByteDataToI2C" to write data to EEPROM.
3Use "readByteDataFromI2C" to read data from EEPROM.
4When finished to use the EEPROM, use "close" to close the it.

4.2.3 API Demo introduce


At the Postion: CD:/Android/LEDDemo, it is a demo for libfriendlyarm-hardware.so API introduce, you can
open it with Eclipse.
29 V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210 System System Development manual
www.armdevs.com

30 V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210 System System Development manual
www.armdevs.com

Chapter 5 Linux

5.1 Set up Fedora 9.0 Development 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 didnt 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 Install Fedora 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"

Step2The system will check the installation disk. It can be ignored, just press "Skip" to the next step

31 V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210 System System Development manual
www.armdevs.com

Step3it enters the graphic interface, click on the "Next" button.

Step4set the installation language. In this example, we chose the simplified English.

32 V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210 System System Development manual
www.armdevs.com

Step5set the keyboard, in this example, we chose the U.S. key board.

Step 6configure the network.

33 V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210 System System Development manual
www.armdevs.com

In our example, we didnt 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.

34 V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210 System System Development manual
www.armdevs.com

Step 7set the time zone. We chose "Asia/Shanghai".

Step 8set up the administrators password, i.e. the roots password. "root" is the super user. It should be at least 6
characters

35 V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210 System System Development manual
www.armdevs.com

Step 9disk 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.

36 V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210 System System Development manual
www.armdevs.com

Here is the format process:

Step 11select the installation type, in this example, we chose "customize"

37 V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210 System System Development manual
www.armdevs.com

Step 12configure the "server" item as follows:

Step 13begin installation

38 V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210 System System Development manual
www.armdevs.com

Step14: installation complete.

Step15: after installation completed, click on the reboot button on the page shown in step 14

39 V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210 System System Development manual
www.armdevs.com

Step16: skip this license page and go "forward"

Step17: create new users. We ignored user creation and went to the next step.

40 V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210 System System Development manual
www.armdevs.com

Press "continue" to go on.

Step18: setup date and time. We ignored this and went to the next step.

41 V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210 System System Development manual
www.armdevs.com

Step19: confirm hardware information. We just clicked on "Finish".

On the popup window shown below, just click on the red marked button.

42 V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210 System System Development manual
www.armdevs.com

Step 20: on the login page, login as "root"

Input the password we just created for "root"

43 V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210 System System Development manual
www.armdevs.com

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.

44 V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210 System System Development manual
www.armdevs.com

5.1.2 Add User Account

To create a new user (not root) account, here are the steps:
Step 1: go to "Users and Groups"

45 V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210 System System Development manual
www.armdevs.com

Step 2: open the "Users Manager" window

Step 3: click on the "Add User" button, type the user name and password

46 V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210 System System Development manual
www.armdevs.com

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.

47 V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210 System System Development manual
www.armdevs.com

5.1.3Access Windows 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.

48 V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210 System System Development manual
www.armdevs.com

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"

49 V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210 System System Development manual
www.armdevs.com

Step 2: set Fedora9

Open the window below:

50 V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210 System System Development manual
www.armdevs.com

Select "Windows share" in the "service type" field

Input the shared files name and its windows machine IP

51 V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210 System System Development manual
www.armdevs.com

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.

52 V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210 System System Development manual
www.armdevs.com

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:

53 V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210 System System Development manual
www.armdevs.com

5.1.4 Configure NFS 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) Set up Shared Directories


Run the command below:

#gedit /etc/exports
This command edits the NFS configuration file. Add the following line

(Noteif 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" 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 2: Starting 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.

54 V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210 System System Development manual
www.armdevs.com

Select (*) Disabled, and click on the "OK" button to disable the firewall permanently. Now you can start the NFS
service:

(1) Start and Stop the NFS service


Run the command below:

#/etc/init.d/nfs 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 /mnt/


If no err messages come up, the user can then browse the contents of the "/mnt" directory and verify if the contents

/opt/FriendlyARM/mini6410/linux/root_qtopia_qt4
are the same as the "/opt/FriendlyARM/mini6410/linux/root_qtopia_qt4
/opt/FriendlyARM/mini6410/linux/root_qtopia_qt4" directory.
Stop the service by commanding:

/etc/init.d/nfs stop
#/etc/init.d/nfs

(2) Starting the NFS service through the graphic interface


To auto run the service on system startup, the user can execute the command below:

# 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.

55 V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210 System System Development manual
www.armdevs.com

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 PCs hard
disk, this trick is widely used in Linux development.
Switch the target boards 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

root=/dev/nfs

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

h0:off
"nfsroot" is the boards IP. If you started a virtual machine this IP would be your virtual machines IP.
The number strings after "ip=" are detailed as below:
The first item, in this example "192.168.1.70" is the targets temporary IP (please make sure this IP doesnt
conflict with other IPs within the same network);
The second item, in this example "192.168.1.111" is the hosts IP,
The third item, in this example "192.168.1.111" is the target boards gateway IP,

56 V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210 System System Development manual
www.armdevs.com
The fourth item, in this example "255.255.255.0" is the subnet mask,
The fifth item is the boards machine name (the user can give whatever name he likes)
"eth0" is the network adaptors 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 customers 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.

57 V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210 System System Development manual
www.armdevs.com

5.1.5 Set Up Cross Compile 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 systems
directory, e.g "tmp\", enter this directory and execute the following commands:

#cd \tmp

#tar xvzf arm-linux-gcc-4.5.1-v6-vfp-20101103.tgz C /

Note: there is a space after "C" and "C" is a capital letter.

/opt/FriendlyARM/toolschain/4.5.1
These commands will install "arm-linux-gcc" in the "/opt/FriendlyARM/toolschain/4.5.1
/opt/FriendlyARM/toolschain/4.5.1"

Step 2: run the command below to add the compilers path to system variables:

#gedit /root/.bashrc
This is to edit the "/root/.bashrc" file. Update the last line with "export
PATH=$PATH:/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.
58 V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210 System System Development manual
www.armdevs.com

5.2 Uncompress Source Code and Install Application 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 Uncompress Source 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
59 V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210 System System Development manual
www.armdevs.com

#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/tin210/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/tin210/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/tin210/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


60 V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210 System System Development manual
www.armdevs.com
In the work directory /opt/FriendlyARM/Tiny210/linux, run the commands below:

#cd /opt/FriendlyARM/tin210/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/tin210/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/tin210/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 Create Target File 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
61 V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210 System System Development manual
www.armdevs.com
- support co-existence of a USB mouse and a touch screen

5.2.3 Install Target File 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 dont apply to MLC2 Nand Flash. The
generated image files structure is "1 Page= 2K Byte 1 Block=128K" for SLC Nand Flash(such as Samsungs
K9F2G08k9K8G08).
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 xvzf /tmp/mktools-YYYYMMDD.tar.gz C /
(Notice: YYYYMMDD is the actual 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 Mini6410s mkyaffs2image it will be overwritten. But you dont need to worry about it since they are identical

5.2.4 Install 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 xvzf /tmp/linux/logomaker.tgz C /


#tar
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

62 V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210 System System Development manual
www.armdevs.com

5.3 Configure and Compile Kernel

5.3.1 Configure and Compile 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 /opt/FriendlyARM/tiny210/android/ linux-2.6.35.7

.config;;
#cp mini210_linux_defconfig .config
You can execute make menuconfig to modify the configuration.then output make to compile

#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 Location of the Driver

No. Ddevice: or others Location of the Driver corresponding Remark

63 V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210 System System Development manual
www.armdevs.com
source code in the kernel Device name on the
board
1 Yaffs file system Linux-2.6.35.7/fs/yaffs2
LCD FrameBuffer Linux-2.6.35.7/drivers/video /dev/fb0
2
/samsung
Serial port(includes 4 Linux-2.6.35.7/drivers/serial /dev/ttySAC0,1,2,3 Tiny210
serial ports) /samsung.c comes with
3
4 serial
ports
NIC driver Linux-2.6.35.7/drivers/net/d
4
m9000.c
Audio driver(ALSA Linux-2.6.35.7/sound/soc/s5
5
interface) pv2xx
One wire touch Linux-2.6.35.7/drivers/input /dev/touchscreen-1wi
6 driver /touchscreen/Mini210_1wir re
e_host.c
SD driver Linux-2.6.35.7/drivers/mmc /dev/mmcblk0 Support
/host/sdhci-s3c.c High-speed
7 SD
card,upto
32G
RTC driver Linux-2.6.35.7/drivers/rtc/rt /dev/rtc
8
c-s3c.c
Watchdog driver Linux-2.6.35.7/drivers/watc /dev/watchdog
9
hdog/s3c2410_wdt.c
LED driver Linux-2.6.35.7/drivers/char/ /dev/leds
10
mini210_leds.c
Button driver Linux-2.6.35.7/drivers/char/ /dev/buttons
11
mini210_buttons.c
PWM Control buzzer Linux-2.6.35.7/drivers/char/ /dev/pwm
12
mini210_pwm.c
ADC driver Linux-2.6.35.7/drivers/char/ /dev/adc
13
mini210_adc.c
LCD backlight driver Linux-2.6.35.7/drivers/input /dev/backlight-1wire
14 /touchscreen/mini210_1wire
_host.c
I2C-EEPROM driver Linux-2.6.35.7/drivers/i2c/b /dev/i2c/0
15
usses/i2c-s3c2410.c
USB camera Linux-2.6.35.7/drivers/medi /dev/video0
16
a/video/gspca
USB wireless LAN Linux-2.6.35.7/drivers/net/w
17
ireless
SD WiFi driver Linux-2.6.35.7/drivers/net/w
18
ireless/libertas
64 V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210 System System Development manual
www.armdevs.com
USB to serial port Linux-2.6.35.7/drivers/ /dev/ttyUSB0
19
driver
USB mouse and Linux-2.6.35.7/drivers/hid/u USB mouse:
keyboard,Scanner sbhid /dev/input/mice
20
USB keyboard:
/dev/input
21 SPI driver Linux-2.6.35.7/drivers/spi/
Multimedia driver Linux-2.6.35.7/drivers/medi
a/video/samsung
Includes 2D,3D,Image Flip,
22
JPEG hard codec, MFC,
camera, TV, PP (Post
Processor), the CMM, etc.
Nand Flash driver Linux-2.6.35.7/drivers/mtd/
23
nand
Flash ECC check Linux-2.6.35.7/drivers/mtd/
24
nand/s3c_nand.c
USB bluetooth driver Linux-2.6.35.7/drivers/bluet
25
ooth/
3G driver Linux-2.6.35.7/drivers/usb/s
26
erial

5.4 Configure and Compile 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 fa.config .config

#make
A moment later an object file of busybox will be generated, which is identical to the one
preinstalled in the system

65 V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210 System System Development manual
www.armdevs.com

5.5 Make YAFFS2 Image

Enter "/opt/FriendlyARM/tiny210/linux" and execute the following command:

#cd /opt/FriendlyARM/mini210/linux/

#mkyaffs2image-128M rootfs_qtopia_qt4 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 boards
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 Sample Linux 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 dont guarantee they
can be compiled and run with other corss compilers.

66 V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210 System System Development manual
www.armdevs.com

5.6.1 "Hello, 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,World
Enter the directory where the source code is located and execute "make":

#cd /tmp/

#arm-linux-gcc hello.c o 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
67 V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210 System System Development manual
www.armdevs.com

(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

68 V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210 System System Development manual
www.armdevs.com
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 /dev/sda1 /mnt ; mount your drive

#cp hello /mnt ; copy your file to the drive

#umount /mnt ; unmount your drive


2. Copy to Board
Insert your drive to your boards USB host, it will be automatically mounted under
"/udisk". Please execute the following command

#cd /udisk

#./hello execute
execute "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 +x 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

69 V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210 System System Development manual
www.armdevs.com

(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 /mnt

#./hello

5.6.2 LED Test 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 /opt/FriendlyARM/tiny210/linux/examples/leds
Location
Test Program Name led.c
Executable File Name led
Test Programs 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 */

70 V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210 System System Development manual
www.armdevs.com
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 User Button Test 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 /opt/FriendlyARM/tiny210/linux/examples/buttons
Location
Test Program Name Buttons_test.c
Executable File Name buttons
Test Programs 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>

71 V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210 System System Development manual
www.armdevs.com
#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 PWM Buzzer Program

Program Description:

72 V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210 System System Development manual
www.armdevs.com
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 /opt/FriendlyARM/tiny210/linux/examples/pwm
Location
Test Program Name pwm_test.c
Executable File Name Pwm_test
Test Programs 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);
}
73 V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210 System System Development manual
www.armdevs.com

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)

74 V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210 System System Development manual
www.armdevs.com
{
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:

75 V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210 System System Development manual
www.armdevs.com
break;
}
}
}
You can compile the program, download it and run

5.6.5 I2C-EEPROM 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 Programs 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);

76 V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210 System System Development manual
www.armdevs.com
}

#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");
}

77 V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210 System System Development manual
www.armdevs.com
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 Pipe Programming Manipulating LED from HTML

Program Description:
Source Code Location /opt/FriendlyARM/tiny210/linux/examples/led-player
Driver

78 V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210 System System Development manual
www.armdevs.com
Device Type
Device Name
Test Program Source Code Location
Test Program Name led-player.c
Executable file Name led-player
Test Programs 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;
79 V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210 System System Development manual
www.armdevs.com
}
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);

80 V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210 System System Development manual
www.armdevs.com
}
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

81 V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210 System System Development manual
www.armdevs.com
#!/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 Compile 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.

82 V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210 System System Development manual
www.armdevs.com

5.7.1 Uncompress and Install Source Code

Please refer to Section 5.5.1

5.7.2Compile and Run Qtopia-2.2.0 for x86

All our programs have been verified on Fedora9. We didnt 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 /opt/FriendlyARM/
#cd tiny210
/opt/FriendlyARM/tiny210 /linux/x86-qtopia
tiny210/linux/x86-qtopia

./build-all (this process takes about 30 minutes)


#./build-all
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
You will see the following screen

83 V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210 System System Development manual
www.armdevs.com

Follow the default options to continue and you will see the following screen

5.7.3 Compile and Run Qtopia-2.2.0 for 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
84 V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210 System System Development manual
www.armdevs.com

cd /opt/FriendlyARM/
#cd tiny210
/opt/FriendlyARM/tiny210 /linux/arm-qtopia
tiny210/linux/arm-qtopia

./build-all (this process takes about 30 minutes)


#./build-all

#./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 boards root directory via a flash drive. In our example we had it under
/home/plg. Please run the command below:

tar xvzf /home/plg/target-qtopia-konq.tgz C /


#tar
"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.

85 V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210 System System Development manual
www.armdevs.com

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 Compile QtE-4.7.0

5.8.1 Uncompress and Install Source Code

Please refer to section 5.5.1

5.8.2 Compile and Run QtE-4.7.0 for 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 /opt/FriendlyARM/
#cd tiny210
/opt/FriendlyARM/tiny210 /linux/arm-qte-4.7.0
tiny210/linux/arm-qte-4.7.0

./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 xvzf target-qte-4.7.0.tgz C /


#tar
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.

86 V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210 System System Development manual
www.armdevs.com

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 Compile Qtopia4(Qt-Extended-4.4.3)

5.9.1 Uncompress and Install Source Code

Please refer to section 5.5.1

5.9.2 Compile and Run Qt-Extened-4.4.3 for 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:

87 V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210 System System Development manual
www.armdevs.com

cd /opt/FriendlyARM/mini6410/linux/x86-qt-extended-4.4.3
#cd

./build-all
#./build-all
The build process takes a while. To run your compiled system please type the command below:

./run
#./run
Now you will see the following screen:

5.9.3 Compile and Run Qt-Extened-4.4.3 for 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 /opt/FriendlyARM/
#cd tiny210
/opt/FriendlyARM/tiny210 /linux/arm-qt-extended-4.4.3
tiny210/linux/arm-qt-extended-4.4.3

./build-all
#./build-all
The build process takes a while. To run your compiled system please type the command below:

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 xvzf target-qtopia4.tgz C /


#tar
88 V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210 System System Development manual
www.armdevs.com
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 &"

89 V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210 System System Development manual
www.armdevs.com

Chapter 6 WinCE

6.1 set up WinCE 6 Development Environment

NOTE: The 6410 platform WinCE development environment can not coexist with 210
development environment.If 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 dont offer Windows Embedded 6.0 CE 6 installation files and users may need to download its
trial version from Microsofts 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 )
90 V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210 System System Development manual
www.armdevs.com
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:

91 V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210 System System Development manual
www.armdevs.com

6.1.1 Install Visual Studio 2005 and Patches

Step1enter the Visual Studio 2005 directory and double click on setup.exe

Step2click on Install Visual Studio 2005 to continue

92 V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210 System System Development manual
www.armdevs.com
Step3click on Next to continue

Step4: check the redly marked box and enter your serial number, click on Next to continue

93 V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210 System System Development manual
www.armdevs.com
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

94 V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210 System System Development manual
www.armdevs.com
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

95 V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210 System System Development manual
www.armdevs.com

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

96 V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210 System System Development manual
www.armdevs.com

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

97 V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210 System System Development manual
www.armdevs.com
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

98 V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210 System System Development manual
www.armdevs.com
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

99 V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210 System System Development manual
www.armdevs.com
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.1.2 Install Windows CE 6.0 and 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
100 V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210 System System Development manual
www.armdevs.com
as administrator

Step2: enter the installation directory, type Windows Embedded CE 6.0.msi and press return

Step3: click on Next to continue

101 V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210 System System Development manual
www.armdevs.com

Step4: type the product key and click on Next

Step5: check I accept on the license dialog and click on Next to continue

102 V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210 System System Development manual
www.armdevs.com

Step6: follow the options marked redly as below and click on Next to continue

Step7: follow the options mared redly as below and click on Next to continue

103 V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210 System System Development manual
www.armdevs.com

Step8click on Install to continue

Step9: the installation is kicked off and it may take a while

104 V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210 System System Development manual
www.armdevs.com

Step10: after the installation is done click on Finish to complete

Step11: now we will begin to install a patch Windows Embedded CE 6.0 Platform Builder
Service Pack 1.msi.Open the command line utility as administrator, enter the directory, type
Windows Embedded CE 6.0 Platform Builder Service Pack 1.msi and press return

105 V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210 System System Development manual
www.armdevs.com

Step12: click on Next to continue

Step13: check I accept and click on Next to continue

106 V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210 System System Development manual
www.armdevs.com

Step14: click on Next to continue

Step15: the installation is kicked off and it may take a while

107 V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210 System System Development manual
www.armdevs.com

Step16: after the installation is done, click on Finish to complete

Step17: now we will begin to install the second patch Windows Embedded CE 6.0 R2.msi. Please follow the
previous steps to launch the command line utility, type Windows Embedded CE 6.0 R2.msi and press return
Note: some users may download a Windows Embedded CE 6.0 R2.msi which is about 50MB. But this is not a

108 V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210 System System Development manual
www.armdevs.com
complete installation file. We suggest our users use our R2 patch which is about 1.01GB

Step18: click on Next to continue

Step19: check I accept and click on Next to continue

109 V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210 System System Development manual
www.armdevs.com

Step20: click on Next to continue

110 V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210 System System Development manual
www.armdevs.com

Step21: click on Next to continue

111 V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210 System System Development manual
www.armdevs.com

Step22: the installation process is kicked off and this may take a while

Step23: after the installation is done, click on Finish to complete

112 V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210 System System Development manual
www.armdevs.com

Step24: now we will begin to install R3. Please follow the previous steps to launch the command line utility, type
Windows Embedded CE 6.0 R2.msi and press enter
Note: some users may download a Windows Embedded CE 6.0 R3 which is an image file. In order for users to
use it more conveniently we make it a directory which contains 166 files that are about 1.14GB

113 V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210 System System Development manual
www.armdevs.com
Step25: click on Next to continue

Step26: check I accept and click on Next to continue

114 V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210 System System Development manual
www.armdevs.com

Step27: click on Next to continue

115 V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210 System System Development manual
www.armdevs.com

Step28: the installation is kicked off and it may take a while

Step29: after the installation is done, click on Finish to complete

116 V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210 System System Development manual
www.armdevs.com

Step 30: go on installing the patch : WinCEPB60-101231-Product-Update-Rollup-Armv4I.msi


Download address: http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=1127
Note: the patch must be installed,or the compiled NK.bin can't run on the boards.
8.1.3Install Tencent QQ (a Third Party Messenger)
Windows CE 6.0 R3 includes some third party software such as Tencent QQ and File Viewers. We have burned it
into our shipped CD and you can also download it from the following website:
http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=bc247d88-ddb6-4d4a-a595-8eee35
56fe46#filelist .

8.1.4 Install BSP and Sample Programs


The Mini6410 BSP and it project file can be installed by running Mini6410-WinCE6-Suite-1030 (1030 is the
date when we released it. Our latest file one may have a different date, please refer to our CD). Users can
download this file from http://www.arm9.net . Below are the steps to follow
Step1: locate the Mini6410-WinCE6-Suite-1030 executable and double click on it

117 V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210 System System Development manual
www.armdevs.com

Step2: follow the default options and click on Install to continue

Step3: the installation is kicked off and very short since the file is very small

118 V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210 System System Development manual
www.armdevs.com

Step4: after the installation is done, click on Close to complete

A Mini210 BSP directory will be created under WinCE600\ PLATFORM

119 V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210 System System Development manual
www.armdevs.com

Three directories for three languages will be created under WinCE600\OSDesigns:


l Mini210- Simplified Chinese
l Mini210-en - English
l Mini210-tw Tranditional Chinese

Now you have successfully set up your Windows CE 6.0 development environment

6.2 Configure and Compile WinCE 6.0 Kernel and Bootloader

Configuring a Windows CE6 kernel is very complicated and users may easily to fail if they dont do it carefully.
Therefore we prepared a kernel project for users reference. You can follow the steps below to open and compile it.
There is a ready image under images\WindowsCE6 in the shipped CD
120 V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210 System System Development manual
www.armdevs.com

6.2.1 Compile Default Kernel

Please launch VS2005 to begin compiling the mini6410 BSP.


Step1: go to Start->Programs->Microsoft Visual Studio 2005-> Microsoft Visual Studio 2005

Step2: click on Exit Visual Studio on the following dialog

121 V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210 System System Development manual
www.armdevs.com

Step3: Go to Start->Programs->VS2005->VS2005, right click on it and you will see the following dialog.
Select Property. We need to run it as administrator.

122 V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210 System System Development manual
www.armdevs.com

Step4: in the dialog shown below, click on compatibility and check the option shown and click on OK

123 V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210 System System Development manual
www.armdevs.com

Step5: go to Start->Programs->VS2005->VS2005 and click on Continue and you will run it as


administrator

124 V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210 System System Development manual
www.armdevs.com
Step6: now you will see the initial interface of VS2005

Step7: Go to File->Open->Project/Solution

Step8: locate your mini6410 file (in this example it was C:\WINCE600\OSDesigns\Mini6410-en), click on
Open

125 V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210 System System Development manual
www.armdevs.com

Step9: moments later after the mini6410 project is loaded you will see the following dialog

Step10: go to Build->Advanced Build Commands->Clean Sysgen to begin compilation. This process may take a
while

126 V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210 System System Development manual
www.armdevs.com

Step11: after the compilation is done, an NK.bin and an NK.nb0 will be generated under the following directory:
C:\WINCE600\OSDesigns\Mini210\Mini210\RelDir\Mini210_ARMV4I_Release\

6.2.2 Modify serial port output in BSP

User can modify serial port output in the file options.h: as a common serial port or debugging output. Defined as
follows:
127 V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210 System System Development manual
www.armdevs.com
// --- by customer
#define DEBUG_PORT DEBUG_UART_NONE
The default definition is: don't output the debugging information to any serial port. DEBUG_PORT can be set to:
DEBUG_UART_NONE -> not output any debugging information
DEBUG_UART0 -> output debugging information to COM1
DEBUG_UART -> output debugging information to COM2
DEBUG_UART2 -> output debugging information to COM3
DEBUG_UART3 -> output debugging information to COM4

6.2.3 Create SDK

After you installed VS2005 on your PC but didnt install Windows CE 6.0 Platform Builder, you must have a SDK
to develop Mini64140 applications with VS2005. It is very similar to the SDK needed for Embedded Visual C++.
After you compile your kernel you can set up a SDK via VS2005. Note: this SDK is only for VS2005 not for other
utilities such as EVC and VS2008. Please follow the steps below to do it:
Step1: start VS2005, open your project file mini6410, right click on Mini6410-CE6-SDK and select Build

Step2: moments later the SDK will be built

128 V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210 System System Development manual
www.armdevs.com

Step3: go to C:\WINCE600\OSDesigns\Mini210\Mini210\SDKs\sdk1\MSI you will be able to find a


SDK1.msi installation file

6.2.4 Install SDK

Note: our shipped CD already has an SDK under WindowsCE6\Mini210-SDK.msi. Now lets install an SDK
Step1: double click on Mini210- SDK.msi and click on Next to continue

Step2: check I accept and click on Next to continue

129 V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210 System System Development manual
www.armdevs.com

Step3: type your user name and companys name and click on Next to continue

Step4: click on Complete to continue

130 V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210 System System Development manual
www.armdevs.com

Step5: click on Next to continue

Step6: click on Install to continue

131 V1.0
CoreWind Technology Co.,Limited
Tiny210-Mini210 System System Development manual
www.armdevs.com

Step7: the installation is kicked off

Step8: click on Finish to complete

132 V1.0
CoreWind Technology Co.,Limited

Das könnte Ihnen auch gefallen