DART-SD410 Android LL 1 1: Difference between revisions

From Variscite Wiki
m (Text replacement - "http://variwiki" to "https://variwiki")
 
(64 intermediate revisions by one other user not shown)
Line 1: Line 1:
{{PageHeader|DART-SD410 Android-LL-5.1.1 Developers Guide}} {{DocImage|category1=DART-SD410|category2=Android}} __toc__
{{PageHeader|DART-SD410 Android-LL-5.1.1 Developers Guide}} {{DocImage|category1=DART-SD410|category2=Android}} __toc__


= Introduction<br/> <br/> =
= Introduction =
 
 


This WIKI describes how to build and deploy Android Lollipop [http://source.android.com/source/build-numbers.html#platform-code-names-versions-api-levels-and-ndk-releases Lollipop-5-1-1] on the DART-SD410. It is based on Qualcomm Android-LL-5.1.1.
This WIKI describes how to build and deploy Android Lollipop [http://source.android.com/source/build-numbers.html#platform-code-names-versions-api-levels-and-ndk-releases Lollipop-5-1-1] on the DART-SD410. It is based on Qualcomm Android-LL-5.1.1.
Line 31: Line 29:
|-
|-
| SOM support
| SOM support
| [http://www.variscite.com/products/system-on-module-som/cortex-a9/var-som-mx6-cpu-freescale-imx6 VAR-SOM-MX6 V2]&nbsp;
| DART-SD410
|-
|-
| Carrier Board support
| Carrier Board support
| [http://www.variscite.com/products/single-board-computers/var-mx6customboard VAR-MX6CustomBoard]
| VAR-DT410CustomBoard
|-
|-
| CPU
| CPU
|  
| Qualcomm - Snapdragon 410 
[http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=i.MX6D&fr=g i.MX6 Dual]
 
|-
| Software platform
|
[http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=i.MX6Q&fpsp=1&tab=Design_Tools_Tab Freescale Android-LL-5.0.0 100]
 
|-
|-
| Nand Recovery
| Resque Image
| nand-recovery SD V39 - can be downloaded from FTP
| Resque Images set can be downloaded from FTP
|-
|-
| eMMC
| eMMC
| up to 64GB
| up to 16GB
|-
|-
| DDR size support configuration
| DDR size support configuration
| Solo:up to 1GB. DualLite, Dual, Quad: up to 4GB
| Up to 2G LPDDR3
|-
|-
| SD-Card
| SD-Card
Line 59: Line 50:
|-
|-
| Wired Network
| Wired Network
| 10/100/1000 Mbps Ethernet
| 10/100 Mbps Ethernet
|-
|-
| Wireless Network
| Wireless Network
| Support for Wilink8, 802.11abgn STA, AP, & Wi-Fi Direct Mode SmartConfig [http://www.ti.com/lsds/ti/wireless_connectivity/wilink/products.page Wilink8 page]
| 802.11abg AP, & Wi-Fi
|-
|-
| Bluetooth
| Bluetooth
Line 72: Line 63:
| I2C
| I2C
| +
| +
|-
| Canbus
| +
|-
| USB host+
|-
|-
| USB OTG
| USB OTG
Line 82: Line 68:
|-
|-
| Uarts
| Uarts
| x3, up to 3.6 Mbps.
| x2
|-
|-
| RTC
| RTC
Line 88: Line 74:
|-
|-
| Display
| Display
| HDMI: 720P,1080P<br/> LVDS0 (On board LVDS-to-RGB bridge, 800x480 resolution), LVDS1 external display < <br/>
| HDMI: 1080P (On board DSI-to-HSMI bridge, 800x480 resolution)<br/> LVDS (On board DSI-to-LVDS bridge, 800x480 resolution)
|-
|-
| Audio
| Audio
| Line IN/ Line out and Audio over HDMI
| Line In & Line out<br/>Mono Speaker<br/>Audio over HDMI
|-
|-
| Camera
| Camera
| ov5640 camera sensor. CB402 board can be ordered separately at&nbsp;: sales@variscite.com
| IMX135 camera sensor. Board can be ordered separately at&nbsp;: sales@variscite.com
|-
|-
| PCIE
| +
|-
| SATA
| +
|}
|}


Line 107: Line 88:
DART-SD410 evaluation kit.
DART-SD410 evaluation kit.


== Host (PC) setup requirements ==
Please refer to [https://variwiki.com/index.php?title=DART-SD410_Android_Host_Install Host requirements installation.]


The host development environment for Android is based on Ubuntu, please install Ubuntu version 14.04 64bit LTS [http://www.ubuntu.com/download/desktop http://www.ubuntu.com/download/desktop]&nbsp;&lt;/br&gt;
= <span style="line-height: 1.5em;">Obtain Variscite's BSP</span> =


At least 60GByte free space.
<span style="line-height: 1.5em;">Please download Android Board Support Package file from Variscite's FTP site.</span> <br/>
Contact [mailto:support@variscite.com Variscite support] for FTP credentials.


== <span style="line-height: 1.5em;"><span style="line-height: 1.5em;">Unpack Variscite's Android Release Package</span></span> ==
<pre>
$ mkdir ~/dart-sd410
$ cd ~/dart-sd410
$ unzip ~/Downloads/variscite_bsp_vla.br_.1.2.4-01810-8x16.0-3.zip
$ cd source/
</pre>


= <span style="line-height: 1.5em;">Download and Build Android Images</span> =
The following commands will download the full Android release from different Git repositories and build the Android images.
It may take a very long time depending on Internel connection, Build machine, and remote servers.
The process may fail fetching the repositories, in this case it can be started again.


=== IMPORTANT ===
<pre>
$ chmod +x SD410c_build.sh
The file SD410c_build.sh can be edited and parameter $BUILD_MACHINE changed to follow the build machine.
The best setting is number of threads of the CPU minus 2.
$ ./SD410c_build.sh
The build system will ask for credentials for repo initialization.
</pre>


Do not use other Ubuntu releases, other than recommended above.
= Rebuild Android Image =
To rebuild the Android run:
<pre>
$ source build/envsetup.sh
$ lunch msm8916_64-userdebug
$ make -j8 WITH_DEXPREOPT=true WITH_DEXPREOPT_PIC=true DEX_PREOPT_DEFAULT=nostripping | tee log.txt


=== For 64-bit Ubuntu 14.04 ===
You can change the number of build threads (-j parameter) to a better number to make the build faster.
</pre>


The complete Android host requirments:&nbsp; [http://source.android.com/source/initializing.html source.android.com/source/initializing.html] Also you can refer to [https://developer.qualcomm.com/qfile/28828/lm80-p0436-2_sw-build-and-install_gd_linux_android_rev_d.pdf Software Build and Installation Guide, Linux Android].
= <span style="line-height: 1.5em;">Flashing newly built images</span> =
The build process creates an out directory and puts all images in the following directory:</br>
''/out/target/product/msm8916_64/</br>
The following image files are created:</br>
'''emmc_appsboot.mbn''' - little kernel (uboot)</br>
'''boot.img''' - kernel and dtb files</br>
'''system.img''' - system folder</br>
The images can be flashed one by one via fastboot.</br>
'''In order to enter fastboot mode cycle the power or press Reset key with Back key pressed.</br>'''
==To flash the whole system==
<pre>
$ cd out/target/product/msm8916_64/
$ sudo fastboot flash aboot emmc_appsboot.mbn
$ sudo fastboot flash persist persist.img
$ sudo fastboot flash userdata userdata.img
$ sudo fastboot flash system system.img
$ sudo fastboot flash recovery recovery.img
$ sudo fastboot flash boot boot.img
</pre>


The following command installs the required packages for setting up the android build host:
==To flash kernel and dtbs==
<pre>First:
Sometimes the changes are done only to the android kernel, in this case there is no need to flash the whole system.</br>
$ sudo apt-get install git gnupg flex bison gperf build-essential \
The kernel and dtb files are located in '''boot.img''' file.</br>
  zip curl libc6-dev libncurses5-dev:i386 x11proto-core-dev \
Flashing it is enough
  libx11-dev:i386 libreadline6-dev:i386 libgl1-mesa-glx:i386 \
<pre>
  libgl1-mesa-dev g++-multilib mingw32 tofrodos \
$ cd out/target/product/msm8916_64/
  python-markdown libxml2-utils xsltproc zlib1g-dev:i386
$ sudo fastboot flash boot boot.img
$ sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/lib/i386-linux-gnu/libGL.so
</pre>
</pre>
In addition to the packages requested on the Android website, the following packages are also needed:


=== Installing the OpenJDK ===
==To flash little kernel==
Sometimes the changes are done only to the bootloader, in this case there is no need to flash the whole system.</br>
The little kernel is located in '''emmc_appsboot.mbn''' file.</br>
Flashing it is enough
<pre>
$ cd out/target/product/msm8916_64/
$ sudo fastboot flash aboot emmc_appsboot.mbn
</pre>


The master branch of Android in the Android Open Source Project (AOSP) requires Java 7. On Ubuntu, use OpenJDK. Be aware that you must use OpenJDK opposed to previous versions that used SUN Java.
=Adding Applications=
==Adding Broswer==
*Download Browser.zip file from Variscite's FTP site into ''~/dart-sd410/source/'' directory.<br>
*The file is located in ''dart-sd410/Software/Android/AdditionalPackages/'' FTP directory<br>
*Extract the downloaded file into your android directory
<pre>
$ cd ~/dart-sd410/source/
$ unzip Browser.zip
</pre>
*Build the Android
*Flash the new Android into the board by fastboot


Java 7: For the latest version of Android
==Adding GPS Test==
<pre>$ sudo apt-get update
*Download GPSTest.zip file from Variscite's FTP site into ''~/dart-sd410/source/'' directory.<br>
$ sudo apt-get install openjdk-7-jdk
*The file is located in ''dart-sd410/Software/Android/AdditionalPackages/'' FTP directory<br>
*Extract the downloaded file into your android directory
<pre>
$ cd ~/dart-sd410/source/
$ unzip GPSTest.zip
</pre>
</pre>
Optionally, update the default Java version by running:
*Add the new package into your board configuration
<pre>$ sudo update-alternatives --config java
<pre>
$ sudo update-alternatives --config javac
$ gedit ./APQ8016_410C_LA.BR.1.2.4-01810-8x16.0_5.1.1_Lollipop_P2/device/qcom/msm8916_64/msm8916_64.mk
</pre>
</pre>
=== Additional packages ===
locate the following lines:<br>
<br>
''PRODUCT_PACKAGES += \''<br>
''    libqcomvisualizer \''<br>
''    libqcompostprocbundle \''<br>
''    libqcomvoiceprocessing''<br><br>
Add a new package to the PRODUCT_PACKAGES<br><br>
''PRODUCT_PACKAGES += \''<br>
''    libqcomvisualizer \''<br>
''    libqcompostprocbundle \''<br>
''    libqcomvoiceprocessing \ '' <br>
''    GPSTest''<br>
<br>
Save the file and exit gedit
*Build the Android
*Flash the new Android into the board by fastboot


In addition to the packages requested on the Android website, the following packages are also needed:
==Adding Geekbench==
<pre>$ sudo apt-get install uuid uuid-dev
Follow the same procedure as for GPSTest to add Geekbench into your image file.
$ sudo apt-get install zlib1g-dev liblz-dev
==Troubleshoot==
$ sudo apt-get install liblzo2-2 liblzo2-dev
If something goes wrong check the following:
$ sudo apt-get install lzop
* The downloaded files should be extracted into ''packages/apps/'' directory verify that the new directory exists
$ sudo apt-get install git-core curl
* Verify that the build process rebuilds the system.img image
$ sudo apt-get install u-boot-tools
* Verify that the fastboot burns the system.img into system partition succsessfully
$ sudo apt-get install mtd-utils
= Customizing hardware =
The DART-SD410 hardware customization should be done by changing DTS files.<br>
This [https://www.raspberrypi.org/documentation/configuration/device-tree.md article]  is very helpful for reading about the DTS files.<br>
The VAR-SD410CustmoBoard DTS files are located in ''kernel/arch/arm/boot/dts/qcom/'' folder.
The DTS file tree is:
<pre>
apq8016-var-sd410.dts
└── apq8016-var-sd410.dtsi
    ├── apq8016-camera-sensor-var-sd410.dtsi
    ├── dsi-panel-var-sd410.dtsi
    └── apq8016-dart.dtsi
        ├── msm8916-pinctrl.dtsi
        └── msm8916.dtsi
            ├── skeleton64.dtsi
            ├── msm8916-coresight.dtsi
            ├── msm8916-smp2p.dtsi
            ├── msm8916-pinctrl.dtsi
            ├── msm8916-ipcrouter.dtsi
            ├── msm-gdsc-8916.dtsi
            ├── msm8916-iommu.dtsi
            ├── msm8916-gpu.dtsi
            ├── msm8916-mdss.dtsi
            │  ├── dsi-panel-sim-video.dtsi
            │  └── dsi-panel-sim-cmd.dtsi
            ├── msm8916-mdss-pll.dtsi
            ├── msm8916-iommu-domains.dtsi
            ├── msm8916-bus.dtsi
            ├── msm8916-camera.dtsi
            ├── msm-pm8916-rpm-regulator.dtsi
            ├── msm-pm8916.dtsi
            ├── msm8916-regulator.dtsi
            └── msm8916-pm.dtsi
</pre>
</pre>
{{note| NOTE:<br>The build machine should have at least 60GB of free space to complete the build process.</span><br>Please refer to the AOSP documentation for latest information and instructions for setting up other Ubuntu versions http://source.android.com/source/initializing.html|info}} Comment for build error: If this is the first time you build on a 64bit machine you may encounter some error releated to lzo library and other. [https://community.freescale.com/thread/303536 https://community.freescale.com/thread/303536] has detail information how to fix this.
= <span style="line-height: 1.5em;">Obtain source code</span> =
<span style="line-height: 1.5em;">Please download Androi Board Support Package file from Variscite's FTP site.</span> Contact [mailto:support@variscite.com Variscite support] for FTP credentials.
== <span style="line-height: 1.5em;"><span style="line-height: 1.5em;">Unpack Freescale's Android Release Package</span></span> ==
<pre><span style="line-height: 1.5em;">$ mkdir ~/var_ll_500_100
$ cd ~/var_ll_500_100
$ tar xvf ~/Downloads/android_L5.0.0_1.0.0-ga_core_source.gz
$ cd android_L5.0.0_1.0.0-ga_core_source/code/
$ tar xvf l5.0.0_1.0.0-ga.tar.gz</span></pre>
== <span style="line-height: 1.5em;">Download Google Android LL5.0.0</span> ==
<span style="line-height: 1.5em;">The Android source code is maintained in more than 100 different gits in the Android repository (android.googlesource.com). </span> <span style="line-height: 1.5em;">To get the Android source code from Google repo, follow the steps below:</span>
<pre><span style="line-height: 1.5em;">$ cd ~/var_ll_500_100
$ mkdir ll_500_100_build
$ cd ll_500_100_build
$ mkdir ~/bin
$ curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
$ chmod a+x ~/bin/repo
$ export PATH=~/bin:$PATH
$ repo init -u https://android.googlesource.com/platform/manifest -b android-5.0.2_r1
$ repo sync
$ cd ~/var_ll_500_100/ll_500_100_build/prebuilts/gcc/linux-x86/arm
$ git clone https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/arm/arm-eabi-4.6
$ cd arm-eabi-4.6
$ git checkout -b android-4.4.3_r1 android-4.4.3_r1
</span></pre>
<span style="line-height: 1.5em;">{{note| NOTE:<br>The above "$ repo sync" command loads most needed repos. Therefore, it can take several hours to load.|info}}</span>
== <span style="line-height: 1.5em;">Download Variscite's u-boot and Linux kernel  </span> ==
$ git clone [https://github.com/varigit/linux-2.6-imx.git https://github.com/varigit/linux-2.6-imx.git] kernel_imx $ cd kernel_imx $ git checkout -b l5.0.0_1.0.0-ga-var01 remotes/origin/l5.0.0_1.0.0-ga-var01
<span style="line-height: 1.5em;">clone&nbsp;the U-Boot git repository from Varicite's open source git:</span>
<pre><span style="line-height: 1.5em;">$ cd ~/var_ll_500_100/ll_500_100_build/bootable/bootloader
$ git clone https://github.com/varigit/uboot-imx.git uboot-imx
$ cd uboot-imx
$ git checkout -b l5.0.0_1.0.0-ga-var01 remotes/origin/l5.0.0_1.0.0-ga-var01
</span></pre>
== <span style="line-height: 1.5em;"><span style="line-height: 1.5em;">Apply all the i.MX Android patches with Freescale i.MX6 support</span></span> ==
<span style="line-height: 1.5em;">The patch script (and_patch.sh) requires some basic utilities like awk/sed.Apply all Android patches by using the following steps: </span>
<pre><span style="line-height: 1.5em;">$ cd ~/var_ll_500_100/ll_500_100_build
$ source ../android_L5.0.0_1.0.0-ga_core_source/code/l5.0.0_1.0.0-ga/and_patch.sh
$ help
You should see that the "c_patch" function is available.
$  c_patch  ../android_L5.0.0_1.0.0-ga_core_source/code/l5.0.0_1.0.0-ga imx_l5.0.0_1.0.0-ga
If everything is OK, "c_patch" generates the following output to indicate the successful patch:
**************************************************************
Success: Now you can build the Android code for FSL i.MX platform
**************************************************************
</span></pre>
<span style="line-height: 1.5em;">{{note| NOTE:
The patch script (and_patch.sh) requires some basic utilities like awk/sed. If they are not available on the computer running Linux OS, install them first.|info}}</span>
== <span style="line-height: 1.5em;"><span style="line-height: 1.5em;">Install Freescale i.MX6 omxplayer support</span></span> ==
<span style="line-height: 1.5em;">The patch script (and_patch.sh) requires some basic utilities like awk/sed.Apply all Android patches by using the following steps: </span>
<pre><span style="line-height: 1.5em;">$ cd ~/var_ll_500_100/ll_500_100_build
$ cp ~/Downloads/android_L5.0.0_1.0.0-ga_omxplayer_source.tar.gz ./
$ tar xzvf android_L5.0.0_1.0.0-ga_omxplayer_source.tar.gz
$ rm android_L5.0.0_1.0.0-ga_omxplayer_source.tar.gz
</span></pre>
== <span style="line-height: 1.5em;">Apply VAR-SOM-MX6 patches </span> ==
    <span style="line-height: 1.5em;">After you setup your build machine,unpack Variscite's release Package:</span>   
<pre><span style="line-height: 1.5em;">$&nbsp;cd ~/var_ll_500_100
$ tar xvf ~/Downloads/var_L5.0.0_1.0.0_r3.tar.bz2
$ variscite/install
</span></pre>
== <span style="line-height: 1.5em;">Install Freescale i.MX6 additional codecs support </span> ==
<pre><span style="line-height: 1.5em;">$ cd ~/var_ll_500_100/ll_500_100_build
$ tar xvf ~/Downloads/fsl_aacp_dec_L5.0.0_1.0.0-ga.tar.gz
$ cp -r fsl_aacp_dec/ external
$ rm -rf fsl_aacp_dec/
</span></pre> 
= <span style="line-height: 1.5em;">Build Android Images</span> =
<span style="line-height: 1.5em;">Change to Android top level directory.</span>
<pre><span style="line-height: 1.5em;">$ cd ~/var_ll_500_100/ll_500_100_build
$ source build/envsetup.sh
$ lunch var_mx6-user
or
$ lunch var_mx6-eng
</span></pre>
<span style="line-height: 1.5em;">{{note| NOTE:<br/>var_mx6-user creates a production version of the Android Lollipop.
var_mx6-eng creates an engineering version of the Android Lollipop. Development mode enable and development tools are available on target.
|info}}</span>
== <span style="line-height: 1.5em;">Switch from eMMC build to SD card build and vice versa</span> ==
<span style="line-height: 1.5em;">When you switch your target MMC device you need to remove the fstab file. This will guarantee that the make system will copy the right one into target.</span>
<pre><span style="line-height: 1.5em;">$ rm out/target/product/var_mx6/root/fstab.freescale
</span></pre>
== <span style="line-height: 1.5em;">Build Android for SD card</span> ==
<pre><span style="line-height: 1.5em;">$ make -j4 BUILD_TARGET_DEVICE=sd 2>&1 | tee build1-1.log</span></pre>
== <span style="line-height: 1.5em;">Build Android for eMMC</span> ==
<pre><span style="line-height: 1.5em;">$ make -j4 BUILD_TARGET_DEVICE=emmc 2>&1 | tee build1-1.log</span></pre>
<span style="line-height: 1.5em;">{{note| NOTE: Set -j4 to a suitable number. A good practice is to set it to number of threads of you build machine minus 1.
|info}}</span>
== <span style="line-height: 1.5em;">Flash Android SD card</span> ==
<span style="line-height: 1.5em;">{{note| NOTE: A newer version of var-mksdcard.sh is available on the FTP site.
|info}} Format only SD card:</span>
<pre><span style="line-height: 1.5em;">$ sudo ./var-mksdcard.sh /dev/sdX;sync</span></pre>
<span style="line-height: 1.5em;">Flash only Android onto SD card:</span>
<pre><span style="line-height: 1.5em;">$ sudo ./var-mksdcard.sh -np -nf -f som-mx6q-c /dev/sdX;sync</span></pre>
<span style="line-height: 1.5em;">Format and flash Android onto SD card (SD card was formated before):</span>
<pre><span style="line-height: 1.5em;">$ sudo ./var-mksdcard.sh -f som-mx6q-c /dev/sdX;sync</span></pre>
*<span style="line-height: 1.5em;">Replace /dev/sdX with your true device, You can identify it with dmesg.</span>
*<span style="line-height: 1.5em;">Replace som-mx6q-c with you actual configuration. See description in section [http://variwiki.com/index.php?title=VAR-SOM-MX6_Android_LL1_R01#Images_created_by_the_Android_build_for_Variscite_MX6_system Images created by the Android build for Variscite MX6 system]</span>
== <span style="line-height: 1.5em;">Flash Android onto eMMC</span> ==
<span style="line-height: 1.5em;">Flashing Android is a complex task that require multiple commands. Variscite provides nand-recovery SDCARD that does that. It format the eMMC flash the boot device and flash Android. Please use the nand-recovery SDCARD copy your Android product into /media/rootfs/opt/images/Android/Emmc. Boot from SDCARD and use the GUI to flash Android or type android-emmc.sh on the command line.</span>
== <span style="line-height: 1.5em;">Build for NAND</span> ==
<span style="line-height: 1.5em;">{{note| NOTE: Due to android file system size This version only support build to SD card and eMMC.
|info}}</span>
== <span style="line-height: 1.5em;">Images created by the Android build for Variscite MX6 system</span> ==
<span style="line-height: 1.5em;">If you do ls out/target/product/var_mx6/<br/> <br/></span>
<br/>
{| class="wikitable"
|-
! scope="col" | <span style="line-height: 1.5em;">Image<br/> <br/></span>
! scope="col" | <span style="line-height: 1.5em;">Description<br/><br/> <br/><br/></span>
|-
| <span style="line-height: 1.5em;">system.img</span>
| <span style="line-height: 1.5em;">Android system image file.<br/><br/><br/>SOM agnostics. <br/><br/><br/></span>
|-
| <span style="line-height: 1.5em;">u-boot-var-imx6-nand.img</span>
| <span style="line-height: 1.5em;">u-boot for nand used in eMMC boot.<br/><br/><br/><br/>SOM agnostics. <br/><br/><br/><br/></span>
|-
| <span style="line-height: 1.5em;">u-boot-var-imx6-sd.img</span>
| <span style="line-height: 1.5em;">u-boot for SD card boot.<br/><br/><br/><br/><br/>SOM agnostics. <br/><br/><br/><br/><br/></span>
|-
| <span style="line-height: 1.5em;">boot-&lt;name&gt;-&lt;touch&gt;.img<br/>recovery-&lt;name&gt;-&lt;touch&gt;.img</span>
|
|-
| <span style="line-height: 1.5em;">&lt;name&gt; is one of:</span>
| <span style="line-height: 1.5em;">som-mx6q - Support VAR-SOM-MX6Q and VAR-SOM-MX6D<br/>som-mx6dl - Support VAR-SOM-MX6DL and VAR-SOM-SOLO<br/>som-solo - Support SOM-SOLO and SOM-DUAL</span>
|-
| <span style="line-height: 1.5em;">&lt;touch&gt; - is "r" or "c"</span>
| <span style="line-height: 1.5em;">r = resistive touch display<br/>c = capacitive touch dispaly</span>
|-
! scope="col" | <span style="line-height: 1.5em;">Image Name<br/><br/><br/><br/><br/><br/> <br/><br/><br/><br/><br/><br/></span>
! scope="col" | <span style="line-height: 1.5em;">SOM type<br/><br/><br/><br/><br/><br/><br/> <br/><br/><br/><br/><br/><br/><br/></span>
! scope="col" | <span style="line-height: 1.5em;">Carrier Board type<br/><br/><br/><br/><br/><br/><br/><br/> <br/><br/><br/><br/><br/><br/><br/><br/></span>
! scope="col" | <span style="line-height: 1.5em;">LCD Type<br/><br/><br/><br/><br/><br/><br/><br/><br/> <br/><br/><br/><br/><br/><br/><br/><br/><br/></span>
! scope="col" | <span style="line-height: 1.5em;">Evaluation Kit name<br/><br/><br/><br/><br/><br/><br/><br/><br/><br/> <br/><br/><br/><br/><br/><br/><br/><br/><br/><br/></span>
|-
| <span style="line-height: 1.5em;">boot-som-mx6q-c.img, recovery-som-mx6q-c.img</span>
| <span style="line-height: 1.5em;">VAR-SOM-MX6_V2 (Quad / Dual)</span>
| <span style="line-height: 1.5em;">VAR-MX6CustomBoard</span>
| <span style="line-height: 1.5em;">Capacitive touch</span>
| <span style="line-height: 1.5em;">VAR-DVK-MX6_V2-PRO<br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/>VAR-STK-MX6_V2 <br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/></span>
|-
| <span style="line-height: 1.5em;">boot-som-mx6q-r.img, recovery-som-mx6q-r.img</span>
| <span style="line-height: 1.5em;">VAR-SOM-MX6_V2 (Quad / Dual)</span>
| <span style="line-height: 1.5em;">VAR-MX6CustomBoard</span>
| <span style="line-height: 1.5em;">Resistive touch</span>
| <span style="line-height: 1.5em;">VAR-DVK-MX6_V2<br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/>VAR-STK-MX6_V2 <br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/></span>
|-
| <span style="line-height: 1.5em;">boot-som-mx6q-vsc.img, recovery-som-mx6q-vsc.img</span>
| <span style="line-height: 1.5em;">VAR-SOM-MX6_V2 (Quad / Dual)</span>
| <span style="line-height: 1.5em;">VAR-SOLOCustomBoard</span>
| <span style="line-height: 1.5em;">Capacitive LVDS touch</span>
| <span style="line-height: 1.5em;">N/A</span>
|-
| <span style="line-height: 1.5em;">boot-som-mx6dl-c.img, recovery-som-mx6dl-c.img</span>
| <span style="line-height: 1.5em;">VAR-SOM-MX6_V2 (DualLite/ Solo)</span>
| <span style="line-height: 1.5em;">VAR-MX6CustomBoard</span>
| <span style="line-height: 1.5em;">Capacitive touch</span>
| <span style="line-height: 1.5em;">N/A</span>
|-
| <span style="line-height: 1.5em;">boot-som-mx6dl-r.img, recovery-som-mx6dl-r.img</span>
| <span style="line-height: 1.5em;">VAR-SOM-MX6_V2 (DualLite/ Solo)</span>
| <span style="line-height: 1.5em;">VAR-MX6CustomBoard</span>
| <span style="line-height: 1.5em;">Resistive touch</span>
| <span style="line-height: 1.5em;">N/A</span>
|-
| <span style="line-height: 1.5em;">boot-som-solo-vsc.img, recovery-som-solo-vsc.img</span>
| <span style="line-height: 1.5em;">VAR-SOM-SOLO / VAR-SOM-DUAL</span>
| <span style="line-height: 1.5em;">VAR-SOLOCustomBoard</span>
| <span style="line-height: 1.5em;">Capacitive LVDS touch</span>
| <span style="line-height: 1.5em;">VAR-DVK-SOLO/DUAL<br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/>VAR-STK-SOLO/DUAL <br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/></span>
|-
| <span style="line-height: 1.5em;">boot-som-solo-c.img, recovery-som-solo-c.img</span>
| <span style="line-height: 1.5em;">VAR-SOM-SOLO / VAR-SOM-DUAL</span>
| <span style="line-height: 1.5em;">VAR-MX6CustomBoard</span>
| <span style="line-height: 1.5em;">Capacitive touch</span>
| <span style="line-height: 1.5em;">N/A</span>
|-
| <span style="line-height: 1.5em;">boot-imx6q-var-dart.img</span>
| <span style="line-height: 1.5em;">DART-MX6</span>
| <span style="line-height: 1.5em;">VAR-DT6CustomBoard</span>
| <span style="line-height: 1.5em;">Capacitive touch</span>
| <span style="line-height: 1.5em;">VAR-STK-DT6<br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/>VAR-DVK-DT6 <br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/></span>
|}
<br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/>
= <span style="line-height: 1.5em;">Boot</span> =
<span style="line-height: 1.5em;">The Android can be booted from MMC/SD device on sdcard and MMC/SD device on eMMC.&nbsp; nand-recovery version 37 support the nand and eMMC flash.</span>
== <span style="line-height: 1.5em;">Boot From MMC/SD Card<br/> <br/></span> ==
<br/>
<span style="line-height: 1.5em;">This section will guide you through the process of installing and boot VAR-SOM-MX6 from SD/MMC device.</span>
<span style="line-height: 1.5em;">Create bootable SD card Variscite provides a script that can be used to partition an SD card and install the required images on it.</span>
*<span style="line-height: 1.5em;">Insert a micro SD into your Linux PC</span>
*<span style="line-height: 1.5em;">Determine the block device name of your micro SD (for instance /dev/sdc). Use "dmesg" after you inserted the SD card.</span>
*<span style="line-height: 1.5em;">Make sure all partitions of your micro SD are unmounted. Use "sudo umount /media/&lt;uname&gt;" to unmount it.</span>
*<span style="line-height: 1.5em;">cd ~/var_ll_500_100/ll_500_100_build</span>
*<span style="line-height: 1.5em;">sudo ./var-mksdcard.sh /dev/sdX (replace /dev/sdX with your SD card block device)</span>
<span style="line-height: 1.5em;">Use the created SD card and:</span>
*<span style="line-height: 1.5em;">Insert the SD card you just created into the MMC/SD slot on the custom board.</span>
*<span style="line-height: 1.5em;">Press and hold the boot-select button and power-on the SOM.</span>
== <span style="line-height: 1.5em;">Boot From eMMC</span> ==
<span style="line-height: 1.5em;">Flashing the U-Boot, boot image and Android root file system into NAND/eMMC can be done from target Linux shell. The images &nbsp;can be found at Android build machine under: "'''out/target/product/var_mx6'''". Boot the target device using Variscite's pre-build NAND recovery SD image version 37or greater, then follow the instructions below:</span>
<pre><span style="line-height: 1.5em;">$ android_emmc.sh
</span></pre>
= <span style="line-height: 1.5em;">Manual operations</span> =
== <span style="line-height: 1.5em;">Build boot.img</span> ==
<span style="line-height: 1.5em;">We use boot.img and booti as default commands to boot rather than the uramdisk and uImage.<br/>You can use this command to generate boot.img under android environment: <br/></span>
<br/><pre><span style="line-height: 1.5em;">$  cd ~/var_ll_500_100/ll_500_100_build
$ source build/envsetup.sh
$ lunch var_mx6-user
$ make bootimage
</span></pre>
== <span style="line-height: 1.5em;">Toolchain setup for manual build kernel and u-boot</span> ==
<span style="line-height: 1.5em;">Setup the toolchain path to point to arm-eabi- tools in prebuilts/gcc/linux-x86/arm/arm-eabi-4.6/bin</span>
<pre><span style="line-height: 1.5em;">$ export ARCH=arm
$ export PATH=export PATH=~/var_ll_500_100/ll_500_100_build/prebuilts/gcc/linux-x86/arm/arm-eabi-4.6/bin:$PATH
$ export CROSS_COMPILE=arm-eabi-
</span></pre>
== <span style="line-height: 1.5em;">Manual build Bootloader&nbsp;</span> ==
<span style="line-height: 1.5em;">Change directory to u-boot</span>
<pre><span style="line-height: 1.5em;">$ cd ~/var_ll_500_100/ll_500_100_build/bootable/bootloader/uboot-imx </span></pre>
<span style="line-height: 1.5em;">Execute following commands:</span>
<pre><span style="line-height: 1.5em;">$ make ARCH=arm distclean
$ make mx6_var_som_sd_android_config    # VAR-SOM-MXQ/D/DL/S, boot from MMC
$ make mx6_var_som_nand_android_config  # VAR-SOM-MXQ/D/DL/S, boot from NAND
$ make -j4 </span></pre>
<span style="line-height: 1.5em;"><br/>This command will generate the u-boot Image 'u-boot.img' <br/></span>
<br/>
== <span style="line-height: 1.5em;">Manual build Android Linux Kernel and modules</span> ==
<span style="line-height: 1.5em;">Change directory to kernel</span>
<pre><span style="line-height: 1.5em;">$ cd ~/var_ll_500_100/ll_500_100_build/kernel_imx </span></pre>
<span style="line-height: 1.5em;">Execute following commands</span>
<pre><span style="line-height: 1.5em;">$ make distclean
$ make imx_v7_var_android_defconfig
$ make -j4 uImage
$ make -j4 modules
</span></pre>
<span style="line-height: 1.5em;">This will generate uImage(kernel image) in kernel/arch/arm/boot folder</span>
= <span style="line-height: 1.5em;">Flashing Android with Fastboot</span> =
#<span style="line-height: 1.5em;">Connect a USB OTG cable from the target board OTG port to a your host machine USB HOST port.</span>
#<span style="line-height: 1.5em;">Power up the board and hit return to stop the boot</span>
#<span style="line-height: 1.5em;">type fastboot in the u-boot prompt.</span>
<span style="line-height: 1.5em;">On the target:</span>
<pre><span style="line-height: 1.5em;">$ sudo `which fastboot` flash boot out/target/product/var_mx6/boot-som-mx6q-c.img
$ sudo `which fastboot` flash recovery out/target/product/var_mx6/recovery-som-mx6q-c.img
$ sudo `which fastboot` flash system out/target/product/var_mx6/system.img
$ sudo `which fastboot` reboot
</span></pre>
<span style="line-height: 1.5em;">boot-som-mx6q-c.img and recovery-som-mx6q-c.img is for VAR-SOM-MX6 with capacitive display. You should pick and choose the right file for you see the table above. The emmc-recovery utility select the right combination automatically by scanning the system it is running on. Detail information [http://variwiki.com/index.php?title=VAR-SOM-MX6_Android_Unit_Testing_KK_443_200#FASTBOOT Fastboot]</span>
= <span style="line-height: 1.5em;">Display Options</span> =
<span style="line-height: 1.5em;">Selecting the display type is done by setting the bootcmd with the required display type.</span>
<span style="line-height: 1.5em;">The bootcmd is embedded into [[VAR-SOM-MX6 Android GS#Build boot.img#Build boot.img|boot.img]]. To set the bootargs edit the file ''''~/var_ll_500_100/ll_500_100_build/device/variscite/var_som_mx6/BoardConfig.mk'''' as follows:</span>
*<span style="line-height: 1.5em;">HDMI</span>
<pre><span style="line-height: 1.5em;">BOARD_KERNEL_CMDLINE&nbsp;:= console=ttymxc0,115200 init=/init video=mxcfb0:dev=hdmi,1920x1080M@60,if=RGB24,bpp=32 video=mxcfb1:off video=mxcfb2:off video=mxcfb3:off vmalloc=400M androidboot.console=ttymxc0 consoleblank=0 androidboot.hardware=freescale cma=384M androidboot.selinux=disabled androidboot.dm_verity=disabled
</span></pre><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/>

Latest revision as of 11:56, 10 June 2020

DART-SD410 Android-LL-5.1.1 Developers Guide

Introduction

This WIKI describes how to build and deploy Android Lollipop Lollipop-5-1-1 on the DART-SD410. It is based on Qualcomm Android-LL-5.1.1.

Overview

The objective of this document is to guide DART-SD410 Android developers to obtain Android Lollipop sources, setting up host environment, compilation and deployment.

This document contains instructions for:

  • Hardware and software requirements.
  • Setup the hardware.
  • Setup the toolchain.
  • Download & build the sources.
  • Install the binaries on the DART-SD410 SOM.

Document Reference

This release is based on Qualcomm APQ8016_410C_LA.BR.1.2.4-01810-8x16.0_5.1.1_Lollipop_P2 release. Please refer to Qualcomm Developer Network before you start building.

Supported hardware and features

Feature Description
SOM support DART-SD410
Carrier Board support VAR-DT410CustomBoard
CPU Qualcomm - Snapdragon 410
Resque Image Resque Images set can be downloaded from FTP
eMMC up to 16GB
DDR size support configuration Up to 2G LPDDR3
SD-Card +
Wired Network 10/100 Mbps Ethernet
Wireless Network 802.11abg AP, & Wi-Fi
Bluetooth +
SPI +
I2C +
USB OTG Host and Device
Uarts x2
RTC +
Display HDMI: 1080P (On board DSI-to-HSMI bridge, 800x480 resolution)
LVDS (On board DSI-to-LVDS bridge, 800x480 resolution)
Audio Line In & Line out
Mono Speaker
Audio over HDMI
Camera IMX135 camera sensor. Board can be ordered separately at : sales@variscite.com

Hardware Requirements

DART-SD410 evaluation kit.

Please refer to Host requirements installation.

Obtain Variscite's BSP

Please download Android Board Support Package file from Variscite's FTP site.
Contact Variscite support for FTP credentials.

Unpack Variscite's Android Release Package

$ mkdir ~/dart-sd410
$ cd ~/dart-sd410
$ unzip ~/Downloads/variscite_bsp_vla.br_.1.2.4-01810-8x16.0-3.zip
$ cd source/

Download and Build Android Images

The following commands will download the full Android release from different Git repositories and build the Android images. It may take a very long time depending on Internel connection, Build machine, and remote servers. The process may fail fetching the repositories, in this case it can be started again.

$ chmod +x SD410c_build.sh
The file SD410c_build.sh can be edited and parameter $BUILD_MACHINE changed to follow the build machine. 
The best setting is number of threads of the CPU minus 2.
$ ./SD410c_build.sh
The build system will ask for credentials for repo initialization.

Rebuild Android Image

To rebuild the Android run:

$ source build/envsetup.sh 
$ lunch msm8916_64-userdebug 
$ make -j8 WITH_DEXPREOPT=true WITH_DEXPREOPT_PIC=true DEX_PREOPT_DEFAULT=nostripping | tee log.txt

You can change the number of build threads (-j parameter) to a better number to make the build faster.

Flashing newly built images

The build process creates an out directory and puts all images in the following directory:
/out/target/product/msm8916_64/
The following image files are created:
emmc_appsboot.mbn - little kernel (uboot)
boot.img - kernel and dtb files
system.img - system folder
The images can be flashed one by one via fastboot.
In order to enter fastboot mode cycle the power or press Reset key with Back key pressed.

To flash the whole system

$ cd out/target/product/msm8916_64/
$ sudo fastboot flash aboot emmc_appsboot.mbn
$ sudo fastboot flash persist persist.img
$ sudo fastboot flash userdata userdata.img
$ sudo fastboot flash system system.img
$ sudo fastboot flash recovery recovery.img
$ sudo fastboot flash boot boot.img

To flash kernel and dtbs

Sometimes the changes are done only to the android kernel, in this case there is no need to flash the whole system.
The kernel and dtb files are located in boot.img file.
Flashing it is enough

$ cd out/target/product/msm8916_64/
$ sudo fastboot flash boot boot.img

To flash little kernel

Sometimes the changes are done only to the bootloader, in this case there is no need to flash the whole system.
The little kernel is located in emmc_appsboot.mbn file.
Flashing it is enough

$ cd out/target/product/msm8916_64/
$ sudo fastboot flash aboot emmc_appsboot.mbn

Adding Applications

Adding Broswer

  • Download Browser.zip file from Variscite's FTP site into ~/dart-sd410/source/ directory.
  • The file is located in dart-sd410/Software/Android/AdditionalPackages/ FTP directory
  • Extract the downloaded file into your android directory
$ cd ~/dart-sd410/source/
$ unzip Browser.zip
  • Build the Android
  • Flash the new Android into the board by fastboot

Adding GPS Test

  • Download GPSTest.zip file from Variscite's FTP site into ~/dart-sd410/source/ directory.
  • The file is located in dart-sd410/Software/Android/AdditionalPackages/ FTP directory
  • Extract the downloaded file into your android directory
$ cd ~/dart-sd410/source/
$ unzip GPSTest.zip
  • Add the new package into your board configuration
$ gedit ./APQ8016_410C_LA.BR.1.2.4-01810-8x16.0_5.1.1_Lollipop_P2/device/qcom/msm8916_64/msm8916_64.mk

locate the following lines:

PRODUCT_PACKAGES += \
libqcomvisualizer \
libqcompostprocbundle \
libqcomvoiceprocessing

Add a new package to the PRODUCT_PACKAGES

PRODUCT_PACKAGES += \
libqcomvisualizer \
libqcompostprocbundle \
libqcomvoiceprocessing \
GPSTest

Save the file and exit gedit

  • Build the Android
  • Flash the new Android into the board by fastboot

Adding Geekbench

Follow the same procedure as for GPSTest to add Geekbench into your image file.

Troubleshoot

If something goes wrong check the following:

  • The downloaded files should be extracted into packages/apps/ directory verify that the new directory exists
  • Verify that the build process rebuilds the system.img image
  • Verify that the fastboot burns the system.img into system partition succsessfully

Customizing hardware

The DART-SD410 hardware customization should be done by changing DTS files.
This article is very helpful for reading about the DTS files.
The VAR-SD410CustmoBoard DTS files are located in kernel/arch/arm/boot/dts/qcom/ folder. The DTS file tree is:

apq8016-var-sd410.dts
└── apq8016-var-sd410.dtsi
    ├── apq8016-camera-sensor-var-sd410.dtsi
    ├── dsi-panel-var-sd410.dtsi
    └── apq8016-dart.dtsi
        ├── msm8916-pinctrl.dtsi
        └── msm8916.dtsi
            ├── skeleton64.dtsi
            ├── msm8916-coresight.dtsi
            ├── msm8916-smp2p.dtsi
            ├── msm8916-pinctrl.dtsi
            ├── msm8916-ipcrouter.dtsi
            ├── msm-gdsc-8916.dtsi
            ├── msm8916-iommu.dtsi
            ├── msm8916-gpu.dtsi
            ├── msm8916-mdss.dtsi
            │   ├── dsi-panel-sim-video.dtsi
            │   └── dsi-panel-sim-cmd.dtsi
            ├── msm8916-mdss-pll.dtsi
            ├── msm8916-iommu-domains.dtsi
            ├── msm8916-bus.dtsi
            ├── msm8916-camera.dtsi
            ├── msm-pm8916-rpm-regulator.dtsi
            ├── msm-pm8916.dtsi
            ├── msm8916-regulator.dtsi
            └── msm8916-pm.dtsi