You are on page 1of 50

UUser’s Manual Forlinx Embedded Technology Co. Ltd.www.forlinx.

com

FETA40i-C/ FETT3-C OKA40i-C/ OKT3-C

ARM Cortex- A7

Embedded Development Platform

Android Manual
Rev.1.1
Oct, 2019

Forlinx Embedded Technology Co. Ltd. www.forlinx.net


Android_UM
FETA40i-C/ OKA40i-C

ATTENTIONS

Hot-plug of core board and peripheral modules is strictly prohibited.


Please follow all the warnings and instructions marked on the product.
Please always keep the product dry. Once it is splashed or immersed by any liquid, cut off
the power and dry it out immediately.
Please store and operate the product in ventilating conditions to avoid damages brought by
overhigh temperature.
Please do not use or store the product in dusty or untidy conditions.
Please do not use or store the product in alternate cold and hot conditions to avoid
condensing which will damage components.
Please do not treat the product rudely. Any falling-off, knocking and violate shaking may
cause destruction to circuit and components.
Please do not clean the product with organic solvents or corrodible liquids.
Please do not dismantle or repair the product by yourself. Contact us when the product
malfunctions.
Please do not modify the product by yourself or use accessories unauthorized by us.
Otherwise, the damage caused by that will be on your part and not included in guarantee
terms.

Contact Forlinx Technical Support if you have any questions.

- 2 - www.forlinx.net
Android_UM
FETA40i-C/ OKA40i-C

Technical Support and Updating

1. Technical Support
1.1 Information about our company’s software and hardware
1.2 Problems related to our software and hardware manuals
1.3 After-sale technical support for OEM and ODM
1.4 Requirement of source code and other info which is lost or updated
1.5 Malfunction diagnose and other after-sale services

2. Range of Technical Discussion ( non-compulsory)


2.1 Modification and comprehension of source code
2.2 How to port OS
2.3 Software and hardware problems occured in self-modifying and programming

3. Accesses to Technical Support


3.1 Tel (non-instant messenger): 0312-3119192
3.2 Email address (non-instant messenger) :
3.2.1. About Linux: linux@forlinx.com
3.2.2. About WinCE: wince@forlinx.com
3.2.3. About Android: android@forlinx.com

4. Timetable for Technical Support


9:00am to 11:30am, 13:30pm to 17:00pm, Monday to Friday
Support will not be available on public holidays. Please send your questions to the email
addresses above or Column Technical Support in forum. We’ll reply as soon as we are back.

5. Accesses to Materials
Board related technical files will be provided via a dropbox download link

- 3 - www.forlinx.net
Android_UM
FETA40i-C/ OKA40i-C

Copyright Announcement

All rights with this manual are reserved by Baoding Forlinx Embedded Technology Co., Ltd.
Without written permissions from us, any form of copying, distributing and reprinting of any part
of this manual is illegal. Consequences led by that are all on the violator’s own risk

- 4 - www.forlinx.net
Android_UM
FETA40i-C/ OKA40i-C
Update Record

Version
Date Update
Manual Carrier board SoM
New supporting to resistive touching;
New supporting to dual-screen playing async;
New supporting to watchdog;
Dec., 2019 V1.1 V1.1/ V1.2 V1.1/ V1.2 New supporting to SPI read and write operations;
New supporting to LED control;
New supporting to GPS;
New supporting to BT module
Oct., 2019 V1.0 V1.1/ V1.2 V1.1/ V1.2 First edition

- 5 - www.forlinx.net
Android_UM
FETA40i-C/ OKA40i-C

