ARCHERMIND
Helio X20Software User Manual
Revision Date DescriptionV1.0 2016/06/30 Initial DraftV2.0 2016/08/25 Modify Hyperlink
Archermind2016/7/19
ARCHERMIND
2
Contents1. Introduction.............................................................................................................................4
1.1. Purpose............................................................................................................................ 4
1.2. Required Tools................................................................................................................. 4
2. Ubuntu Environment...............................................................................................................5
2.1. Install package dependencies...........................................................................................5
2.2. Install Repo tool...............................................................................................................5
3. Android Development Environment.......................................................................................6
3.1. Android Debug Bridge (ADB).........................................................................................6
3.2. Installing ADB Drivers on Windows host machine........................................................ 6
3.3. ADB Commands Cheatsheet........................................................................................... 7
4. Downloading the Helio X20 SDK..........................................................................................9
5. Prepare.................................................................................................................................. 11
5.1. OS.................................................................................................................................. 11
5.2. Tools.............................................................................................................................. 11
6. Windows Download............................................................................................................. 12
6.1. Prepare........................................................................................................................... 12
6.2. Download.......................................................................................................................12
6.2.1. Make a device to enter fastboot mode.................................................................... 12
6.2.2. Run fastboot command script file...........................................................................13
7. Linux Download................................................................................................................... 14
7.1. Prepare........................................................................................................................... 14
7.2. Download.......................................................................................................................14
7.2.1. Make a device to enter fastboot mode.................................................................... 14
7.2.2. Run fastboot command script file...........................................................................14
8. Appendix...............................................................................................................................16
8.1. How to build special images.......................................................................................... 16
8.2. Q&A...............................................................................................................................16
9. Creating an Android Hello World........................................................................................ 17
ARCHERMIND
3
9.1. Create New Android Project..........................................................................................17
9.2. Create Package...............................................................................................................19
9.3. Create Java Class........................................................................................................... 19
9.4. Create Layout File......................................................................................................... 20
9.5. Run Android Application...............................................................................................21
ARCHERMIND
4
1. Introduction
The Helio X20 initiative is designed to offer a single software and hardware communityacross multiple vendor boards supporting a range of different features. A fixed set of minimumfunctions including USB, SD, HDMI and standardized low speed and high speed peripheralconnectors are provided. Vendors may add customized hardware and feature sets provided theminimum functions are available. We expect this to extend the platform life, increase the marketfor add-on hardware, and accelerate open source upstreaming of support for new SoC features.
1.1. Purpose
This document describes how to obtain, build, and program software applicable to the LinuxAndroid Software Product "as-is" into a reference platform including:
● Setting up a development environment and installing the software.● Building the software and flashing it onto the Helio X20 platform.
1.2.Required Tools
#
Item description Version Source/vendor Purpose
1 Ubuntu Linux (64-bit) 14.04 LTS ornewer
Canonical Android build host OS
2 Windows environment Windows 7 ornewer
Microsoft Windows-basedprogramming tools
3 repo _ Android OpenSource Project
Android sourcemanagement tool
4 Android Studio Android IDE for developingAndroid applications
ARCHERMIND
5
2. Ubuntu Environment
Ubuntu Environment and software develope settings.Install UbuntuRecommend OS : Ubuntu 14.04 (LTS) 64-bitDownload address: http://releases.ubuntu.com/14.04/
2.1. Install package dependencies
Open a terminal and execute the following command:$ sudo apt-get install build-essential g++-multilib libc6-dev lib32ncurses5 lib32ncurses5-devlib32z1 flex bison gperf curl zlib1g zlib1g-dev openjdk-7-jdk tofrodos libxml2-utils
2.2. Install Repo tool
The repo tool is a source code configuration management tool used by the Android project.The repo tool is a frontend to git written in Python. It uses a manifest file to help download codeorganized as a set of projects that are stored in different git repositories.Install repo link url:https://source.android.com/source/downloading.html
ARCHERMIND
6
3. Android Development Environment
Detail install and profile see link url:https://developer.android.com/studio/intro/index.htmlhttps://source.android.com/source/requirements.html
3.1. Android Debug Bridge (ADB)
Android Debug Bridge (adb) is a command line tool that is used to communicate with anAndroid emulator instance or connected Android-powered device. As such it creates theconnection between Android studio and the device.
3.2. Installing ADB Drivers on Windows host machine
Step 1: Plug device into Windows host machineWhen the Google USB driver is installed, plug in your device.Warning: The driver won't install automatically. We will do it manually in the next steps.
Step 2: Navigate to your Device ManagerOpen the System Properties dialog by pressing Win+Break(Pause) on the keyboard, or locate"Computer" in Start Menu, right-click on it and select "Properties". Click on the “DeviceManager” link. (Figure 3.1)
Step 3: Locate Android Device and update driver softwareThis can be done within the “Device Manager”.
a) Right-click on the device, select "Update Driver Software" (Figure 3.2)b) Select "Browse my computer for driver software" (Figure 3.3)c) Select "Let me pick from a list of device drivers on my computer" (Figure 3.4)d) Select "ShowAll Devices" (Figure 3.5)e) Press the "Have Disk" button. (Figure 3.6)f) Enter the path to the Google USB driver. Normally it is located in the following directory
(Figure 3.7)C:\Program Files (x86)\Android\android-sdk\extras\google\usb_driver
g) Select "Android ADB Interface" from the list of device types. (Figure 3.8)h) Confirm the installation of the driver by pressing "Yes". (Figure 3.9)i) Confirm the installation again by pressing "Install". (Figure 3.10)j) When the installation is done, press "Close". (Figure 3.11)
ARCHERMIND
7
Figure 3.1
Figure 3.2Figure 3.3
Figure 3.4 Figure 3.5 Figure 3.6
Figure 3.7Figure 3.8
Figure 3.9
Figure 3.10
Figure 3.11
3.3. ADB Commands Cheatsheet
adb devices View connection device command (Figure 3.12)adb install Install apk command (Figure 3.13)adb uninstall Uninstall apk command (Figure 3.14)adb shell Connect adb command (Figure 3.15)adb push Send file from pc to device command (Figure 3.16)adb pull Send file from device to pc command (Figure 3.17)
ARCHERMIND
8
adb help View help command (Figure 3.18)adb remount Remount the system partition (Figure 3.19)adb root Root privileges (Figure 3.20)adb reboot Restart device (Figure 3.21)
(Figure 3.12) (Figure 3.13) (Figure 3.14)
(Figure 3.15) (Figure 3.16) (Figure 3.17)
(Figure 3.18) (Figure 3.19) (Figure 3.20)
(Figure 3.21)
ARCHERMIND
9
4. Downloading the Helio X20 SDK
This section main introduction how to download the Helio X20 SDK and how to download andcompiler code.Step 1: Download android code
Step 2: Initialize compiler environment$ source build/envsetup.sh
Step 3: Select compile package$ lunch full_amt6797_64_open-eng$ lunch full_amt6797_64_open-user$ lunch full_amt6797_64_open-userdebug
Note:eng ----- root versionuser ----- release versionuserdebug -----development version
Step 4: Compile code
Build all$ make –j$(processes number)
Build preloader$ make pl –j$(processes number)
Build lk$ make lk –j$(processes number)
Make bootimage package$ make bootimage –j$(processes number)
Build android and make system image$ make systemimage –j$(processes number)
Step 5: Clean Command– Clean all• make clean– Clean preloader• make clean-preloader– Clean lk• make clean-lk
ARCHERMIND
10
Step 6: Build android module– m• Examplem libjpeg• build– mm• build– mmm• example: mmm frameworks/base• build– mma• build– mmma<directory>• example: mmma frameworks/base• build
Step 7: Rebuild android module
– mmm -B <directory>• example: mmm -B frameworks/base• rebuild build
Step 8: Build android module by name– make -j24 <module name>• example: make -j24 libjpeg• Module name android.mk LOCAL_MODULE
Step 9: pack boot image– make -j24 bootimage– boot image
Step 10: Build system image– make -j24 systemimage– system imagesystem.img
Step 11: Pack System Image– make -j24 snod– system imagebuild snod system image
Step 12: Pack ota image– make –j24 otapackage
ARCHERMIND
11
5. Prepare
5.1. OS
Microsoft Windows(windows 7 eg.) Linux(Ubuntu eg.)
5.2. Tools
You need prepare 6 components(windows):1. xflash.exe(win)/xflash(linux)2. Normal load(Include image files and scatter file etc.)3. Special images and scatter file(To load board into fastboot mode)4. lib.cfg.xml5. fastboot.exe(win)/fastboot command(linux)6. fastboot command script file
ARCHERMIND
12
6. Windows Download
6.1. Prepare
1) xflash.exe\xflash\bin\win\xflash.exe
2) Normal load(Include image files and scatter file etc.)You can put it in anywhere, eg, \xflash\bin\win\img
3) Special images and scatter fileYou can put it in anywhere, eg, \xflash\bin\win\FES.How to build it, pls see “How tobuild special images”
4) lib.cfg.xml\xflash\bin\win\config
5) fastboot.exe\xflash\bin\win, you shoud put it in normal load folder
6) fastboot command script fileWriten by your self, you should put it in normal load foldereg:fastboot command script file named xflash.batfastboot devicesfastboot flash gpt PGPT****fastboot flash userdata userdata.imgfastboot reboot
6.2. Download
6.2.1. Make a device to enter fastboot mode
Prepare special images and corresponding scatter file. Run program in command line mode like this:xflash.exe enter-fastboot “G:\xflash\bin\win\FES\MT6797_Android_scatter.txt”
ARCHERMIND
13
Then plug in usb to device Xflash will scan and open device COM port and connect it, download some necessary
images to devices, then make device to enter fastboot mode.
6.2.2. Run fastboot command script file
You need write a download script.Such as xflash.bat
fastboot devicesfastboot flash gpt PGPTfastboot flash preloader preloader_amt6797_64_open.binfastboot flash recovery recovery.imgfastboot flash scp1 tinysys-scp.binfastboot flash scp2 tinysys-scp.binfastboot flash lk lk.binfastboot flash lk2 lk.binfastboot flash boot boot.imgfastboot flash logo logo.binfastboot flash tee1 trustzone.binfastboot flash tee2 trustzone.binfastboot flash system system.imgfastboot flash cache cache.imgfastboot flash userdata userdata.imgfastboot reboot
Run the download script, download success
ARCHERMIND
14
7. Linux Download
7.1. Prepare
1) xflash\xflash\bin\linux\xflash
2) Normal load(Include image files and scatter file etc.)You can put it in anywhere, eg, \xflash\bin\linux\img
3) Special images and scatter fileYou can put it in anywhere, eg, \xflash\bin\linux\FES.How to build it? pls see “How to build
special images”
4) lib.cfg.xml\xflash\bin\linux\config
5) fastbootIf your OS doesn't support fastboot command, pls install this command first.
6) fastboot command script fileWriten by your self, you should put it in normal load folder
7.2. Download
7.2.1. Make a device to enter fastboot mode
Prepare special images and corresponding scatter file. Run program in command line mode like this:sudo ./xflash enter-fastboot "/**/xflash/bin/win/FES/MT6797_Android_scatter.txt" Then plug in usb to device Xflash will scan and open device COM port and connect it, download some necessary
images to devices, then make device to enter fastboot mode.
7.2.2. Run fastboot command script file
You need write a download script.Such as xflash.sh#!/bin/bash
ARCHERMIND
15
fastboot devicesfastboot flash gpt PGPTfastboot flash preloader preloader_amt6797_64_open.binfastboot flash recovery recovery.imgfastboot flash scp1 tinysys-scp.binfastboot flash scp2 tinysys-scp.binfastboot flash lk lk.binfastboot flash lk2 lk.binfastboot flash boot boot.imgfastboot flash logo logo.binfastboot flash tee1 trustzone.binfastboot flash tee2 trustzone.binfastboot flash system system.imgfastboot flash cache cache.imgfastboot flash userdata userdata.imgfastboot reboot
Run the download script, download success
ARCHERMIND
16
8. Appendix
8.1.How to build special images
Execute following commands, build system will automatically create FES foldor and comeout the special lk.bin, where FES store the needed files for xflash download to target beforeentering fastboot mode.
#source build/envsetup.sh#lunch full_amt6797_64_open-eng#make -j16 PLATFORM_FASTBOOT_EMPTY_STORAGE=yes -k 2>&1 | tee build.log
Then, you can find a folder named FESPATH : \out\target\product\amt6797_64_open\FES
8.2. Q&A
download partition error. code 0x10004 when run ubuntu xflashsudo apt-get purge modemmanager
ARCHERMIND
17
9. Creating an Android Hello World
This section main introduction how to create "hello world" android project and how to running it.
9.1. Create New Android Project
1) File-->New-->Android Application Project (Figure A.1)
2) Input Application Name、Project Name、Package Name、choose SDK version.click "Next"
button. (Figure A.2)
3) Configure Project ,Click "Next" button. (Figure A.3)
4) Configure the attributes of the icon set,click "Next" button. (Figure A.4)
5) Create Activity,click "Next" button. (Figure A.5)
6) Input Activity Name and Layout Name,click "Finish" button. (Figure A.6)
The directory structure is as follows: (Figure A.7)
src/ Save code area
bin/ Compiled output file area
Gen/ Include the R.java file that is automatically generated by the ADT,please do not modify it.
assets/ Store the original asset file. For example, some documents, wherethe file will retain the original file name is compiled into the.apkfile.
res/ Include application resource area
anim/ Store animation XML
color/ Store color XML
drawable/ Store bitmap file
layout/ Store layout file
menu/ Store menu file
raw/ Store media file
values/ Here can be stored in many types of XML files. Different from otherres/ directory resources. XML files in this folder can not be
ARCHERMIND
18
directly referenced by the file name. But the node in the XML filecan control the name of the R file definition.
xml/ XML file used to configure app components.
libs/ Lib library storage place
AndroidManifest.xml Used to describe the properties of app. For example: set thecharacteristics of components, permissions, etc.
Project.properties The file include project settings
Figure A.1 Figure A.2 Figure A.3
Figure A.4 Figure A.5 Figure A.6
Figure A.7
ARCHERMIND
19
9.2. Create Package
In the project, click the right button to display the pop-up menu. Choose New--->Package
9.3. Create Java Class
1)In the project package, click the right button to display the pop-up menu. Choose New--->Class.
2)Input Class Name and choose superclass with "android.app.Activity"
3)Click "finish" button,open HelloWorldActivity.java file.
4)Override "oncreate" method.Click right click in the blank of the class file.
ARCHERMIND
20
9.4. Create Layout File
1) Create xml layout
2) Add "Textview" control
3)Setting layout to activity
ARCHERMIND
21
9.5. Run Android Application
1) Profile AndroidManifest.xml
2) Run application
3) Show run result