VAR-SOM-MX6 Android GS: Difference between revisions

From Variscite Wiki
No edit summary
(Undo revision 975 by Oren (talk))
Line 1: Line 1:
{{PageHeader|VAR-SOM-MX6 Android-JB-4.2.2 110 r2 DevelopersGuide}} {{DocImage|category1=VAR-SOM-MX6|category2=Android}} __toc__
{{PageHeader|VAR-SOM-MX6 Android-JB-4.2.2 110 r2 DevelopersGuide}} {{DocImage|category1=VAR-SOM-MX6|category2=Android}} __toc__


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


This is the second release for VAR-SOM-MX6 Android-JB-4.2.2 110. It includes full Buletooth support on all platforms. Camera support added to the DL and Solo platforms.
This is the second release for VAR-SOM-MX6 Android-JB-4.2.2 110. It includes full Buletooth support on all platforms. Camera support added to the DL and Solo platforms.
Line 19: Line 21:
*Install the binaries on the VAR-SOM-MX6 SOM.
*Install the binaries on the VAR-SOM-MX6 SOM.


== Document Reference<br/> ==
== Document Reference<br/> <br/> ==
 
<br/>
This release is based on Freescale Rev jb4.2.2_1.1.0-GA, 07/2013 release. Please download and read the documents android_jb4.2.2_1.1.0-ga_doc.tar.gz.
This release is based on Freescale Rev jb4.2.2_1.1.0-GA, 07/2013 release. Please download and read the documents android_jb4.2.2_1.1.0-ga_doc.tar.gz.