Content
ATTENTIONS...............................................................................................................................................- 2 -
Update Record............................................................................................................................................... - 5 -
Content...........................................................................................................................................................- 6 -
Chapter 1 Hardware Features Overview......................................................................................................- 8 -
1.1 Overview of development board....................................................................................................................... - 8 -
1.2 Booting Mode(SD card, OTG, eMMC)............................................................................................................ - 8 -
1.3 Serial Printing Information...............................................................................................................................- 8 -
1.5 LCD Display..................................................................................................................................................... - 10 -
Chapter 2 Testing.........................................................................................................................................- 11 -
2.1 Android GUI..................................................................................................................................................... - 11 -
2.2 Storage(SD card/ USB).................................................................................................................................... - 11 -
2.3 USB Device........................................................................................................................................................- 13 -
2.4 Edit Picture....................................................................................................................................................... - 13 -
2.5 Video Playing.................................................................................................................................................... - 15 -
2.6 Play Music.........................................................................................................................................................- 17 -
2.7 Audio Test..........................................................................................................................................................- 17 -
2.8 Audio Volume Test............................................................................................................................................- 18 -
2.9 4G Network Test...............................................................................................................................................- 19 -
2.10 WiFi Test......................................................................................................................................................... - 19 -
2.11 Ethernet Test................................................................................................................................................... - 21 -
2.12 Backlight Control Test................................................................................................................................... - 23 -
2.13 RTC Test..........................................................................................................................................................- 23 -
2.14 UART Test.......................................................................................................................................................- 24 -
2.15 Camera Test.................................................................................................................................................... - 26 -
2.15.1 DVR test...................................................................................................................................................................... - 26 -
2.15.2 Camera test.................................................................................................................................................................. - 28 -
2.15.3 Camera2 test................................................................................................................................................................ - 29 -

2.16 HDMI Test.......................................................................................................................................................- 31 -


2.17 OTG Test......................................................................................................................................................... - 31 -
2.18 Resistive LCD Test......................................................................................................................................... - 32 -
2.19 Dual-screen Playing Asynchronously Test................................................................................................... - 33 -
2.20 Watchdog Test.................................................................................................................................................- 33 -
2.21 SPI Test............................................................................................................................................................- 34 -
- 6 - www.forlinx.net
Android_UM
FETA40i-C/ OKA40i-C
2.22 LED Test..........................................................................................................................................................- 35 -
2.23 BT Test.............................................................................................................................................................- 36 -
2.24 GPS Test.......................................................................................................................................................... - 36 -
Chapter 3 Android Application Development............................................................................................ - 38 -
3.1 Build Android Application Development Environment............................................................................... - 38 -
3.1.1 Download and Install Android Studio........................................................................................................................... - 38 -
3.1.2 Create Helloworld Project............................................................................................................................................. - 39 -
3.1.3 Overview of Debug Tool............................................................................................................................................... - 41 -

4.1 Install Ubuntu14.04 x64bit and Compiling Environment............................................................................ - 42 -


4.2 Install Source Code Pack.................................................................................................................................- 42 -
4.3 Compile Android.............................................................................................................................................. - 43 -
4.3.1 Preparations................................................................................................................................................................... - 43 -
4.3.2 Fully Compile Android..................................................................................................................................................- 43 -

4.4 Source Code Path............................................................................................................................................. - 46 -


4.5 Code Path..........................................................................................................................................................- 47 -
4.6 Install Android..................................................................................................................................................- 47 -
4.6.1 Update OS image to Board............................................................................................................................................ - 47 -
4.6.2 Install SD Card Flashing Tool....................................................................................................................................... - 50 -

- 7 - www.forlinx.net
Android_UM
FETA40i-C/ OKA40i-C

Chapter 1 Hardware Features Overview


1.1 Overview of development board

1.2 Booting Mode(SD card, OTG, eMMC)


OKA40i-C can support system boot from SD card, OTG and eMMC
Users can flash system to eMMC by OTG or SD card.
Flash image by OTG: run PhoenixSuit-> choose one key to brush-> browse-> switch on and meanwhile
presee FEL(K3) and RESET(K7) keys, then release RESET(K7), the board will get into OTG flashing
mode, and then release FEL(K3) to start flashing, once it’s finished, system will boot from eMMC
automatically.
Flash image by SD card: insert a ready SD card to board, power on the board to start flashing, once
finished, please remove the card from the board, and then re-power on the board or keep pressing power
key, system will boot from eMMC.

Boot mode FEL(K3) status


OTG Pressed
eMMC Released
SD card Released

Note: system will boot from SD card by default, if without a SD card or uboot can not be recognized in SD
card, the board will find uboot in eMMC,

1.3 Serial Printing Information


1. connect development board debug port to PC via RS232.

