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

Android 4.3

Chipsee Embedded Industrial Computer

Android User Manual

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, build a complete compilation of Android development environment, 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)USB A-A cable (used only if the hardware configured as OTG)
(4)Common serial cable or USB to serial cable

Software:
(1)Chipsee Android 4.3 Image file
(2)ADT for Windows

2. Getting started and Tests

Notes:Through this part of the content, the user can use the image files of Android we provide and MFGTools for system burning, system start, and begin basic software and hardware test.

2.1. Boot configuration select

CS-IMX6 has a boot configuration select switch, where you can select two modes:

2.2.Prepare Manufacturing Tool and Image

The manufacturing tool, called MFGTool, is a tool that runs on a PC and is used to download images to devices on an IMX board .The tar.gz file can be found in the tools directory .

MFGTool Windows download tool
Kernel Image Boot.img
U-boot Image u-boot.bin
Recovery Image Recovery.img
Android File System System.img
Industrial Computer one
USB OTG Cable one
12V-2A power adapter one

2.3. Downloading Images

2.3.1. Configuring MFGTool

Unzip Mfgtools-Rel-xxx_xxxxxx_MX6Q_UPDATER_Vxx.tar.gz ,Edit” Mfgtools-Rel-xxx_xxxxxx_MX6Q_UPDATER_Vxx\cfg.ini”(Figure1), make sure the name is “Android-SabreSD-eMMC”(Figure2).

Figure 1

Figure 2

2.3.2. Copy Image To Android Directory

Unzip prebuilt-csXXXXXfXXX-vX-android-YYYYMMDD.rar, you will get boot.img, recovery.img, system.img, u-boot.bin,copy them to "Mfgtools-Rel-XXX_XXXXXX_MX6Q_UPDATER_VXX\Profiles\MX6Q Linux Update\OS Firmware\files\android "directory(Figure3).

Figure 3

2.3.3. Using MFGTool

(1)Connect a USB OTG cable from a PC to the USB OTG port on the board.
(2)Boot configure select (0 1 1 0) (Figure4).

Figure 4

(3)Connect 12V-2A power adapter to power port on board.
(4)Run MfgTool2.exe in Mfgtools-Rel-XXX_XXXXXX_MX6Q_UPDATER_VXX directory. (Figure 5)

Figure 5

Figure 6 Prepare to Start

Notes:No Device Connected" indicates that your USB-OTG cable is not ready. Please check it. (Figure 7)

Figure 7 The USB-OTG cable is not connected correctly.

(5) Click “Start ” to download the Image

Figure 8 Loading Kernel and Formatting rootfs partition

Notes:If the PC OS is Window7, there is a message that asks you to format the disk. Please ignore or cancel it.

(6)Click "Stop" to stop download Image and exit. (Figure 9)

Figure 9 Download Image is finished.

2.4. Booting Android OS And Test(USE 7″ as example)

Figure 10 Android Desktop (USE 7″ as example)

2.4.1. SD Test

The SD Card is supported for hot plug. Figure 11 shows the message when you plug the SD card on board, but the SD Card will not be mounted. You can mount it by using the following command.

# mount -t vfat /dev/block/mmcblk1p1 /mnt/extsd/

Figure 11 Serial message

2.4.2. USB Flash Disk Test

The USB Flash Disk is similar to the SD Card , except for the mount point, the USB Flash Disk is mounted to /mnt/udisk

2.4.3. SATA Test

SATA is Not Supported in hot plug, the Android OS supports NTFS. You can use ntfs-3g tool to mount SATA disk partitions:

#ntfs-3g /dev/block/sda1 /mnt/shm/

2.4.4. Network Test

The network uses DHCP to obtain IP Address. You can use the network if the board cable is connected to router. And you can use this command to change the IP Address.

#netcfg eth0 dhcp

2.4.5. Sound Card Test

Please open a sound to test the Sound Card

2.4.6. Video Test

Please open a video to test the Video.

2.4.7. HDMI Test

For HDMI Test just reference IMX6Q U-boot Setting Hdmi Output For Android.pdf.

Notes: HDMI does not support hot plug, and the sound comes from the HDMI monitor, neither the speaker nor the headset on board.

2.4.8. WIFI Test

Please make sure your board has SDIO WIFI module before you test WIFI . If your board has SDIO WIFI Module, just connect to the WIFI and open the browser to test.

2.4.9. ADB Test

You should open the USB debug before you test ADB

Figure 13 Open USB Debug

Keep clicking the “Build number”,and you will  open  “developer options “, like in Figure 15.

Figure 14 Open USB Debug

Figure 15 Developer options

Click the “Developer options” and open the USB Debugging like in Figure 16.

Figure 16 Open USB Debugging

You also use the adb tool to test the adb which you can find in tools directory. Unzip it to the root directory of  PC’s C disk, like in Figure 17

Figure 17 Unzip adb.rar to c:\

You also need to set the environment variable ( see image below).

Connect the USB-OTG cable to PC. You will get a message “Allow USB debugging?”. Please select “Always allow from this computer” and click “OK”.

You can use following command to list the devices attached.

$ adb devices