Line 32: Line 34:
{| class="wikitable"
{| class="wikitable"
|-
|-
! scope="col" | Feature<br/>
! scope="col" | Feature<br/> <br/>
! scope="col" | Description<br/>
! scope="col" | Description<br/><br/> <br/><br/>
|-
|-
| Board support<br/>
| Board support<br/><br/><br/> <br/><br/><br/>
| [http://www.variscite.com/products/evaluation-kits/var-dvk-mx6 VAR-DVK-MX6],[http://www.variscite.com/products/system-on-module-som/cortex-a9/var-som-mx6-cpu-freescale-imx6 VAR-SOM-MX6]<br/>
| [http://www.variscite.com/products/evaluation-kits/var-dvk-mx6 VAR-DVK-MX6],[http://www.variscite.com/products/system-on-module-som/cortex-a9/var-som-mx6-cpu-freescale-imx6 VAR-SOM-MX6]<br/><br/><br/><br/> <br/><br/><br/><br/>
|-
|-
| CPU<br/>
| CPU<br/><br/><br/><br/><br/> <br/><br/><br/><br/><br/>
|  
|  
[http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=i.MX6Q&fr=g i.MX6 Quad]<br/>[http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=i.MX6D&fr=g i.MX6 Dual]<br/>[http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=i.MX6DL&fr=g i.MX6 Dual lite]<br/>[http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=i.MX6S&nodeId=018rH3ZrDRB24A i.MX6 Solo]
[http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=i.MX6Q&fr=g i.MX6 Quad]<br/><br/><br/><br/><br/><br/>[http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=i.MX6D&fr=g i.MX6 Dual]<br/>[http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=i.MX6DL&fr=g i.MX6 Dual lite]<br/>[http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=i.MX6S&nodeId=018rH3ZrDRB24A i.MX6 Solo] <br/><br/><br/><br/><br/><br/><br/>


|-
|-
| Software platform<br/>
| Software platform<br/><br/><br/><br/><br/><br/><br/><br/><br/> <br/><br/><br/><br/><br/><br/><br/><br/><br/>
|  
|  
[http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=i.MX6Q&fpsp=1&tab=Design_Tools_Tab Freescale Android-JB-4.2.2 110]
[http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=i.MX6Q&fpsp=1&tab=Design_Tools_Tab Freescale Android-JB-4.2.2 110]
Line 51: Line 53:
| NAND-recovery SD V21_1 - can be downloaded from FTP
| NAND-recovery SD V21_1 - can be downloaded from FTP
|-
|-
| NAND Flash size support<br/>
| NAND Flash size support<br/><br/><br/><br/><br/><br/><br/><br/><br/><br/> <br/><br/><br/><br/><br/><br/><br/><br/><br/><br/>
| 0.5,1.0,2.0 GB<br/>
| 0.5,1.0,2.0 GB<br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/> <br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/>
|-
|-
| SD-Card<br/>
| SD-Card<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/>
|-
|-
| Wired Network<br/>
| Wired Network<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/>
| 10/100/1000 Mbps Ethernet<br/>
| 10/100/1000 Mbps Ethernet<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/>
|-
|-
| Wireless Network<br/>
| Wireless Network<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/>
| 802.11 b/g/n<br/>
| 802.11 b/g/n<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/>
|-
|-
| Bluetooth<br/>
| Bluetooth<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/>
| +
| +
|-
|-
| USB host<br/>
| USB host<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/><br/><br/><br/><br/><br/><br/><br/><br/><br/>
|-
|-
| USB OTG<br/>
| USB OTG<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/>
| Host and Device<br/>
| Host and Device<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/>
|-
|-
| Uarts<br/>
| Uarts<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/>
| x3, up to 3.6 Mbps.<br/>
| x3, up to 3.6 Mbps.<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/>
|-
|-
| RTC<br/>
| RTC<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/><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/>
|-
|-
| Display
| Display
Line 85: Line 87:
|-
|-
| Camera
| Camera
| ov5640 camera sensor. CB402 board can be ordered seperately at : sales@variscite.com
| ov5640 camera sensor. CB402 board can be ordered seperately at&nbsp;: sales@variscite.com
|-
|-
| SATA
| SATA
| +
| +
|}
|}
 
<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/>
Variscite Android release for Freescale i.MX6 version Android-JB-4.2.2 110.
Variscite Android release for Freescale i.MX6 version Android-JB-4.2.2 110.


Line 105: Line 107:
=== IMPORTANT ===
=== IMPORTANT ===


This DevKit Release was built with 64-bit Ubuntu 12.04. We highly recomend to use this version as your build system.<br/>The host installation would need few more Android specific dependencies, these can be installed dynamically over network using below commands.
This DevKit Release was built with 64-bit Ubuntu 12.04. We highly recomend to use this version as your build system.<br/>The host installation would need few more Android specific dependencies, these can be installed dynamically over network using below commands.  
 
<br/>
=== For 64-bit Ubuntu 12.04 ===
=== For 64-bit Ubuntu 12.04 ===


Line 128: Line 130:
</pre>
</pre>
=== Additional packages ===
=== Additional packages ===
In addition to the packages requested on the Android website, the following packages are also required:
In addition to the packages requested on the Android website, the following packages are also required:
<pre>$ sudo apt-get install uuid uuid-dev
<pre>$ sudo apt-get install uuid uuid-dev
Line 139: Line 142:


The Android JB installer Package for the VAR-SOM-MX6&nbsp;can be obtained from Variscite's FTP, under:<br/>General/VAR-SOM-MX6/Software/Android_JB/Android-JB4.2.2_Release_110_R2/<br/>Files:<br/> <br/><br/>
The Android JB installer Package for the VAR-SOM-MX6&nbsp;can be obtained from Variscite's FTP, under:<br/>General/VAR-SOM-MX6/Software/Android_JB/Android-JB4.2.2_Release_110_R2/<br/>Files:<br/> <br/><br/>
<br/><br/><br/><br/>
<br/><br/>
<br/><br/>
 
*VAR-SOM-MX6-Android-JB422_110_R2-ReleaseNotes.pdf - Variscite release notes.<br/>  
*VAR-SOM-MX6-Android-JB422_110_R2-ReleaseNotes.pdf - Android package release notes.<br/>  
*android_jb4.2.2_1.1.0-ga.tar.gz - Freescale i.MX6 JB4.2.2_110 documents update patch files.<br/><br/> <br/>
*android_jb4.2.2_1.1.0-ga.tar.gz - Freescale's i.MX6 JB4.2.2_110 original patch files.<br/><br/> <br/>
*android_jb4.2.2_1.1.0-ga_doc.tar.gz - Freescale i.MX6 JB4.2.2_110 documents<br/><br/><br/> <br/><br/>
*android_jb4.2.2_1.1.0-ga_doc.tar.gz - Freescale i.MX6 JB4.2.2_110 release documents<br/><br/><br/> <br/><br/>
*repo.tar.gz - A copy of repo tool.<br/><br/><br/><br/> <br/><br/><br/>
*repo.tar.gz - A copy of repo tool.<br/><br/><br/><br/> <br/><br/><br/>
*var_jb422_110_r2_v11.tar.bz2 - Variscite's VAR-SOM-MX6 patch filest<br/><br/><br/><br/><br/> <br/><br/><br/><br/>
*var_jb422_110_r2_v11.tar.bz2 - Variscite VAR-SOM-MX6 SOM's support<br/><br/><br/><br/><br/> <br/><br/><br/><br/>
<br/><br/><br/>
 
<br/><br/><br/><br/><br/>
<br/><br/><br/><br/><br/>
= <span style="line-height: 1.5em;">Unpack Freescale Android Release Package</span> =
= <span style="line-height: 1.5em;">Unpack Freescale Android Release Package</span> =
<pre>$ mkdir ~/var_jb_422_110
<pre>$ mkdir ~/var_jb_422_110
Line 161: Line 157:
$ rm android_jb4.2.2_1.1.0-ga_tool.tar.gz  
$ rm android_jb4.2.2_1.1.0-ga_tool.tar.gz  
</pre>
</pre>
= <span style="line-height: 1.5em;">Downloading the Android Source Code (Android/Kernel/U-Boot)</span> =
= <span style="line-height: 1.5em;">Downloading the Android Source Code (Android/Kernel/U-Boot)</span> =
== Google Android JB4.2.2 Download<br/> ==
The Android source code is maintained in more than 100 different gits in the Android repository (android.googlesource.com).<br/>To get the Android source code from Google repo, follow the steps below:


== Google Android JB4.2.2 Download<br/> <br/> ==
<br/>
The Android source code is maintained in more than 100 different gits in the Android repository (android.googlesource.com).<br/>To get the Android source code from Google repo, follow the steps below:
<br/>
Assuming you have unzipped the Android release package to ~/var_jb_422_110/android_jb4.2.2_1.1.0-ga_source/.
Assuming you have unzipped the Android release package to ~/var_jb_422_110/android_jb4.2.2_1.1.0-ga_source/.
<pre>$ cd ~/var_jb_422_110
<pre>$ cd ~/var_jb_422_110
Line 177: Line 174:
{{note| NOTE:<br>The repo tool which was use by Variscite is available on the FTP.|info}}
{{note| NOTE:<br>The repo tool which was use by Variscite is available on the FTP.|info}}


== Variscite u-boot and Linux kernel Download<br/> ==
== Variscite u-boot and Linux kernel Download<br/> <br/> ==
<br/>
clone jb4.2.2_1.1.0-ga kernel source code from Variscite's open source git:
clone jb4.2.2_1.1.0-ga kernel source code from Variscite's open source git:
<pre>$ cd ~/var_jb_422_110/jb_422_110_build
<pre>$ cd ~/var_jb_422_110/jb_422_110_build
Line 190: Line 188:
$ git checkout -b jb4.2.2_1.1.0-ga.var13 remotes/origin/jb4.2.2_1.1.0-ga.var13
$ git checkout -b jb4.2.2_1.1.0-ga.var13 remotes/origin/jb4.2.2_1.1.0-ga.var13
</pre>
</pre>
= <span style="line-height: 1.5em;">Patching the AFS sources with Freescale i.MX6 support</span> =
= <span style="line-height: 1.5em;">Patching the AFS sources with Freescale i.MX6 support</span> =


The patch script (and_patch.sh) requires some basic utilities like awk/sed.<br/>Apply all Android patches by using the following steps:<br/>Assuming you have unzipped the Android release package to ~/var_jb_422_110/android_jb4.2.2_1.1.0-ga_source/.
The patch script (and_patch.sh) requires some basic utilities like awk/sed.<br/>Apply all Android patches by using the following steps:<br/>Assuming you have unzipped the Android release package to ~/var_jb_422_110/android_jb4.2.2_1.1.0-ga_source/. <br/>
<pre>$ cd ~/var_jb_422_110/jb_422_110_build
<br/><br/><pre>$ cd ~/var_jb_422_110/jb_422_110_build
$ cd ../android_jb4.2.2_1.1.0-ga_source/code/
$ cd ../android_jb4.2.2_1.1.0-ga_source/code/
$ tar xvf jb4.2.2_1.1.0-ga.tar.gz  
$ tar xvf jb4.2.2_1.1.0-ga.tar.gz  
Line 203: Line 200:
$ c_patch ../android_jb4.2.2_1.1.0-ga_source/code/jb4.2.2_1.1.0-ga imx_jb4.2.2_1.1.0-ga
$ c_patch ../android_jb4.2.2_1.1.0-ga_source/code/jb4.2.2_1.1.0-ga imx_jb4.2.2_1.1.0-ga
</pre>
</pre>
Here "../android_jb4.2.2_1.1.0-ga_source/code/jb4.2.2_1.1.0-ga" is the location of the patches (i.e. directory created when you unzip release package)<br/>"imx_jb4.2.2_1.1.0-ga" is the branch which will be created automatically for you to hold all patches (only in those existing Google gits).<br/><br/>If everything is OK, "c_patch" will generate the following output to indicate successful patch:<br/>**************************************************************<br/>Success: Now you can build the Android code for FSL i.MX platform<br/>**************************************************************<br/>NOTE<br/>The patch script (and_patch.sh) requires some basic utilities like awk/sed. If they are not<br/>available on your Linux computer, install them first.<br/>
Here "../android_jb4.2.2_1.1.0-ga_source/code/jb4.2.2_1.1.0-ga" is the location of the patches (i.e. directory created when you unzip release package)<br/>"imx_jb4.2.2_1.1.0-ga" is the branch which will be created automatically for you to hold all patches (only in those existing Google gits).<br/><br/>If everything is OK, "c_patch" will generate the following output to indicate successful patch:<br/>**************************************************************<br/>Success: Now you can build the Android code for FSL i.MX platform<br/>**************************************************************<br/>NOTE<br/>The patch script (and_patch.sh) requires some basic utilities like awk/sed. If they are not<br/>available on your Linux computer, install them first.<br/> <br/><br/><br/><br/><br/><br/><br/><br/><br/>
 
<br/><br/><br/><br/><br/><br/><br/><br/><br/><br/>
= Apply VAR-SOM-MX6 patches<br/> =
= Apply VAR-SOM-MX6 patches<br/> <br/> =
 
<br/>
After you setup your build machine,unpack Variscite's release Package:
After you setup your build machine,unpack Variscite's release Package:
<pre>$&nbsp;cd ~/var_jb_422_110/jb_422_110_build
<pre>$&nbsp;cd ~/var_jb_422_110/jb_422_110_build
Line 212: Line 209:
$ variscite/install
$ variscite/install
</pre>
</pre>
= Build Android Images =
= Build Android Images =


Line 257: Line 253:
=== Build boot.img ===
=== Build boot.img ===


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:
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:  
<pre>$ source build/envsetup.sh
<br/><pre>$ source build/envsetup.sh
$ lunch var_som_mx6-user
$ lunch var_som_mx6-user
$ make bootimage
$ make bootimage
Line 286: Line 282:
$ make ARCH=arm mx6dl_var_som_nand_android_config # VAR-SOM-MXDL, boot from NAND
$ make ARCH=arm mx6dl_var_som_nand_android_config # VAR-SOM-MXDL, boot from NAND
$ make ARCH=arm </pre>
$ make ARCH=arm </pre>
<br/>This command will generate the u-boot Image 'u-boot.bin'
<br/>This command will generate the u-boot Image 'u-boot.bin'  
 
<br/>
=== Manual build Android Linux Kernel and modules ===
=== Manual build Android Linux Kernel and modules ===


Line 304: Line 300:
The Android can either be booted from MMC/SD device or UBIFS on NAND.&nbsp;
The Android can either be booted from MMC/SD device or UBIFS on NAND.&nbsp;


== Boot From MMC/SD Card<br/> ==
== Boot From MMC/SD Card<br/> <br/> ==
 
<br/>
This section will guide you through the process of installing and boot VAR-SOM-MX6 from SD/MMC device.
This section will guide you through the process of installing and boot VAR-SOM-MX6 from SD/MMC device.


Line 348: Line 344:
Boot the target device using Variscite's pre-build NAND recovery SD image, then follow the instructions below:
Boot the target device using Variscite's pre-build NAND recovery SD image, then follow the instructions below:


=== Flashing U-Boot to NAND<br/> ===
=== Flashing U-Boot to NAND<br/> <br/> ===
 
<br/>
We recommend using our nand-recovery utility to flash the Android. You can update the relevant files in /opt/recovery/Android and use it to flash your images.
We recommend using our nand-recovery utility to flash the Android. You can update the relevant files in /opt/recovery/Android and use it to flash your images.
<pre># flash_eraseall /dev/mtd0  
<pre># flash_eraseall /dev/mtd0  
Line 386: Line 382:
  %CompositeAdbInterface%    = USB_Install, USB\VID_18D1&PID_0D02&MI_00
  %CompositeAdbInterface%    = USB_Install, USB\VID_18D1&PID_0D02&MI_00


= Testing<br/> =
= Testing<br/> <br/> =
 
<br/>
== Audio ==
== Audio ==


Line 402: Line 398:
<pre>root@android:/ # tinyplay /mnt/udisk/48b.wav   
<pre>root@android:/ # tinyplay /mnt/udisk/48b.wav   
</pre>
</pre>
== USB OTG as a device<br/> ==
== USB OTG as a device<br/> <br/> ==
 
<br/>
Test the OTG as a device using Android ADB tool.<br/>On target:<br/>Under devloper option enable ADB debugguing
Test the OTG as a device using Android ADB tool.<br/>On target:<br/>Under devloper option enable ADB debugguing <br/>
 
<br/><br/>
On Host:
On Host:
<pre>$ sudo out/host/linux-x86/bin/adb kill-server
<pre>$ sudo out/host/linux-x86/bin/adb kill-server
Line 422: Line 418:
Plug a mouse into all 3 ports and make sure it is working.
Plug a mouse into all 3 ports and make sure it is working.


Use an external HUB. Plug into it a Disk-On-Key, mouse and keyboard.<br/>Plug it into all 3 ports and make sure all 3 devices are functioning.
Use an external HUB. Plug into it a Disk-On-Key, mouse and keyboard.<br/>Plug it into all 3 ports and make sure all 3 devices are functioning.  
 
<br/>
== HDMI<br/> ==
== HDMI<br/> <br/> ==
 
<br/>
Boot the system and press spacebar to get into u-boot.
Boot the system and press spacebar to get into u-boot.


Line 435: Line 431:
You should see the Android on a full 1080p device.
You should see the Android on a full 1080p device.


== External LVDS display<br/> ==
== External LVDS display<br/> <br/> ==
 
<br/>
Boot the system and press spacebar to get into u-boot.<br/>Change enviroment setting with the folowing command
Boot the system and press spacebar to get into u-boot.<br/>Change enviroment setting with the folowing command  
 
<br/>
For Quad, Dual and DualLite SOM's use:
For Quad, Dual and DualLite SOM's use:
<pre>setenv bootargs console=ttymxc0,115200 init=/init ldb=sin1 video=mxcfb0:dev=ldb,800x600M@60,bpp=32 video=mxcfb1:off video=mxcfb2:off arm_freq=1000 fbmem=24M vmalloc=400M androidboot.console=ttymxc0 androidboot.hardware=freescale mtdparts=gpmi-nand:16m(bootloader),16m(bootimg),32m(recovery),-(root) ubi.mtd=3
<pre>setenv bootargs console=ttymxc0,115200 init=/init ldb=sin1 video=mxcfb0:dev=ldb,800x600M@60,bpp=32 video=mxcfb1:off video=mxcfb2:off arm_freq=1000 fbmem=24M vmalloc=400M androidboot.console=ttymxc0 androidboot.hardware=freescale mtdparts=gpmi-nand:16m(bootloader),16m(bootimg),32m(recovery),-(root) ubi.mtd=3
Line 445: Line 441:
<pre>setenv bootargs console=ttymxc0,115200 init=/init ldb=sin1 video=mxcfb0:dev=ldb,800x600M@60,bpp=32 video=mxcfb1:off video=mxcfb2:off arm_freq=1000 fbmem=24M vmalloc=400M androidboot.console=ttymxc0 androidboot.hardware=freescale gpumem=64M mtdparts=gpmi-nand:16m(bootloader),16m(bootimg),32m(recovery),-(root) ubi.mtd=3
<pre>setenv bootargs console=ttymxc0,115200 init=/init ldb=sin1 video=mxcfb0:dev=ldb,800x600M@60,bpp=32 video=mxcfb1:off video=mxcfb2:off arm_freq=1000 fbmem=24M vmalloc=400M androidboot.console=ttymxc0 androidboot.hardware=freescale gpumem=64M mtdparts=gpmi-nand:16m(bootloader),16m(bootimg),32m(recovery),-(root) ubi.mtd=3
</pre>
</pre>
== Ethernet<br/> ==
== Ethernet<br/> <br/> ==
 
<br/>
Just plug a cable into the system
Just plug a cable into the system


== WIFI<br/> ==
== WIFI<br/> <br/> ==
 
<br/>
Use the Android GUI to enable and connect to a WIFI AP.
Use the Android GUI to enable and connect to a WIFI AP.


Line 459: Line 455:
Test with file transfer to host PC, Bluetooth mouse and Bluetooth keyboard.
Test with file transfer to host PC, Bluetooth mouse and Bluetooth keyboard.


== Camera<br/> ==
== Camera<br/> <br/> ==
 
<br/>
Use the Android GUI to activate and test the camer. You can take a picture and send it over Bluetooth to a PC host.
Use the Android GUI to activate and test the camer. You can take a picture and send it over Bluetooth to a PC host.


== SATA<br/> ==
== SATA<br/> <br/> ==
<pre>cat /proc/scsi/scsi
<br/><pre>cat /proc/scsi/scsi
busybox fdisk -ul /dev/block/sda
busybox fdisk -ul /dev/block/sda
</pre>
</pre>
Line 471: Line 467:
If the device is FAT32 formated Android will auto mount it.
If the device is FAT32 formated Android will auto mount it.


== RTC (Real Time Clock)<br/> ==
== RTC (Real Time Clock)<br/> <br/> ==
 
<br/>
Disable the auto clock sync from the Android GUI.
Disable the auto clock sync from the Android GUI.
<pre>busybox date 2013.12.01-10:50
<pre>busybox date 2013.12.01-10:50
Line 479: Line 475:


In any method power down the board and wait 5 minutes. After that power up the board and check the the clock is correct.
In any method power down the board and wait 5 minutes. After that power up the board and check the the clock is correct.
<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/>

Revision as of 14:07, 24 January 2014

VAR-SOM-MX6 Android-JB-4.2.2 110 r2 DevelopersGuide

Introduction

This is the second release for VAR-SOM-MX6 Android-JB-4.2.2 110. It includes full Buletooth support on all platforms. Camera support added to the DL and Solo platforms.

The defintion is splited into 3 platforms : Q, DL and Solo to enable better tuning  for som based parameters.

Overview

The objective of this document is to guide Android developers to get access to Android JellyBean release sources for VAR-SOM-MX6, setting up host environment for compilation and deployment.

This document contains instructions to:

  • Hardware and software requirement.
  • Setup the hardware.
  • Setup the toolchain.
  • Download & build the sources.
  • Install the binaries on the VAR-SOM-MX6 SOM.

Document Reference


This release is based on Freescale Rev jb4.2.2_1.1.0-GA, 07/2013 release. Please download and read the documents android_jb4.2.2_1.1.0-ga_doc.tar.gz.

  • Android User's Guide
  • Android Quick Start Guide
  • Android Release Notes
  • Android Frequently Asked Questions

Supported hardware and features

Feature

Description



Board support





VAR-DVK-MX6,VAR-SOM-MX6







CPU









i.MX6 Quad





i.MX6 Dual
i.MX6 Dual lite
i.MX6 Solo






Software platform

















Freescale Android-JB-4.2.2 110

Nand Recovery NAND-recovery SD V21_1 - can be downloaded from FTP
NAND Flash size support



















0.5,1.0,2.0 GB





















SD-Card























+

























Wired Network



























10/100/1000 Mbps Ethernet





























Wireless Network































802.11 b/g/n

































Bluetooth



































+
USB host





































+







































USB OTG









































Host and Device











































Uarts













































x3, up to 3.6 Mbps.















































RTC

















































+



















































Display HDMI 720P,1080P LVDS0 (On board LVDS to RGB bridge, EVK supports 800x480 resolution) LVDS1 external display
Audio Line IN/ Line out
Camera ov5640 camera sensor. CB402 board can be ordered seperately at : sales@variscite.com
SATA +



























Variscite Android release for Freescale i.MX6 version Android-JB-4.2.2 110.

Hardware Requirements

VAR-SOM-MX6 evaluation kit.

Host (PC) setup requirements

The host development environment for Android is based on Ubuntu, please install Ubuntu version 12.04 64bit LTS http://www.ubuntu.com/download/desktop

We recommend you to have a Linux "Ubuntu 12.04 64bit LTS" Host machine.

IMPORTANT

This DevKit Release was built with 64-bit Ubuntu 12.04. We highly recomend to use this version as your build system.
The host installation would need few more Android specific dependencies, these can be installed dynamically over network using below commands.

For 64-bit Ubuntu 12.04

The complete Android host requirments:  source.android.com/source/initializing.html

The following command installs the required packages for setting up the android build host:

$ sudo apt-get install git gnupg flex bison gperf build-essential \
  zip curl libc6-dev libncurses5-dev:i386 x11proto-core-dev \
  libx11-dev:i386 libreadline6-dev:i386 libgl1-mesa-glx:i386 \
  libgl1-mesa-dev g++-multilib mingw32 tofrodos \
  python-markdown libxml2-utils xsltproc zlib1g-dev:i386
$ sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/lib/i386-linux-gnu/libGL.so

Installing the JDK

The Sun JDK is no longer in Ubuntu's main package repository. In order to download it, you need to add the appropriate repository and indicate to the system which JDK should be used.

Java 6: for Gingerbread and newer

$ sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner"
$ sudo apt-get update
$ sudo apt-get install sun-java6-jdk

Additional packages

In addition to the packages requested on the Android website, the following packages are also required:

$ sudo apt-get install uuid uuid-dev
$ sudo apt-get install zlib1g-dev liblz-dev
$ sudo apt-get install liblzo2-2 liblzo2-dev
NOTE:
The build machine should have at least 30GB of free space to complete the build process.
Please refer to the AOSP documentation for latest information and instructions for setting up other Ubuntu versions http://source.android.com/source/initializing.html

Obtaining VAR-SOM-MX6 Android package

Variscite provides an Android Release Package for the VAR-SOM-MX6. The Linux kernel and U-Boot are available through GITHUB.

The Android JB installer Package for the VAR-SOM-MX6 can be obtained from Variscite's FTP, under:
General/VAR-SOM-MX6/Software/Android_JB/Android-JB4.2.2_Release_110_R2/
Files:




  • VAR-SOM-MX6-Android-JB422_110_R2-ReleaseNotes.pdf - Variscite release notes.
  • android_jb4.2.2_1.1.0-ga.tar.gz - Freescale i.MX6 JB4.2.2_110 documents update patch files.


  • android_jb4.2.2_1.1.0-ga_doc.tar.gz - Freescale i.MX6 JB4.2.2_110 documents




  • repo.tar.gz - A copy of repo tool.






  • var_jb422_110_r2_v11.tar.bz2 - Variscite VAR-SOM-MX6 SOM's support













Unpack Freescale Android Release Package

$ mkdir ~/var_jb_422_110
$ cd ~/var_jb_422_110
$ tar xvf ~/Downloads/android_jb4.2.2_1.1.0-ga.tar.gz 
$ tar xvf android_jb4.2.2_1.1.0-ga_source.tar.gz
$ rm android_jb4.2.2_1.1.0-ga_source.tar.gz
$ rm android_jb4.2.2_1.1.0-ga_tool.tar.gz 

Downloading the Android Source Code (Android/Kernel/U-Boot)

Google Android JB4.2.2 Download


The Android source code is maintained in more than 100 different gits in the Android repository (android.googlesource.com).
To get the Android source code from Google repo, follow the steps below:
Assuming you have unzipped the Android release package to ~/var_jb_422_110/android_jb4.2.2_1.1.0-ga_source/.

$ cd ~/var_jb_422_110
$ mkdir jb_422_110_build
$ cd jb_422_110_build
$ curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/repo
$ chmod a+x ~/repo
$ ~/repo init -u https://android.googlesource.com/platform/manifest -b android-4.2.2_r1
$ ~/repo sync # can take a while to complete.
NOTE:
The repo tool which was use by Variscite is available on the FTP.

Variscite u-boot and Linux kernel Download


clone jb4.2.2_1.1.0-ga kernel source code from Variscite's open source git:

$ cd ~/var_jb_422_110/jb_422_110_build
$ git clone git://github.com/varigit/linux-2.6-imx.git kernel_imx
$ cd kernel_imx
$ git checkout -b jb4.2.2_1.1.0-ga-var13 remotes/origin/jb4.2.2_1.1.0-ga-var13

clone the U-Boot git repository from Varicite's open source git:

$ cd ~/var_jb_422_110/jb_422_110_build/bootable/bootloader
$ git clone git://github.com/varigit/uboot-imx.git uboot-imx
$ cd uboot-imx
$ git checkout -b jb4.2.2_1.1.0-ga.var13 remotes/origin/jb4.2.2_1.1.0-ga.var13

Patching the AFS sources with Freescale i.MX6 support

The patch script (and_patch.sh) requires some basic utilities like awk/sed.
Apply all Android patches by using the following steps:
Assuming you have unzipped the Android release package to ~/var_jb_422_110/android_jb4.2.2_1.1.0-ga_source/.



$ cd ~/var_jb_422_110/jb_422_110_build
$ cd ../android_jb4.2.2_1.1.0-ga_source/code/
$ tar xvf jb4.2.2_1.1.0-ga.tar.gz 
$ cd -
$ source ../android_jb4.2.2_1.1.0-ga_source/code/jb4.2.2_1.1.0-ga/and_patch.sh
$ help
Now you should see that the "c_patch" function is available
$ c_patch ../android_jb4.2.2_1.1.0-ga_source/code/jb4.2.2_1.1.0-ga imx_jb4.2.2_1.1.0-ga

Here "../android_jb4.2.2_1.1.0-ga_source/code/jb4.2.2_1.1.0-ga" is the location of the patches (i.e. directory created when you unzip release package)
"imx_jb4.2.2_1.1.0-ga" is the branch which will be created automatically for you to hold all patches (only in those existing Google gits).

If everything is OK, "c_patch" will generate the following output to indicate successful patch:
**************************************************************
Success: Now you can build the Android code for FSL i.MX platform
**************************************************************
NOTE
The patch script (and_patch.sh) requires some basic utilities like awk/sed. If they are not
available on your Linux computer, install them first.



















Apply VAR-SOM-MX6 patches


After you setup your build machine,unpack Variscite's release Package:

$ cd ~/var_jb_422_110/jb_422_110_build
$ tar xvf var_jb422_110_r2_v10.tar.bz2
$ variscite/install

Build Android Images

Build the Android Filesystem

  • Change to Android top level directory.
$ cd ~/var_jb_422_110/jb_422_110_build
  • Execute the following commands
$ source build/envsetup.sh

Select one of the below targets, based on your target platform:

$ lunch var_som_mx6q-user
$ lunch var_som_mx6dl-user
$ lunch var_som_mx6solo-user

Build:

$ make -j6

The above make will build the u-boot and Linux images for Variscite SOM's.

Generate UBI images

To generate UBI images to be installed on NAND flash type the following commands after you run the above make:

For Quad platform:

$ chmod 644 out/target/product/var_som_mx6q/system/build.prop
$ rm out/target/product/var_som_mx6q/userdata.img
$ make -j4 PRODUCT-var_som_mx6q-user BUILD_TARGET_FS=ubifs

For Dual Lite platform:

$ chmod 644 out/target/product/var_som_mx6dl/system/build.prop
$ rm out/target/product/var_som_mx6dl/userdata.img
$ make -j4 PRODUCT-var_som_mx6dl-user BUILD_TARGET_FS=ubifs

For Solo platform:

$ chmod 644 out/target/product/var_som_mx6solo/system/build.prop
$ rm out/target/product/var_som_mx6solo/userdata.img
$ make -j4 PRODUCT-var_som_mx6solo-user BUILD_TARGET_FS=ubifs
  • The above commands will build the Android file-system, kernel, related modules and U-Boot.
  • Android rootfs components (root and system directories) will be located in 'out/target/product/var_som_mx6'.
  • The UBI build must be run only after the first build.

Build boot.img

We use boot.img and booti as default commands to boot rather than the uramdisk and uImage.
You can use this command to generate boot.img under android environment:


$ source build/envsetup.sh
$ lunch var_som_mx6-user
$ make bootimage

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 has detail information how to fix this.

Toolchain setup for manual build kernel and u-boot

Setup the toolchain path to point to arm-eabi- tools in prebuilts/gcc/linux-x86/arm/arm-eabi-4.6/bin

$ export CROSS_COMPILE=~/var_jb_422_110/jb_422_110_build/prebuilts/gcc/linux-x86/arm/arm-eabi-4.6/bin/arm-eabi-

Manual build Bootloader 

Change directory to u-boot

$ cd ~/var_jb_422_110/jb_422_110_build/bootable/bootloader/uboot-imx 

Execute following commands:

$ make ARCH=arm distclean
$ make ARCH=arm mx6q_var_som_android_config # VAR-SOM-MXQ/D, boot from MMC
$ make ARCH=arm mx6solo_var_som_android_config # VAR-SOM-MXSolo, boot from MMC
$ make ARCH=arm mx6dl_var_som_android_config # VAR-SOM-MXDL, boot from MMC
$ make ARCH=arm mx6q_var_som_nand_android_config # VAR-SOM-MXQ/D, boot from NAND
$ make ARCH=arm mx6solo_var_som_nand_android_config # VAR-SOM-MXSolo, boot from NAND
$ make ARCH=arm mx6dl_var_som_nand_android_config # VAR-SOM-MXDL, boot from NAND
$ make ARCH=arm 


This command will generate the u-boot Image 'u-boot.bin'

Manual build Android Linux Kernel and modules

Change directory to kernel

$ cd ~/var_jb_422_110/jb_422_110_build/kernel_imx 

Execute following commands

$ make ARCH=arm distclean
$ make ARCH=arm var_som_mx6_android_defconfig
$ make ARCH=arm uImage
$ make ARCH=arm modules

This will generate uImage(kernel image) in kernel/arch/arm/boot folder

Boot

The Android can either be booted from MMC/SD device or UBIFS on NAND. 

Boot From MMC/SD Card


This section will guide you through the process of installing and boot VAR-SOM-MX6 from SD/MMC device.

Create bootable SD card

Variscite provides a script that can be used to partition the SD card and to install the required images on it.

Please download mksdcard.sh from the FTP site.

If you buid an image for UBIFS you need to re run your build:

$ make clean
$ make -j6

Connect the SD-Card(2GB>) to the Linux machine, using a memory card reader to the Linux machine.

  • Note the name allocated for this device. Type "dmesg". The SD card name should show up near the end, usually something like "SDC" (/dev/sdc) or "SDD" (/dev/sdd) or "MMC" . replace "/dev/mmcblk0" with the right one.
  • Run the following command:

To create SD card for VAR-SOM-MX6Q device:

$ cd ~/var_jb_422_110/jb_422_110_build
$ sudo ./mksdcard.sh  /dev/mmcblk0 mx6q

To create SD card for VAR-SOM-MX6DL device:

$ cd ~/var_jb_422_110/jb_422_110_build
$ sudo ./mksdcard.sh /dev/mmcblk0 mx6DL

To create SD card for VAR-SOM-MX6Solo device:

$ cd ~/var_jb_422_110/jb_422_110_build
$ sudo  ./mksdcard.sh/dev/mmcblk0 mx6solo

Boot Android from SD card

  • Insert the SD card you just created into the MMC/SD slot on the custom board.
  • Press and hold the boot-select button and power-on the SOM.

Boot From NAND Flash

Flashing the U-Boot, boot image and Android UBI root file system into NAND can be done from target Linux shell.

The images  can be found at Android build machine under: "out/target/product/var_som_mx6".

Boot the target device using Variscite's pre-build NAND recovery SD image, then follow the instructions below:

Flashing U-Boot to NAND


We recommend using our nand-recovery utility to flash the Android. You can update the relevant files in /opt/recovery/Android and use it to flash your images.

# flash_eraseall /dev/mtd0 
# kobs-ng init <u-boot-mx6XXX.bin> --search_exponent=1 -v

Flashing the Boot Image to NAND

# flash_eraseall /dev/mtd3 
# nandwrite -p /dev/mtd3 <boot.img>

Flashing the Android UBI Root File-System to NAND

# flash_eraseall /dev/mtd5 2>/dev/null
# ubiformat /dev/mtd5 -f <android_root.img> -s 2048 -O 2048

Display Options

Selecting the display type is done by setting the bootcmd with the required display type.

The bootcmd is embedded into boot.img. To set the bootargs edit the file '~/imx-android-jb4.2.2_1.0.0-ga-var11/device/variscite/var_som_mx6/BoardConfig.mk' as follows:

  • HDMI
BOARD_KERNEL_CMDLINE := console=ttymxc0,115200 init=/init video=mxcfb0:dev=hdmi,1920x1080M@60,if=RGB24,bpp=32 video=mxcfb1:off video=mxcfb2:off arm_freq=1000 fbmem=48M vmalloc=400M androidboot.console=ttymxc0 androidboot.hardware=freescale
  • Variscite's LCD (Capacitive and resistive)
BOARD_KERNEL_CMDLINE := console=ttymxc0,115200 init=/init video=mxcfb0:dev=ldb,bpp=32 video=mxcfb1:off video=mxcfb2:off arm_freq=1000 fbmem=24M vmalloc=400M androidboot.console=ttymxc0 androidboot.hardware=freescale

Android ADB Setup

Android Debug Bridge (adb) is a versatile tool that let you manage the state of the Android-powered device.

For more information about how to setup ADB adb, see TI ADB Setup page at http://processors.wiki.ti.com/index.php/Android_ADB_Setup.

NOTE: When using adb over USB on Windows Machine, edit android_winusb.inf to match VAR-SOM-MX6 vendor and product ids, under [Google.NTx86] section add:

;VAR-SOM-MX6
%SingleAdbInterface%        = USB_Install, USB\VID_18D1&PID_0D02
%CompositeAdbInterface%     = USB_Install, USB\VID_18D1&PID_0D02&MI_00

Testing


Audio

The default Android sound recorder application use a a very low sampling rate producing a poor sound.

Plug a Disk-On-Key FAT32 formated into the USB host port.

Plug an audio source (like a PC line out or smartphone line out) into the line in connector.

Plug speakers (like PC speakers) into the line out connector.

root@android:/ # tinycap /mnt/udisk/48b.wav -d 0 -b 24 -c 2 -r 48000 

Hit CTRL-C after couple of seconds or more.

root@android:/ # tinyplay /mnt/udisk/48b.wav  

USB OTG as a device


Test the OTG as a device using Android ADB tool.
On target:
Under devloper option enable ADB debugguing


On Host:

$ sudo out/host/linux-x86/bin/adb kill-server
$ sudo out/host/linux-x86/bin/adb start-server
$ sudo out/host/linux-x86/bin/adb devices
$ sudo out/host/linux-x86/bin/adb shell

USB OTG as a host

Use an external HUB. Plug into it a Disk-On-Key, mouse and keyboard.

Make sure with the Android GUI that they are functional.

USB HOST

Plug a mouse into all 3 ports and make sure it is working.

Use an external HUB. Plug into it a Disk-On-Key, mouse and keyboard.
Plug it into all 3 ports and make sure all 3 devices are functioning.

HDMI


Boot the system and press spacebar to get into u-boot.

Change enviroment setting with the folowing command

setenv bootargs console=ttymxc0,115200 androidboot.console=ttymxc0 init=/init video=mxcfb0:dev=hdmi,1920x1080M@60,bpp=32 video=mxcfb2:off arm_freq=1000 fbmem=28M vmalloc=400M androidboot.hardware=freescale caam mxc_hdmi.only_cea=1 mtdparts=setenv mtdpar gpmi-nand:16m(bootloader),16m(bootimg),32m(recovery),-(root) ubi.mtd=3 var_ts_type=ctw6120

Plug an HDMI TV or monitor to the HDMI port and boot the system by typing boot into u-boot.

You should see the Android on a full 1080p device.

External LVDS display


Boot the system and press spacebar to get into u-boot.
Change enviroment setting with the folowing command
For Quad, Dual and DualLite SOM's use:

setenv bootargs console=ttymxc0,115200 init=/init ldb=sin1 video=mxcfb0:dev=ldb,800x600M@60,bpp=32 video=mxcfb1:off video=mxcfb2:off arm_freq=1000 fbmem=24M vmalloc=400M androidboot.console=ttymxc0 androidboot.hardware=freescale mtdparts=gpmi-nand:16m(bootloader),16m(bootimg),32m(recovery),-(root) ubi.mtd=3

For Solo use:

setenv bootargs console=ttymxc0,115200 init=/init ldb=sin1 video=mxcfb0:dev=ldb,800x600M@60,bpp=32 video=mxcfb1:off video=mxcfb2:off arm_freq=1000 fbmem=24M vmalloc=400M androidboot.console=ttymxc0 androidboot.hardware=freescale gpumem=64M mtdparts=gpmi-nand:16m(bootloader),16m(bootimg),32m(recovery),-(root) ubi.mtd=3

Ethernet


Just plug a cable into the system

WIFI


Use the Android GUI to enable and connect to a WIFI AP.

BLUETOOTH

Use the Android GUI to enable.

Test with file transfer to host PC, Bluetooth mouse and Bluetooth keyboard.

Camera


Use the Android GUI to activate and test the camer. You can take a picture and send it over Bluetooth to a PC host.

SATA


cat /proc/scsi/scsi
busybox fdisk -ul /dev/block/sda

In the above commands you will see SCSI status and device partition table.

If the device is FAT32 formated Android will auto mount it.

RTC (Real Time Clock)


Disable the auto clock sync from the Android GUI.

busybox date 2013.12.01-10:50
busybox hwclock --systohc

Also can set clock via GUI and check it later.

In any method power down the board and wait 5 minutes. After that power up the board and check the the clock is correct.