- 8 - www.forlinx.net
Android_UM
FETA40i-C/ OKA40i-C
2. run hyper terminal and do settings as below

choose connection type

- 9 - www.forlinx.net
Android_UM
FETA40i-C/ OKA40i-C

1.5 LCD Display


OKA40i-C can support a 7’’ RGB display with capacitive touching panel and resolution of 1024x 600, 10.1’’ LVDS
display with capacitive touching panel and resolution of 1280x 800. 7’’ LCD output is the default setting.

- 10 - www.forlinx.net
Android_UM
FETA40i-C/ OKA40i-C

Chapter 2 Testing
2.1 Android GUI
Boot the board for the first time, it will prompt to choose Launcher type

Choose to get below interface

2.2 Storage(SD card/ USB)


Here are two methods to check the mounted storage device.

-> to get below interface


- 11 - www.forlinx.net
Android_UM
FETA40i-C/ OKA40i-C

Udisk is the mounted U-disk, SD cards are the mounted TF card and SD card

Click to check SD card files

2. -> settings-> storage to check the mounted storage device

- 12 - www.forlinx.net
Android_UM
FETA40i-C/ OKA40i-C
Internal shared storage eMMC space is 8GB with 7.3GB used. Portable devices including U-disk, SanDisk SD card and
TF card. We can check files in the devices, take SD card for example as below

2.3 USB Device

Boot system, and mount a USB mouse to host port, we’ll see the cursor and we can do some operations by the
mouse.

2.4 Edit Picture

Copy the picture to be previewed into SD card or U-disk, choose ->

- 13 - www.forlinx.net
Android_UM
FETA40i-C/ OKA40i-C

Choose the folder to preview pictures

Edit a target picture

- 14 - www.forlinx.net
Android_UM
FETA40i-C/ OKA40i-C

Or choose , click the target picture and edit it,

2.5 Video Playing

Prepare a video file and copy it to SD card or U-disk, choose -> , and then choose the target file to play.
Choose “Allow” option for all and then agree the agreement, choose target file to play.

- 15 - www.forlinx.net
Android_UM
FETA40i-C/ OKA40i-C

Choose

Choose mapcard(TF card) and choose target file to play

Users can click the video to choose player

Users can set a certain player to a default option.

- 16 - www.forlinx.net
Android_UM
FETA40i-C/ OKA40i-C
Note: speaker, headphone and HDMI audio card are all enabled and all can output sound.

2.6 Play Music

Copy a prepared music file to SD card or U-disk, choose -> -> Musician, and then choose a target file to play

Note: speaker, headphone and HDMI audio card are all enabled and all can output sound.

2.7 Audio Test

->

- 17 - www.forlinx.net
Android_UM
FETA40i-C/ OKA40i-C

Hit to start audio record and hit it again to stop

Choose finish and save the recorded file, and choose quit to cancel the record.

Audio record finished, choose -> -> playing list-> my record, choose a target file to playback

2.8 Audio Volume Test

-> setting-> device-> volume

- 18 - www.forlinx.net
Android_UM
FETA40i-C/ OKA40i-C
2.9 4G Network Test
OKA40i-C can support EC20 4G wireless network.

Mount a module to carrier board, a SIM card is necessary, power on the board and we’ll see 4G signal available .

Set-> wireless and network-> more-> mobile network-> preferred network type, choose 4G

Then we are available to visit a web page.

Note:
1. 4G wireless module is an optional module, if you need and want to buy it, please contact us to get latest price;
2. When doing 4G wireless network testing, please unplug Ethernet cable and turn off WiFi

2.10 WiFi Test


OKA40i-C can support on-board rtl8723bu module
Note:
1. users just need set it one time and it will be saved automatically;
2. When doing WiFi testing, please unplug Ethernet cable and turn off WiFi

-> settings-> wireless network and Ethernet

- 19 - www.forlinx.net
Android_UM
FETA40i-C/ OKA40i-C

Choose WLAN menu

Users can turn on/ off wifi by the up right corner icon, once it detects available AP, it will be listed on screen

- 20 - www.forlinx.net
Android_UM
FETA40i-C/ OKA40i-C
Choose one trusted AP to connect by input pass code