You can use adb command to install an app from the PC:

$ adb  install  XXX.apk

2.4.10. Touch Screen Test

Run MultiTouchTest App, and the screen will show the number and position of the touch point when you are touching the screen. Resistive screen expansion board only supports single-touch, and capacitive screen expansion board supports five-point touch, as indicated in the Figure below.

Notes: The 21.5 inches, 19 inches, 17 inches capacitive screen supports ten-point touch.

2.4.11. Serial Test

Serial ports in system

Serial Port Driver
COM1(RS232 Debug) /dev/ttymxc0
COM2(RS485) /dev/ttymxc1
COM3(RS232) /dev/ttymxc2
COM4(RS485) /dev/ttymxc3
COM5(RS485) /dev/ttymxc4

Notes:COM2(RS485)share pin with Bluetooth. If you use COM2(RS485), you can’t use Bluetooth.

1. Connect the COM which you want to test on board to PC. Use software “SecureCRT” or “Putty” or some others in the PC. Run “Serial Port” App to communicate with PC. Click “Setup”, set “Device” and “Baud rate” set the device to what you want to test, set Baud rate 115200, as in the following image.

2. Click the “Loopback” You will see something in the PC serial console, like in the following figure.

3. Click the “Console” button, and you can send what you want over the PC’s serial console, and you can receive it from the console on board, as indicated in the image below:

2.4.12. GPIO

For the board CS12800F101, there are 8 gpio ports. You can set them as output or input, the LOW is 0V, the HIGH is 3.3V. Please check “GPIO Connector” in Chipsee_F101C-Manual – V1.0.pdf  to know the position. The following table is the gpio number.

Pin number GPIO number
3 gpio106
4 gpio30
6 gpio95
7 gpio87
8 gpio29
9 gpio28
11 gpio94
12 gpio130

Example: (set gpio106 output, and let it output HIGH or output LOW)

# echo 106 > /sys/class/gpio/export               //export gpio106
# echo out > /sys/class/gpio/gpio106/direction      //set gpio106 output
# echo 1 > /sys/class/gpio/gpio106/value           //set gpio106 output HIGH
# echo 0 > /sys/class/gpio/gpio106/value           //set gpio106 output LOW

Example:(set gpio30 input)

# echo 30 > /sys/class/gpio/export                //export gpio30
# echo in > /sys/class/gpio/gpio30/direction        // set gpio30 input

Example:(set gpio30 unexport)

# echo 30 > /sys/class/gpio/unexport             //unexport gpio30

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  the applications via USB OTG. The following operation is under 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 and set it like in the following figure.

3.Power on the board, and you can see the serial output of information like in the following figure.

4. When the system is fully booted, you can communicate with it.

3.2. Adb connect via USB OTG

Please refer to the 2.4.9 ADB Test chapter to set the ADB. You can use the following command to log in the board and communicate with it.

$ adb shell

The 2.4.9 chapter tell you how to install the app via adb, and in this chapter you can see other adb debug ways.

3.2.1. Use adb command to uninstall user APP.

Use command “pm list” to get the full name of the app, like in the following Figure. Then use the “uninstall” command to uninstall the app.

> adb shell pm list packages

> adb uninstall com.rovio.angrybirds

3.2.2. Use adb command to uninstall default app.

3.2.3 Use the adb command to transport the files between the board and the PC

“adb pull” and “adb push”

Board to PC: <remote> is the file or folder on board, <local> is the file or folder in PC.

>adbpull

PC to board:

>adbpush<local><remote>

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

>adb push chipsee.txt /chipsee.txt

Opposite, board to PC:

>adb pull /testFile.txt testFile.txt

3.3. Adb connect via internet

1. Make sure the 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/8   0x00000049 00:00:00:00:00:00

can0     DOWN          0.0.0.0/0   0x00000080 00:00:00:00:00:00

eth0     UP             192.168.6.176/24  0x00001043 1e:ed:19:27:1a:b3

2. If the Ethernet was not configured, configure the 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 the network is configured successfully (as in the steps above) then restart the 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 device connectivity, by executing the following commands. If connected, find the device name listed as a “IPADDRESS:PORT”

$ adb devices
List of devices attached
192.168.6.176: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.

4.1. Preparation

1. Go to folder <ADT>/eclipse, start eclipse.exe:

2. Click Windows🡪Android SDK Manager:

3. Click Tools🡪Options, check “Force…” and click close:

4. Choose the API, such as Android4.3(API 18), then click button Install packages to start download and install:

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

4.2. Example—HelloWorld

1. Click File🡪New🡪Android Application Project:

2. Click Next until it’s finished. Connect Embedded Industrial Computer to PC via USB cable(A-A), If you were successful with the installation, you will see the device in DDMS window (Windows🡪Open Perspective🡪Other🡪DDMS):

3. You can capture the picture of Android:

4. Click run, choose the device:

5. Result:

Notes: If the USB is not configured 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
For m
https://developer.android.com/guide/index.html
https://developer.android.com/develop/index.html
http://developer.android.com/support.html
http://blog.apptopia.com/android-development-forums/
http://androidforums.com/application-development/

这篇文章对您有用吗?