1. 主页
  2. 文档
  3. 操作系统手册
  4. Cortex-A8
  5. Android 4.1

Android 4.1

Chipsee Embedded Industrial Computer

Android User Manual

V1.0.1

This manual is used to provide users with a fast guide of Chipsee Embedded Industrial Computer about Android OS development. Through this manual, users can quickly understand the hardware resources; users can build a complete compilation of Android development environment; users can debug Android OS via serial, USB OTG and Internet

1. Chipsee Embedded Industrial Computer

Development Kit

Hardware:
(1)Chipsee Embedded Industrial Computer
(2)12V power adapter
(3)Micro SD card and card reader
(4)USB A-A cable (used only if the hardware configured as OTG)
(5)Common serial cable or USB to serial cable

Software:
(1)Chipsee Android 4.2 prebuilt file(to make a bootable SD card)
(2)ADT for Windows
(3)Android USB driver(for Windows)

2. Getting started and tests

Notes: Using the prebuilt file we provided in the CD to test the hardware.

2.1. How to make a bootable SD card

1、Insert the SD card into your computer, if using virtual machines, please make sure the SD card mounted to the Linux operating system.
2、Confirm the SD card mount point, “/dev/sdX”, usually it should be “/dev/sdb”. You can use this command to find out what the “X” is in the Linux system.

$ sudo fdisk –l

3、Copy the file prebuilt-jb-hmi-XXXX.tar.gz to somewhere(such as $HOME).
4、Extract the file prebuilt-jb-hmi-XXXX.tar.gz

$ tar xzvf prebuilt-jb-hmi-XXXX.tar.gz

5、Go to the folder prebuilt-jb-hmi-XXXX/prebuilt-sd/

$ cd ~/Prebuilt-cs-androidXXXXX/prebuilt-sd/

6、Flash the Android OS to the SD card

$ sudo ./mkmmc-android.sh /dev/sd<?>

Notes: The SD card should be at least 2GB, and you’d better to use Sandisk Class4 level SD card or above.

2.2. How flash Android to NAND

Follow the four steps 2.1.
5、Go to folder “prebuilt-jb-hmi-XXXX/prebuilt-nand”

$ cd ~/prebuilt-jb-hmi-XXXX/prebuilt-nand/

6、Make a Flasher card

$ sudo ./mkmmc-android-nand.sh  /dev/sd<?>

7、Switch “SW2” to uSD, insert the uSD card, connect board to PC via COM1, set baud 115200, power on the board.
8、After 20 minutes, when the LED on board stays lit, it is done, you can also find the information from COM1.
9、Switch “SW2” to NAND, power on. It will take a long time the first time to access the system.

2.3. Start Android OS

The first time starting Android OS will take a little time, after this it will be very quick to start the Android. You can see the Chipsee Logo(it can be changed by using software ChipSee_LOGO_MOD_EN.exe we provided in the CD)shown on the LCD screen. It is successful start When you see the Android desktop like Figure 2-1:

Figure 2-1 Android desktop

2.4. Tests

1. Touch screen test
Run MultiTouchTest App, Screen will show the number and position of the touch point when touching the screen. Resistive screen expansion board only supports single-touch, capacitive screen expansion board supports five-point touch like Figure 2-2:

Figure 2-2 Touch screen test(Capacitive)

After working for some time resistive touch screen may not be accurate, need to be calibrated, run ChipseeTouchCal App, like Figure 3.

Figure 2-3 Calibration Tool for Resistive touch

2、 Buzzer test
Run ChipseeBuzzer App, push “OpenBuzze” button the buzzer will continue to sound. push “CloseBuzzer” button to stop it.
3、 Gravity sensor function test
(1)Gravity sensor can be tested by whirling the screen.
(2)Run SensorList App, in the option “Analog Device 3 axis accelerometer”, You can see real-time changes of the three axis acceleration value curve, like Figure 2-4.

Figure 2-4 Real-time acceleration curve

(3)Use gravity sensing game to test, such as “NFS shift” or “aTilt 3D laby”. If using “NFS shift” , pleas run “ChipseeSensorTool” app to adjust the direction of the axis, select “Invert X axis” and “Swap X/Y axes”, if other games please adjust the settings as default.
4、 Audio input and output test
Insert the microphone and earphone into expansion board Audio IN (pink), Audio OUT (light blue) interface. Start “Talking Tom” App(Tom Cat), speak into the microphone, Tom cat will repeat spoken content.
5、 Serial test
Serial ports in system