2.11 Ethernet Test

Insert Ethernet cable, choose -> settings-> wireless and network

Set Ethernet

- 21 - www.forlinx.net
Android_UM
FETA40i-C/ OKA40i-C

DHCP is the default mode. To set it to static IP mode, please set IP address, gateway, DNS1, DNS2 and physical address
as below example
IP:192.168.1.150
Network prefix length:9
gateway:192.168.1.20
DNS1:8.8.8.8
Save the settings

- 22 - www.forlinx.net
Android_UM
FETA40i-C/ OKA40i-C
Note: Once Ethernet is available, WiFi will be disabled

2.12 Backlight Control Test

-> setting-> display-> brightness, slid the scroll to adjust backlight

Default backlight settings are saved in frameworks/base/packages/SettingsProvider/res/values/defaults.xml, brightness


ranges from 0 to 255(0%~ 100%), if set it to 102, then the default backlight brightness will be 40%, see below example
<integer name="def_screen_brightness">102</integer>

2.13 RTC Test

-> setting-> system-> data and time

Note: before the testing please cancel ‘auto update data and time’ and ‘auto update time zone’ options, otherwise, it’s not
able to do the test.

- 23 - www.forlinx.net
Android_UM
FETA40i-C/ OKA40i-C

Set data and time, and cut off the board and power on it again, we’ll see that time updated.

2.14 UART Test


There are six UART ports are available on OKA40i-C/ OKT3-C carrier board, they are DEBUG(RS232),UART2(TTL),
UART3(TTL),UART4(TTL),UART5(RS485),UART7(TTL), and matched device names are ttyS0, (ttyS2), ttyS3,
ttyS4, ttyS5, ttyS7, details are as below
1) Debug port
2) UART2 and UART3 are both 5-wired serial, software interface is ttyS2/ ttyS3, note: UART2 is used for GPS;
3) UART4 and UART7 are 3-wired serial, software interface is ttyS4/ ttyS7;
4) UART5 is RS485, ttyS5;
Here we take UART2 for demonstration
Connect a TTL- RS232 module to connect a computer to UART2(TTL) of OKA40i-C/ OKT3-C, boot system, choose

-> Forlinx-serialtest, to get below testing interface

1. Click Setup icon, set serial port, baud rate and then operate as below

- 24 - www.forlinx.net
Android_UM
FETA40i-C/ OKA40i-C

2. Console

3. Emission

4. Input information to be sent, and the data will be sent out as ASCII. Input information in sending text box and then
send it out, the data will be sent out by serial and will be received by PC.

5. Operation on PC, run serial port testing App

- 25 - www.forlinx.net
Android_UM
FETA40i-C/ OKA40i-C

Please set serial port number, baud rate and data bit according to your real condition.

2.15 Camera Test


OKA40i-C/ OKT3-C can support CMOS camera OV5640, UVC camera and also analog camera.

In Forlinx system, there are camera , DVR and camera2 Apps. For DVR, system will run with

UVC camera and analog camera for the fist channel, if no UVC, analog will be the first channel. To camera application,
when there is UVC, run UVC camera, and when UVC is not available, analog will be the fist channel. Camera2 will take
UVC as rear camera and CMOS-OV5640 will be a front camera.
Mount UVC, OV5640 and TVIN cameras all to the board.

2.15.1 DVR test


UVC camera video0 and analog camera video4 are available

Run DVR testing app

- 26 - www.forlinx.net
Android_UM
FETA40i-C/ OKA40i-C

Hit to start recording, users can hit to lock, and hit again to stop the recording.

Take photos by

Check all recorded video and photos by

, set file storage path, camera resolution and time.

Click the shrinking screen on the bottom right corner to switch front and rear camera.

- 27 - www.forlinx.net
Android_UM
FETA40i-C/ OKA40i-C
2.15.2 Camera test
UVC is enabled by default (video0), if no USB camera plugged to UVC, analogy camera Video4 will be enabled.

When it runs for the first time, it needs to set visiting authority.

Users can do some settings such as network and latency by up right corner menu , users can also set resolution by
slid on screen from left to right.

