Software Release Notes
Introduction
This document provides information on how to obtain, build, and program QCS605 LA (Linux Android) SDK (Software Development Kit) into the Turbox™ QCS605 SBC. The Linux Android Software Development Kit supports the Android operating system on the Thundercomm Turbox™ SBC (Single Board Computer). The goal of the LA SDK is to provide a simple and flexible development platform to rapidly build IoT products with the QTI chipsets. The LA SDK provides the build framework, software components, tools, and sample applications to evaluate the platform and build software images for the target product.
System Requirements
Table below lists the hardware and software required to install and run the LA SDK.
Hardware / Software Requirements | Source / Vendor | Function |
Standalone hardware system minimum requirement: 16 GB RAM |
- | SDK build machine |
Ubuntu 16.04 LTS Linux distribution for 64 bit architecture | Ubuntu Community/ Canonical, Ltd. | SDK build host OS |
Repository | SDK Open Source Project | SDK source management tool |
Python 2.7.12 with sqlite3 module | Python.org | Building subsystem |
Development Environment Setup
This chapter introduces the setup of a Linux development environment on an Ubuntu host machine.
Prerequisites:
Ensure your host meets the following requirements:
- Host machine Linux distro – 04 LTS
- Minimum 300 GB free disk space
- Tar: V1.27 or newer
- Privileges to install utilities
- Install the host packages
Ubuntu 16.04 (64-bit) installation
- Install ubuntu 16.04 on the computer following the instructions at: http://www.ubuntu.com/download/desktop/install-ubuntu-desktop.
- To update software, execute the following command.
$ sudo apt-get update
Tool and installation
This section provides instructions for installing ADB (Android Debug Bridge) (V1.0.36 or later), Fastboot, and USB drivers to your host computer.
The Fastboot is a tool used to flash images onto the board by communicating with the boot loader.
The ADB is a tool installed on the host computer to access the device Unix shell, then help to push, modify, debug, and tweak device system files from the host computer.
ADB and Fastboot tools installation
To install ADB and Fastboot, execute the following commands:
$ sudo apt-get install android-tools-adb
$ sudo apt-get install android-tools-fastboot
USB driver installation and configuration
To install and configure USB drivers, follow the steps below:
Step1.Login as root/sudo.
$ cd /
Step 2.Navigate to the directory /etc/udev/rules.d/.
$ cd /etc/udev/rules.d/
Step 3.Create the file 99-android.rules.
$ sudo touch 99-android.rules
Step 4.Enter the following command get edit permission to file 99-android.rules.
$ sudo chmod 777 /etc/udev/rules.d/99-android.rules
Step 5.Enter 99-android.rules by running the following command.
$ vim 99-android.rules
Step 6.Input i to enter edit mode and add the following content to the file.
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", MODE="0777", GROUP="adm"
SUBSYSTEM=="usb", ATTR{idVendor}=="05c6", MODE="0777", GROUP="adm"
Step 7.Press ESC key to exit the edit mode.
Step 8.Enter :wq to save the change and exit.
Step 9.Restart the udev service by executing the following commands.
$ sudo chmod a+r /etc/udev/rules.d/99-android.rules
$ sudo service udev restart
Step 10.Connect the board to your computer with an USB cable, and power on the target board to start the system. Wait for several seconds then input $ adb devices
. The device is correctly detected with the following information displayed on your screen.
$ adb devices
List of devices attached
7050372c device
NOTE: Avoid connecting the device to the PC with a USB hub. Connect the device to the PC directly via a USB cable.
Required building environment
Follow the steps below to configure the building environment.
Java 8
Step 1.Check the version. Run the following commands to ensure Java 8 is installed.
$ java -version
openjdk version "1.8.0_131"
OpenJDK Runtime Environment (build 1.8.0_131-8u131-b11-0ubuntu1.16.04.2-b11)
OpenJDK 64-Bit Server VM (build 25.131-b11, mixed mode)
Step 2.Version update. With a 1.7 version preinstalled, run the following commands to upgrade it to version 1.8.
$ sudo apt-get update
$ sudo apt-get install openjdk-8-jdk
NOTE: The Java 8 should be used along with Ubuntu 16.04.
Linux package dependencies
Step 1.Install the dependency libraries to the host computer.
$ sudo apt-get install git-core gnupg flex bison build-essential zip curl zlib1g-dev gcc-multilib g++-multiliblibc6-dev-i386 lib32ncurses5-dev x11proto-core-dev libx11-dev lib32z1-dev libgl1-mesa-devlibxml2-utilsxsltproc unzip fontconfig libxml-simple-perl
Step 2.Set bash as default shell tool.
$ sudo rm /bin/sh
$ sudo ln -sf /bin/bash /bin/sh
NOTE: For more information on building environment dependencies, refer to AOSP documents at: https://source.android.com/setup/build/initializing.
Install repo
Run the following command to install repo.
$ sudo apt-get install repo
Configure git global variable
Configure user name and email.
$ git config --global user.email "<User Email>"
$ git config --global user.name "<User Name>"
NOTE: Replace the <User Email>
and <User Name>
with the email address and user name you have registered at Thundercomm website.
Get Started with SDK
SDK information
Table 4-1 presents the LA SDK information, including the SDK version.
SDK Version | Baseline | Baseline Distribution | OS Version |
LA2.0.ES.r000001 | QCS605.LA.2.0 | Post-CS[2] 0.0.026.1 | Android 08.01.00 |
SDK block diagram
Block Diagram
SDK source tree structure
SDK.Turbox_C610.LA1.0/
├── about.html -> common/about.html SDK version info(Product, Distribution,Components, …)
├── contents.xml -> common/contents.xml image contents file
├── common/config/emmc/partition.xml eMMC partition file
├── LINUX
│ └── android
│ ├── bionic
│ ├── bootable/bootloader/edk2 bootloader sources
│ ├── bootable/recovery recovery sources
│ ├── build basic config files for development kit, such as files for system build rules and generis
│ ├── dalvik
│ ├── developers developer directory
│ ├── development infrastructure-related files for Android application development
│ └── device device related config
│ └── qcom/sm6150 QCS610 device-related config directory
│ ├── external files related to open-source development kit
│ ├── frameworks source code under Android frameworks
│ ├── hardware/qcom code for QCS610 hardware abstraction layer(bootctrl, Display, gps, media, vr, …)
│ ├── kernel
│ │ └── msm-4.14 kernel sources
│ │ ├── arch/arm64/boot/dts/qcom DT source files
│ │ └──arch/arm64/configs/vendor kernel config files
│ ├── libcore core library files
│ ├── libnativehelper dynamic library, which is the basis to JNI library
│ ├── Makefile global Makefile to define build rules
│ ├── packages application packages
│ ├── pdk plug development kit
│ ├── platform_testing platform testing files
│ ├── prebuilts prebuild resources under x86 and arm framework
│ ├── sdk sdk and simulator
│ ├── system underlying file system, application, and component
│ ├── test Android Vendor testing framework
│ ├── toolchain tool chain files
│ ├── tools tools files
│ └── vendor QCOM private repository
│ └── qcom
│ ├── opensource
│ └── proprietary
├── turbox_build.sh -> turbox/tools/build_script/common/turbox_build.sh SDK build file.
├── turbox_flash.sh -> turbox/tools/build_script/device/turbox_flash.sh Fastboot flash tool
├── turbox
│ └── tools
│ ├── build_script SDK build script(android build, zip, …)
│ └── flash_tools Flash tools files(qdl, …)
├── adsp_proc aDSP image is released as a binary and no build compilation is needed
├── aop_proc AOP image is released as a binary and no build compilation is needed
├── boot_images BOOT image is released as a binary and no build compilation is needed
├── btfm_proc BTFM image is released as a binary and no build compilation is needed
├── btfm_proc_CMC BTFM_CMC image is released as a binary and no build compilation is needed
├── cdsp_proc cDSP image is released as a binary and no build compilation is needed
├── modem_proc MODEM image is released as a binary and no build compilation is needed
├── trustzone_images TZ image is released as a binary and no build compilation is needed
├── venus_proc VIDEO image is released as a binary and no build compilation is needed
├── wdsp_proc wDSP image is released as a binary and no build compilation is needed.
└── wlan_proc WLAN image is released as a binary and no build compilation is needed.
Download SDK
Follow the steps below to activate an account and download the SDK code.
Account activation
Add the account/password information to $HOME/.netrc by running the following command.
$ echo "machine partner.thundercomm.com login <User Email> password <password>" >> ~/.netrc
NOTE: Please use the email and password you have registered at thundercomm.com to replace <User Email>
and <password>
in the above command.
Download the SDK code
Follow the steps below to download the SDK code.
Step 1.Initialize the repository.
$ repo init -u https://partner.thundercomm.com/sdkgit/a/manifest -b SDK.Turbox-QCS605.LA.2.0 -m turbox-qcs605-la2.0-dev.es.r000001.xml --repo-url=https://partner.thundercomm.com/sdkgit/a/tools/repo --repo-branch=stable --no-repo-verify
Step 2.Synchronize the source code.
$ repo sync -c -j4 --no-tags
SDK version update
If you have downloaded the old-version SDK, there are two ways to download the new SDK fast.
- Upgrade the local old folder to a new release
Navigate to the old local code folder, you can run the repo init command of new release as Download the SDK code, then run repo sync -j4 -c --no-tags
to receive the new code.
- Download the new release to new a folder (recommended)
Create a new folder, and run repo init with –reference
value.
For example:
$ repo init -u https://partner.thundercomm.com/sdkgit/a/manifest -b SDK.Turbox-QCS605.LA.2.0 -m turbox-qcs605-la2.0-dev.es.r000001.xml --repo-url=https://partner.thundercomm.com/sdkgit/a/tools/repo --repo-branch=stable --no-repo-verify --reference=<old_sdk_code_path>
$ repo sync -j4 -c --no-tags
NOTE: In --reference=<old_sdk_code_path>
, the old_sdk_code_path
is the absolute path of your old sdk folder. For example: --reference=/home/host/turbox-c610-le1.0-dev.es.r000002
Build images
To compile code, run the following script file in the root directory of source code for building userdebug version.
$ ./turbox_build.sh -a -l -v userdebug
Pack ROM package
Step 1.Run the following command to update common info for userdebug
$ ./turbox_build.sh -u -v userdebug
NOTE: The command executes successfully with the following log displaying on shell.
- update_common_info.py:====== UPDATE COMMON INFO COMPLETE=======
Step 2.Run the following command to pack the ROM package. You can find the ROM package at turbox/output.
Step 3.Pack Fastboot image
$ ./turbox_build.sh --zip_fastboot_build -l -v userdebug
Step 4.Pack Flat image
$ ./turbox_build.sh --zip_flat_build -l -v userdebug
NOTE: Customers can also get ROM package provided by Thundercomm from
MD5: 5eb7ce81d075f000ba2d9d85185e436b
MD5: 5a920074d3b5fbf832002b7ce06717e8
Flash images to board
NOTE: If the device fails to boot up after image flash with Fastboot, try to flash the FlatBuild image again with turbox_flash.sh.
Flash Fastboot images
Step 1.Enter the following command when the device in ADB mode.
$ adb root
$ adb reboot bootloader
Step 2.To enter the fastboot mode, power off the device, hold the Volume Down (VOL-) button and click the Power ON button, then release the Volume Down (VOL-) button about 5 seconds later.
NOTE: To check if the device has entered the Fastboot mode, run the following command:
$ sudo fastboot devices
Successful with the following output displaying on the shell.
21f10525 fastboot
Step 3.Execute the commands below to flash images to the board.
$ cd FastbootBuild_TurboX_C605_xx.xx_LA2.0.R.userdebug.ES.r000001
$ sudo ./turbox_flash.sh --all -r -f
NOTE: Enter ./turbox_flash.sh -h
to acquire detailed usage.
$ ./turbox_flash.sh -h
Usage:
bash ./turbox_flash.sh [options] [options]
The images except gpt,userdata,persist will be flashed if no options input
Description:
flash images with fasboot
Options:
-h, --help display this help message
-f, --force gpt,persist and userdata will be flashed forcely.
User data and calibration data(BT/WIFI MAC address, etc..) will be ereased.
-r, --reboot reboot the device automatically after flashing completed.
-b, --nonhlos flash all bp images(xbl,rpm,ftfm,tz,dsp,modem).
-a, --hlos flash all ap images(aboot,bootimage,recovery,system,vendor,cache,mdtp).
--all flash all images.
--xbl flash xbl image.
--rpm flash rpm image.
--aop flash aop image.
--btfm flash ftfm image.
--tz flash all trustzone images.
--dsp flash dsp image.
--modem flash modem image.
--aboot flash aboot image.
--bootimage flash bootimage(kernel image).
--system flash system image.
--cache flash cache image.
--persist flash persist image.
--userdata flash userdata image.
--devcfg flash devcfg image.
Example:
./turbox_flash.sh
Flash the images except gpt,userdata,persist.
./turbox_flash.sh --force
Flash all images.
./turbox_flash.sh --hlos
Flash all ap images.
./turbox_flash.sh --system
Flash system image.
Flash FlatBuild images
Step 1.Download the turbox_flash_flat.sh tool from: https://thundercomm.s3.ap-northeast-1.amazonaws.com/shop/doc/common/turbox_flash_flat.sh.
Step 2.Flash the device
Step 3.Prepare the FlatBuild images.
Check if the images are ready, then copy the turbox_flash_flat.sh to the images folder.
$ cp turbox_flash_flat.sh FlatBuild_TurboX_C605_xx.xx_LA2.0.R.userdebug.ES.r000001
$ cd FlatBuild_TurboX_C605_xx.xx_LA2.0.R.userdebug.ES.r000001
$ chmod +x turbox_flash_flat.sh
Step 4.Enter 9008 Mode.
- Power off the the device by disconnecting the power cable and USB cable.
- Connect the power cable.
- Hold the USB Boot button.
- Press the Power button and wait for about 3 seconds.
- Release the USB Boot button and Power button.
- Connect the Type-C USB cable to an Ubuntu computer.
To check if your device has entered the 9008 Mode, run the following command:
$ lsusb
……
Bus 001 Device 042: ID 05c6:9008 Qualcomm, Inc. Gobi Wireless Modem (QDL mode)
…… .
Step 5.Start to flash the FlatBuild images.
Run the following command in emmc under the FlatBuild_TurboX_C605_xx.xx_LA2.0.R.userdebug.ES.r000001 folder.
$ sudo ./turbox_flash_flat.sh -x patch0.xml,rawprogram_unsparse0.xml -f ./prog_firehose_lite.elf -i ./ -s eMMC
If the flashing process is successful, the following log will be printed.
15:41:09: INFO: _ (done)
15:41:09: INFO: | |
15:41:09: INFO: __| | ___ _ __ ___
15:41:09: INFO: / _` |/ _ \| '_ \ / _ \
15:41:09: INFO: | (_| | (_) | | | | __/
15:41:09: INFO: \__,_|\___/|_| |_|\___|
15:41:09: INFO: {All Finished Successfully}
15:41:09: INFO: Overall to target 201.617 seconds (20.88 MBps)
15:41:09: INFO: {percent files transferred 100.00%}
Step 6.Reboot the device.
- Power off the device by disconnecting the power cable and USB cable.
- Connect the power cable to the board.
- Hold the Power On button and wait for about 3 seconds.
- Connect the Type-C USB cable and check the adb device by implement the following command.
$ adb devices
List of devices attached
b237534 device