Serial port Driver
COM1(RS232, Debug) /dev/ttyO0
COM2(RS232) /dev/ttyO1
COM3(RS485) /dev/ttyO2
COM4(RS485) /dev/ttyO4

Form 1 Serial in System

1Connect COM1 on board to PC. Use software “SecureCRT” or “Putty” or some

others in PC. Run “Serial Port API” App to communicate with PC. Like Figure 2-5.

Figure 2-5 Serial settings

(2)Push button “Send 01010101”, you will see something in PC like Figure 2-6.
(3)Push button “Console”, you can send what you want like Figure 2-7.

Figure 2-6 Serial send test

Figure 2-7 Serial receive test

6、 USB device
Android OS support USB-WiFi(RTL8188), you can find the device in settings, like figure 2-8:

Figure 2-8 USB-WiFi

Android OS support USB-Camera, you can find the device in settings, like figure 2-9:

Figure 2-9 USB-Camera

2.5. Logo modify

We provide a software to change the Logo we the OS start, you can find the tool in the CD along with our product: ChipSee_LOGO_MOD_EN.exe.
1. Open the software: Chipsee_LOGO_MOD_EN.exe in Windows:

Figure 2-10 Chipsee Logo modify

2. Click the first Browse button, find the picture file.

Figure 2-11 Choose the Logo you want

3. Click the second Browse button, find the u-boot.img file.

Figure 2-12 Choose the u-boot.img file

4. Choose the resolution , click “Execute”.

Figure 2-13 Change the Logo successful

5. Insert the SD card, power the board, the Logo will be replaced.

2.6. IP Settings

Edit the file uEnv.txt which you can find in the boot partition.

bootargs=console=ttyO0,115200n8 androidboot.console=ttyO0 mem=512M root=/dev/mmcblk0p2 r
w rootfstype=ext4 rootwait init=/init ip=off

Edit the red part like this:
ip=::::::::
For example:

bootargs=console=ttyO0,115200n8 androidboot.console=ttyO0 mem=512M root=/dev/mmcblk0p2 r
w rootfstype=ext4 rootwait init=/init ip=192.168.1.111:::255.255.0.0

3. Android system debug in Windows

In this chapter we will describe how to view the Android system via the serial port and how to debug the system via USB OTG. We can also install applications via USB OTG. The following operation is under the Windows 7 x64 environment, similar to other Windows platforms.

3.1. View Android system via the serial port

1、Connect the COM1 on board to PC
2、Open software “SecureCRT” or “Putty” in Windows.
3、Power on the board, you can see the serial output of information like in Figure 3-1.

Figure 3-1 Serial output

3.2. Adb connect via USB OTG

1、Install Oracle JDK 6 for Windows. You can download here: http://www.oracle.com/technetwork/java/javase/downloads/index.html, We suggest jdk-6u45.
2、Install the ADT. Download the file here: http://developer.android.com/sdk/index.html.
Extract the file somewhere (named ADT). Adb command located\sdk\platform-tools.
3、Optionally, you may want to add the location of the SDK’s primary tools directory to your system PATH. Right-click on My Computer, and select Properties. Under the Advanced tab, hit the Environment Variables button, and in the dialog that comes up, double-click on Path (under System Variables). Add the full path to the tools\ directory to the path.
4、Install Android USB driver: Copy the folder “usb_driver” in CD to folder
Boot the board as normal and wait until shell prompt is available (micro-B USB cable must be disconnected).
• Connect micro-B USB cable between board and Windows PC.
• If it is proceeding as planned, Windows will tell you it found a new hardware asks you to install the driver. Install driver that was downloaded as described in step 3 above:
Answer “No, not this time” to the question about running Windows Update to search for software.
• Choose “Install the hardware that I manually select from a list (Advanced)” this is the 2nd option, then click “Next”
• Select “Show All Devices”, then click “Next”
• You are going to see a grayed-out text box with “(Retrieving a list of all devices)”, click the “Have Disk…” button
• Browse” to your driver folder (\usb_driver). It will be looking of a .inf file so select “android_winusb.inf” and click “Open” then “OK”. It’s the only file there so you shouldn’t go wrong.
• Select “Android ADB Interface” then click the “Next” button.
• A warning will appear, answer “Yes” but read the warning anyway.
• Click the “Close” when the wizard is completed.
Now you can see the driver is installed successfully, like in Figure 3-2.