- 28 - www.forlinx.net
Android_UM
FETA40i-C/ OKA40i-C

Click to set resolution and picture quality.

Settings done, back to main interface by

Set video mode, slid on screen from left to right, and then click to switch to video mode, and hit
to start record.

Note: camera module is an option module, if you need and want to buy it, please contact us to get latest price.

2.15.3 Camera2 test


UVC camera video0 is available by default, switch it to video0 mode to turn OV5640 CSI camera video2.

Choose , the camera turned on is a rear camera.

- 29 - www.forlinx.net
Android_UM
FETA40i-C/ OKA40i-C

Switch it to front camera by - >

Back to main interface to preview picture taken by ov5640

- 30 - www.forlinx.net
Android_UM
FETA40i-C/ OKA40i-C
2.16 HDMI Test
Android system can support HDMI (with audio and video output) together with LCD or LVDS playing synchronously.
Cable type is HDMI typeA.
1. Connect HDMI to board(please make sure your HDMI display has built-in voice box)
2. Power on the board to boot system, we can see there are sync output on HDMI.

2.17 OTG Test


USB OTG is supported by OKA40i-C/ OKT3-C, and it’s available for USB mouse, USB keyboard, U-disk and other
devices, and it plug play no need extra driver.
Connect a USB device to OTG port of the board

Note:
1. Please install ADB
2. ADB source is provided, if it’s not compatible with your PC, please install a compatible one, source path: OKA40iC
OKT3-C/ Android/ tool/ android_usb_driver\.
3. Different systems may detect the device with different names, it doesn’t matter.

- 31 - www.forlinx.net
Android_UM
FETA40i-C/ OKA40i-C
2.18 Resistive LCD Test
Note: the image is based on Forlinx 7’’ resistive LCD module with resolution of 800x 480, in android7 low resolution
mode, it will automatically fit to shrinking screen mode and no back option.
1. Flash OS image and run the system for the first time, calibration is needed.

->

- 32 - www.forlinx.net
Android_UM
FETA40i-C/ OKA40i-C
Hit the screen again to quit calibration and back to main interface
2. We can also do calibration when system is running. Before calibration, please delete the former calibration file rm
/data/etc/pointercal and then restart the board.

2.19 Dual-screen Playing Asynchronously Test


A40i can support LCD or LVDS display together with HDMI display asynchronously. HDMI resolution up to 1080P, and
video form can be H.264 1080P.
1. Copy hd1080p.mp4 to /mnt/sdcard/Movies/hd1080p.mp4
2. Connect HDMI display to board and turn on the device

3. ->

Hit PLAY icon to start playing

2.20 Watchdog Test

-> ->

- 33 - www.forlinx.net
Android_UM
FETA40i-C/ OKA40i-C

Hit Start icon and frequently click Feed icon to feed the dog, once Feeding stopped, system will restart

2.21 SPI Test


1. 1x SPI chip select is supported, node is /dev/spidev2.0
Short circuit MOSI and MISO (pin 8 and 10)

2. -> ->

- 34 - www.forlinx.net
Android_UM
FETA40i-C/ OKA40i-C

2.22 LED Test


Two LED are available on carrier board

-> ->

Hit LED1 and LED2 to control LED5 and LED6 on carrier board.

- 35 - www.forlinx.net
Android_UM
FETA40i-C/ OKA40i-C
2.23 BT Test
There is WiFI& BT module on board, before testing, please fix 2.4G antenna to carrier board, BT name is Realtek
Bluetooth

-> ->

2.24 GPS Test


OKA40i-C/ OKT3-C can support Forlinx GPS& BDS module, connect TTL of the module to ttyS2(UART2) of the board,
install a navigation program, then users can get the positioning information.

- 36 - www.forlinx.net
Android_UM
FETA40i-C/ OKA40i-C

Note: GPS is enabled by default, users can disable it manually.

- 37 - www.forlinx.net
Android_UM
FETA40i-C/ OKA40i-C

Chapter 3 Android Application Development


3.1 Build Android Application Development Environment
3.1.1 Download and Install Android Studio
1. download ANDROID STUDIO from http://www.android-studio.org

2.install it
Finish installation, and system will indicate to upgrade it, the latest version we use is 3.5

3.create a shortcut to desktop and double click to run it

- 38 - www.forlinx.net
Android_UM
FETA40i-C/ OKA40i-C

Note: projects on the left are built by the writer, just ignore them.

3.1.2 Create Helloworld Project


1. run android studio, start a new android studio project

2.create a new project Phone and Tablet

- 39 - www.forlinx.net
Android_UM
FETA40i-C/ OKA40i-C

3.configure the project


Name helloworld
Language java/Kotlin,here the writer chose is java

Choose [Finish], start to build app

4.connect development board to PC Android Studio

- 40 - www.forlinx.net
Android_UM
FETA40i-C/ OKA40i-C
Power on the board, and USB OTG connected to PC USB port

5.emulate to run the program, click the green tangle icon as shown above
6.output logcat to check
Click [Logcat], choose com.example.helloworld

3.1.3 Overview of Debug Tool


https://developer.android.google.cn/studio/profile/monitor

- 41 - www.forlinx.net
Android_UM
FETA40i-C/ OKA40i-C

Chapter 4 Compile Android


4.1 Install Ubuntu14.04 x64bit and Compiling Environment
We kindly suggest users using Ubuntu real machine to install docker, and the code we provide for docker is installed in
Ubuntu14.04 LTS 64-bit system.
Note: computer recommendation: Core(TM)i7, RAM above 8GB
Please refer to OKA40i-C-docker environment guideline

4.2 Install Source Code Pack


Source code pack: lichee, android
Path:
OKA40i-C OKT3-C/ Andriod(A40i V1.1,V1.2)/ Android/ Source code/ lichee\lichee.tar.gz
OKA40i-C OKT3-C/ Andriod(A40i V1.1,V1.2)/ Android/ Source code/ android\xaa
OKA40i-C OKT3-C/ Andriod(A40i V1.1,V1.2)/ Android/ Source code/ android\xab
OKA40i-C OKT3-C/ Andriod(A40i V1.1,V1.2)/ Android/ Source code/ android\xac
OKA40i-C OKT3-C/ Andriod(A40i V1.1,V1.2)/ Android/ Source code/ android\xad
OKA40i-C OKT3-C/ Andriod(A40i V1.1,V1.2)/ Android/ Source code/ android\xae
Note: the source code size is above 3GB, so we partial it to five parts.
Generate directory structure by below command(root authority is needed)
# mkdir -p /root/workspace/allwinner
# cd /root/workspace/allwinner
Copy source code packs to virtual machine or real machine path of /root/workspace/allwinner/

Release Lichee
1. Verify source code pack integrity and compare it with lichee_md5.txt
# md5sum lichee.tar.gz
2. Decompress source code pack
# cd /root/workspace/allwinner/
# tar xvf lichee.tar.gz

Release android
1.Verify source code pack integrity and compare it with android_md5.txt
# md5sum xaa
# md5sum xab
# md5sum xac
# md5sum xad
# md5sum xae
2.generate source code pack
# cat xa* > android.tar.gz
3.Verify source code pack integrity and compare it with android_md5.txt
# md5sum android.tar.gz
4.decompress source code pack
# cd /root/workspace/allwinner/
# tar xvf android.tar.gz

- 42 - www.forlinx.net
Android_UM
FETA40i-C/ OKA40i-C
Verify the released file directory structure
1. /root/workspace/allwinner$ pwd
/root/workspace/allwinner
2.
/root/workspace/allwinner$ ls
android lichee

4.3 Compile Android


4.3.1 Preparations
Note: please make sure swap partition is enough, otherwise, it may cause compiling fail, 4GB is recommended
Check swap partition
$cat /proc/swaps
Here we kindly provide a solution to add swap partition by creating swap file
$sudo fallocate -l 4G /swapfile
$sudo chmod 600 /swapfile
$sudo mkswap /swapfile
$sudo swapon /swapfile
$sudo vim /etc/fstab
At the end of /etc/fstab add below information
/swapfile none swap sw 0 0

4.3.2 Fully Compile Android