Figure 3-2 ADB driver

5、Test adb: “Win+r” enter “cmd”, test like below.

> cd <ADT>\sdk\platform-tools\
> adb kill-server
> adb start-server
> adb devices
> adb shell

When the “#” prompt appears, it means we connect the board with PC successfully.

Figure 3-3 ADB Command

Now you can use Linux commands like “ls”, “cd” and so on. Ctrl + C to exit the shell return to Windows system.
6、Use adb command to install Android App: for example SogouInput.apk.

> adb install SogouInput.apk

If there is a “SUCCESS” message, the app has already installed in Android.

Figure 3-4 Install App

7、Use adb command to uninstall App
(1)Uninstall user app(such as SogouInput.apk): Use command “pm list” to get the full name of the app, like Figure 3-5. Then use command “uninstall” to uninstall the app.

> adb shell pm list packages
> adb uninstall com.sohu.inputmethod.sogou

Figure 3-5 Command “pm list” to get app’s name

(2)Uninstall default app: Use “adb shell” to log in the board and delete the apk file:

> adb shell
# cd /system/app/
# ls
# rm Browser.apk

8、Use adb command to transport files between board and PC: “adb pull” and “adb push”
(1)Board to PC: is the file or folder on board, is the file or folder in PC.

>adb pull

(2)PC to board:

>adb push

For example copy \sdk\platform-tools\chipsee.txt to board:

>adb push chipsee.txt /chipsee.txt

Opposite, board to PC:

>adb pull /testFile.txt testFile.txt

3.2. Adb connect via internetG

1. Make sure Ethernet port on board and host machine are connected to the network. Check Ethernet configuration for the board.

# netcfg 
lo       UP    127.0.0.1       255.0.0.0       0x00000049
eth0     UP    192.168.1.117/24   255.255.252.0   0x00001043

2. If Ethernet was not configured, configure Ethernet of the board using ifconfig/netcfg as shown below.

# netcfg eth0 dhcp

3. Configure the ADB Daemon to use an ethernet connection using setprop as shown below.

# setprop service.adb.tcp.port 5555

4. If network is configured successfully (above steps) then Restart service adbd on the target.

# stop adbd
# start adbd

5. On the host machine use following commands to establish adb connection

$ adb kill-server
$ adb start-server
$ adb connect :5555

6. Verify for device connectivity, by executing the following commands. If connected, find the device name listed as a “IPADDRESS:PORT”

$ adb devices
List of devices attached
emulator-5554    device
192.168.1.117:5555  device

7. An example of using adb to install software for Android
Make sure **.apk at the current folder, and export the adb path.

$ adb –s 192.168.1.117:5555 install **.apk

Use the argument –s to appoint the device over the internet.

4. Android App development

In this chapter, we introduce the development of Android with Eclipse for Windows. We assume that the USB is OTG model and the driver is already installed. (See chapter 3.2)

4.1. Preparation

1. Go to folder /eclipse, start eclipse.exe.

Figure 4-1 Start eclipse

Click WindowsAndroid SDK Manager:

Figure 4-2 Android SDK Manager

  1. Click ToolsOptions, check “Force…” and click close:

Figure 4-3 Android SDK Manager Settings

4. Choose the API, such as Android4.2.2(API 17), then click the button “Install packages” to start the download and install.

Figure 4-4 Install API packages

5. It will take some time, and when it is done, close the Android SDK Manager.

4.2. Example—HelloWorld

1. Click FileNewAndroid Application Project:

Figure 4-5 New Application

2. Click on the “Next” button until it’s done. Connect the Embedded Industrial Computer to the PC via USB cable (A-A). If you’ve been successful, you will see the device in DDMS window (WindowsOpen PerspectiveOtherDDMS):

Figure 4-6 DDMS

3. You can capture the picture of Android:

Figure 4-7 Capture Android Desktop

4. Click run, choose the device:

Figure 4-8 Run HelloWorld

5. Result:

Figure 4-9 HelloWorld

Note: If the USB is not configure as  an OTG model, you can copy and install the file HelloWorld.apk from the project folder HelloWorld/bin/, or install the apk via the internet (See chapter 3.3).

这篇文章对您有用吗?