Get into source code directory and execute below command
Get into Docker
# cd /root/workspace/allwinner/
root@c4bcf404fa6d:~/workspace/allwinner# pwd
/root/workspace/allwinner
root@c4bcf404fa6d:~/workspace/allwinner# ls
android lichee
1. Configure lichee kernel
Note: v1 stands for SoM version, others stand for applicable for V2 SoM.
$ cd /root/workspace/allwinner/
$cd lichee
$./build.sh config

- 43 - www.forlinx.net
Android_UM
FETA40i-C/ OKA40i-C

2. Lichee compiles kernel


$ ./build.sh
INFO: build lichee OK.
3. Import android compiling environment variable
$ cd /root/workspace/allwinner/android/
$ source build/envsetup.sh
Output
including device/asus/fugu/vendorsetup.sh
including device/generic/mini-emulator-arm64/vendorsetup.sh
including device/generic/mini-emulator-armv7-a-neon/vendorsetup.sh
including device/generic/mini-emulator-mips/vendorsetup.sh
including device/generic/mini-emulator-mips64/vendorsetup.sh
including device/generic/mini-emulator-x86/vendorsetup.sh
including device/generic/mini-emulator-x86_64/vendorsetup.sh
including device/google/dragon/vendorsetup.sh
including device/google/marlin/vendorsetup.sh

- 44 - www.forlinx.net
Android_UM
FETA40i-C/ OKA40i-C
including device/htc/flounder/vendorsetup.sh
including device/huawei/angler/vendorsetup.sh
including device/lge/bullhead/vendorsetup.sh
including device/linaro/hikey/vendorsetup.sh
including device/moto/shamu/vendorsetup.sh
including device/softwinner/a40-OKA40i_C/vendorsetup.sh
including device/softwinner/a40-p1/vendorsetup.sh
including device/softwinner/common/vendorsetup.sh
including device/softwinner/t3-p3/vendorsetup.sh
including sdk/bash_completion/adb.bash
4. Configure android board
$ lunch 24
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=7.1.1
TARGET_PRODUCT=a40_OKA40i_C
TARGET_BUILD_VARIANT=eng
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=arm
TARGET_ARCH_VARIANT=armv7-a-neon
TARGET_CPU_VARIANT=cortex-a7
TARGET_2ND_ARCH=
TARGET_2ND_ARCH_VARIANT=
TARGET_2ND_CPU_VARIANT=
HOST_ARCH=x86_64
HOST_2ND_ARCH=x86
HOST_OS=linux
HOST_OS_EXTRA=Linux-4.15.0-58-generic-x86_64-with-Ubuntu-14.04-trusty
HOST_CROSS_OS=windows
HOST_CROSS_ARCH=x86
HOST_CROSS_2ND_ARCH=x86_64
HOST_BUILD_TYPE=release
BUILD_ID=NMF27D
OUT_DIR=out

5. Copy kernel module and kernel to android


$ extract-bsp
/root/workspace/allwinner/android/device/softwinner/a40-OKA40i_C/bImage copied!
/root/workspace/allwinner/android/device/softwinner/a40-OKA40i_C/modules copied!
Note: when you execute extract-bsp for the first time, it will prompt errors, just skip it, and execute again command of
extract-bsp
6. Compile android system
$ make -j8
Note: parameters behind of j stands for compiling tasks quantity, if it is a 4-core 8-thread CPU, it will be j8

- 45 - www.forlinx.net
Android_UM
FETA40i-C/ OKA40i-C

Note: it may take relative long time for the fist time compiling
7. Pack the image file
$ pack

Note:
1. It may take long time for compiling, it depends;
2. Image path maybe different because of different environment, relative path is lichee/tools/pack

4.4 Source Code Path


Device driver Driver code path in kernel Device name
NIC drivers/net/ethernet/allwinner/ /sys/class/net/eth*
LCD backlight video/sunxi/disp2/disp/
LED drivers/leds/leds-gpio.c /sys/class/leds/
USB disk drivers/usb/storage/ /dev/sdx
USB 3G drivers/usb/serial/ /dev/ttyUSB*
USB camera drivers/media/usb/uvc/uvc_video.c
SD card drivers/mmc/card/ /dev/block/mmcblk0pX
drivers/mmc/host/sun*
LCD framebuffer drivers/video/sunxi/disp2/disp/lcd/ /dev/fb0
Ft5x06 capacitive touch drivers/input/touchsrcreen/ /dev/input/eventx
Gt9xx capacitive touch drivers/input/touchsrcreen/ /dev/input/eventx
Resistive touch TBD
/drivers/input/touchscreen/sunxi/sunxi-ts.c
RTC drivers/rtc/rtc-rx8010.c /dev/rtc0
drivers/rtc/rtc-sunxi.c /*no load*/ /dev/rtc0
UART drivers/tty/serial/sunxi-uart.c /dev/tty*
Watchdog arch/arm/mach-sunxi/sun8i.c /dev/
WIFI drivers/net/wireless/ wlan0
Audio sound/soc/sunxi /dev/snd/
SPI driver drivers/spi/spi-sunxi.c /dev/spidev0.0
Key drivers/input/keyboard/sunxi-keyboard.c
smart card reader drivers/char/sunxi-scr/sunxi-scr.c
OV5640 camera drivers/media/platform/sunxi-vfe/
TVIN drivers/media/platform/sunxi-tvd/
TWI drivers/i2c/i2c-sunxi.c
SATA drivers/ata/ahci_sunxi.c

- 46 - www.forlinx.net
Android_UM
FETA40i-C/ OKA40i-C
4.5 Code Path
HAL code path
Device Source code in android Lib name
uart/RS485 hardware/aw/serialport libserial_port
APP code path
Device Source code in android Note
Camera3 vendor/forlinx/public/package/apps Pre-installed app
MainMenu vendor/forlinx/public/package/apps Pre-installed app
chrome vendor/forlinx/public/package/apps Pre-installed app
Update vendor/aw/private/apk/ Pre-installed app
ESFileExplorer vendor/aw/public/prebuild/apk Pre-installed app
CarletDriverRecorder vendor/aw/public/prebuild/apk Pre-installed app

Device Source code in android Lib name


Camera3.rar Android\testing demo app
MainMenu.zip Android\testing demo app

4.6 Install Android


4.6.1 Update OS image to Board
OS image path:
OKA40i-C OKT3-C/ Android/ OS image/ sun8iw11p1_androidm_a40-OKA40i_C_uart0-1024x600.img
OKA40i-C OKT3-C/ Android/ OS image/ sun8iw11p1_androidm_a40-OKA40i_C_uart0-1280x800.img

USB flash tool path


OKA40i-C OKT3-C/ Android/tool/ phoenixsuit_V1.1.0_20150325.rar
Copy phoenixsuit_V1.1.0_20150325.rar to windows and decompress it, and double click PhoenixSuit_CN.msi to install

- 47 - www.forlinx.net
Android_UM
FETA40i-C/ OKA40i-C
Go to next option and choose browser, and choose installation path, then go to next step

Next

- 48 - www.forlinx.net
Android_UM
FETA40i-C/ OKA40i-C

Then we’ll see PhoenixSuit shortcut on desktop, double click to run

Choose brush the machine option, and choose browse to set image path

- 49 - www.forlinx.net
Android_UM
FETA40i-C/ OKA40i-C
Power on, and meanwhile, press FEL(K3) and RESET(K7) keys, then release RESET(K7) to start OTG flashing mode,
and at last release FEL(K3) to start flashing, below picture indicates flashing done

4.6.2 Install SD Card Flashing Tool


Path: OKA40i-C OKT3-C/ Android/ tool/ PhoenixCard_V310_20130618.rar
Decompress PhoenixCard_V310_20130618.rar to windows, double click PhoenixCard.exe to run it.
Users can use this tool to flash OS iamge to eMMC by SD card.
Flash OS iamge by SD card and system booting from SD card are both supported.
PhoenixCard interface is as below

Mount SD card to PC via a card reader, choose ‘get drive letter’ and then ‘iamge file’ browse A40i firmware image,
choose ‘card mass production’ and then ‘install’, there will be a processing bar during flashing.
Card made, and mount it to board, power on the board to install image by the card, below information indicates flashing
done

- 50 - www.forlinx.net

You might also like