Difference between revisions of "CM-T3730: Android"

From Compulab Mediawiki
Jump to: navigation, search
(See also)
 
(Testing WiFi from command line)
 
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
== Introduction ==
 
== Introduction ==
The preliminary Android Demo filesystem image for CM-T3730 is based on Android 4.1.1 Jelly Bean. The CompuLab preliminary Android Demo package for CM-T3730 includes ready to run Demo Android filesystem image and Linux kernel based on 2.6.37 version.
+
The Android Demo filesystem image for CM-T3730 is based on [http://code.google.com/p/rowboat/ Rowboat] [http://code.google.com/p/rowboat/wiki/JellybeanOnBeagleboard_WithSGX Android 4.1.2 Jelly Bean] support for TI's AM37x platform.  
 +
The [http://compulab.co.il/products/computer-on-modules/cm-t3730/#devres CompuLab Android Demo package for CM-T3730] includes ready to run Demo Android filesystem image and [[CM-T3730: Android: Kernel|Linux kernel]] based on 2.6.37 version.
  
== Preparation steps ==
+
The Android Demo image for CM-T3730 includes following software components:
* Obtain a Linux PC workstation.
+
* Android Jelly Bean 4.1.2 release from Google
* Get a USB Card reader and a micro SD Card. You can either use the micro SD card, supplied with the CM-T3730 Evaluation kit, that has already been pre-partitioned as described in the [[CM-T3x: U-Boot: Firmware_Overview#Default MMC.2FSD card mapping | Default MMC/SD Card mapping]] article, or create a new one.
+
* Android Linux Kernel v2.6.37
* Plug the USB SD Card reader to your host Linux PC. Insert the micro SD Card into the USB Card reader. From now we assume the device name of the MMC/SD card on your Linux PC is {{filename|/dev/sdc}}.
+
* SGX OpenGL ES Driver & Libraries DDK v1.10
* Download the [http://compulab.co.il/products/computer-on-modules/cm-t3730/#devres preliminary Android Demo package for CM-T3730] from CompuLab website. Unzip the package to a directory on your host workstation.
+
* Built-in Applications and Demos
* All image files mentioned below can be found in {{filename|images}} subdirectory of the Demo package.
+
** Browser, Calculator, Clock, Contacts, Music, Search, File Manager, etc.
 +
* Peripherals drivers
 +
** MMC/SD, UART, Ethernet, Matrix Keypad, LCD, Touchscreen, etc.
 +
** USB (Host and Gadget), Audio out/in, WLAN, Bluetooth
  
== Booting X-Loader and U-Boot ==
+
The [[CM-T3730: Android: Getting started|Getting started with Android on CM-T3730]] page provides a brief introduction on how to install and boot the Android Demo image.
* Create two partitions (FAT32 partition for X-Loader, U-Boot and Linux kernel and ext4 partition for root filesystem) as described in the [[CM-T3x: U-Boot: Firmware_Overview#Default MMC.2FSD card mapping | Default MMC/SD Card mapping]] article:
+
This article describes package structure and peripheral device options specific to the CM-T3730.
 +
 
 +
= Package contents =
 +
 
 +
== version.txt ==
 +
The contents of the {{filename|version.txt}} identifies the package version.
 +
 
 +
== images ==
 +
* {{filename|uImage-cm-t3730.bin}} - ready to run Linux kernel image binary for CM-T3730
 +
* {{filename|Android-image-cm-t3730.tar.bz2}} - Android root file system archive
 +
 
 +
== development ==
 +
The {{filename|development}} directory contains a collection of patches with support for CM-T3730.
 +
The directory structure preserves the Rowboat Android Source tree structure.
 +
It contains patches for several Android sub-projects including Linux kernel.
 +
* {{filename|build}} - contains a collection of patches that determine build specification for CM-T3730
 +
* {{filename|device/compulab/cm_t3730}} - contains a collection of patches that introduce CM-T3730 support
 +
* {{filename|hardware}} - contains hardware specific patches
 +
** {{filename|devmem2}} - provides {{filename|devmem2}} utility
 +
** {{filename|ti}} - TI platform specific patches
 +
*** {{filename|omap3}} - patches for CM-T3730 audio
 +
*** {{filename|sgx}} - patches for Graphics SDK
 +
* {{filename|kernel}} - contains a collection of patches for Linux kernel with support for CM-T3730 peripherals
 +
 
 +
== kernel ==
 +
* {{filename|uImage-2.6.37-cm-t3730-3.bin}} - ready to run Linux kernel 2.6.37-cm-t3730-3 for CM-T3730 can be used with either Android or Linux root filesystem
 +
* {{filename|linux-2.6.37-cm-t3730-3.config}} - Linux kernel 2.6.37-cm-t3730-3 configuration file
 +
* {{filename|linux-2.6.37-cm-t3730-3.patch}} - patch vs. [http://gitorious.org/rowboat/kernel/commit/c83d5f31dd92832fd83db48c073d82546c23eeab rowboat-jb-am37x-4.1.2] tag with support for CM-T3730 peripherals
 +
* {{filename|patches}} - ordered collection of patches, that form the single patch above ({{filename|linux-2.6.37-cm-t3730-3.patch}})
 +
 
 +
== utilities ==
 +
The {{filename|utilities}} directory contains miscellaneous utilities useful for development
 +
* {{filename|adb}} - prebuilt {{filename|adb}} binary for Linux host
 +
* {{filename|busybox}} - prebuilt {{filename|busybox}} binary v1.19.4
 +
* {{filename|eeprom-util}} - CompuLab EEPROM utility for reading information found inside the EEPROM on CompuLab boards
 +
 
 +
= Using Android on CM-T3730 =
 +
== Audio ==
 +
=== Introduction ===
 +
CM-T3730 uses the audio module of the TPS65930 PMIC for analog audio input and output.
 +
The audio module is interfaced to the main processor through the TDM / I2S interface and used to transmit and receive audio data.
 +
The audio codec is connected via Multi-Channel Buffered Serial Port (McBSP) interface.
 +
 
 +
=== Android Audio HAL Configuration ===
 +
Android uses the kernel ALSA framework for audio input/output.
 +
 
 +
The {{parameter|tinyalsa}} utilities are used for audio playback, capture and configuration.
 +
These can be used to test the audio functionality and configuration at kernel-level.
 +
 
 +
The ALSA HAL is named {{parameter|audio.primary.cm_t3730.so}}.
 +
It uses the file {{filename|mixer_paths.xml}} to configure the audio driver.
 +
This file contains the ALSA mixer settings for the various audio paths supported by the driver.
 +
 
 +
=== Testing audio from command line ===
 +
Use the {{parameter|tinyalsa}} utilities to test audio input/output from shell.
 +
 
 +
* The {{parameter|tinymix}} is a mixer utility used for showing and configuring sound settings.
 
<pre>
 
<pre>
Disk /dev/sdc: 8035 MB, 8035237888 bytes
+
root@android:/ # tinymix
32 heads, 32 sectors/track, 15326 cylinders, total 15693824 sectors
+
Number of controls: 70
Units = sectors of 1 * 512 = 512 bytes
+
ctl    type    num    name                                    value
Sector size (logical/physical): 512 bytes / 512 bytes
+
0      ENUM    1       Codec Operation Mode                    Option 2 (voice/audio)
I/O size (minimum/optimal): 512 bytes / 512 bytes
+
1      INT    2      DAC1 Digital Fine Playback Volume        63 63
Disk identifier: 0x710ab397
+
2      INT    2      DAC2 Digital Fine Playback Volume        63 63
 +
3      INT    2      DAC1 Digital Coarse Playback Volume      0 0
 +
4      INT    2      DAC2 Digital Coarse Playback Volume      0 0
 +
5      INT    2      DAC1 Analog Playback Volume              12 12
 +
6      INT    2      DAC2 Analog Playback Volume              12 12
 +
7      BOOL    2      DAC1 Analog Playback Switch              On On
 +
...
 +
69      BOOL    1      Right1 Analog Loopback Switch            Off
 +
</pre>
  
  Device Boot      Start        End      Blocks  Id  System
+
* To play a simple audio file use the {{parameter|tinyplay}} media player:
/dev/sdc1  *        2048      242959      120456    c  W95 FAT32 (LBA)
+
<pre>
/dev/sdc2          243712    15693823    7725056  83  Linux
+
root@android:/ # tinyplay <media-file-name>.wav
 
</pre>
 
</pre>
* If you use the micro SD card, supplied with the CM-T3730 Evaluation kit, that has already been pre-partitioned as required, proceed to the [[#Booting Android | Booting Android]] section.
+
 
* Format for FAT32 partition:
+
* To record a simple audio file use the {{parameter|tinycap}} utility:
 
<pre>
 
<pre>
sudo mkfs.vfat -F 32 -n boot /dev/sdc1
+
root@android:/ # tinycap <capture-file-name>.wav
 
</pre>
 
</pre>
* Mount the partition under {{filename|/media/boot}} location:
+
 
 +
== Keypad ==
 +
The matrix keypad is supplied with the CM-T3730 Evaluation Kit.
 +
Connect the keypad to the SB-T35 base-board (connector P10) via 20-pin flat cable supplied with the evaluation kit.
 +
 
 +
=== Android Keypad Configuration ===
 +
The default Android keypad configuration is determined by the Android Key layout file {{filename|/system/usr/keylayout/TWL4030_Keypad.kl}}.
 +
This file is responsible for mapping Linux key and axis codes to Android key and axis codes and specifying associated policy flags.
 +
The {{filename|TWL4030_Keypad.kl}} for CM-T3730 looks as follows:
 
<pre>
 
<pre>
sudo mkdir -p /media/boot
+
# CM-T3730 TWL4030 KEYPAD keylayout
sudo mount /dev/sdc1 /media/boot
+
key 30    BACK              WAKE_DROPPED
 +
key 48    HOME              WAKE
 +
key 46    MENU              WAKE_DROPPED
 +
key 32    SEARCH            WAKE
 +
key 28    POWER              WAKE
 
</pre>
 
</pre>
* Copy the X-Loader binary on to the boot partition and rename it as {{filename|MLO}}. It is essential that the {{filename|MLO}} will be the first file created on the MMC/SD card.
+
 
 +
== USB Gadget ==
 +
=== Introduction ===
 +
The CM-T3730 Android Demo image supports both USB host and USB device ports. USB host can be used to connect Keyboard/Mouse, Mass storage device, etc.
 +
The USB device port is used for adb and USB accessory gadgets.
 +
 
 +
=== Android USB Gadget Configuration ===
 +
The Android USB gadget driver is configured via the {{filename|sysfs}} entries.
 +
The sysfs settings depend on the features required to be enabled.
 +
By default only the adb and mtp mode is configured.  
 +
The adb mode is configured by default.
 +
Please refer to the {{filename|device/compulab/cm_t3730/init.compulabcm-t3730.rc}} for more details.
 +
 
 +
==== Android Mass Storage USB Gadgets ====
 +
To enable Android Mass Storage USB Gadgets follow the instruction below:
 +
 
 +
* Set the Android Gadget to the Mass Storage mode:
 
<pre>
 
<pre>
cp /path/to/cm-t3730-android-demo/images/x-loader.bin /media/boot/MLO
+
root@android:/ # echo 0 > /sys/class/android_usb/android0/enable
 +
root@android:/ # echo mass_storage > /sys/class/android_usb/android0/functions
 +
root@android:/ # echo 1 > /sys/class/android_usb/android0/enable
 
</pre>
 
</pre>
* Copy U-Boot and Linux kernel images on to the boot partition:
+
 
 +
* Make sure the external storage device you want to use (e.g. USB stick, SD/MMC card) is plugged/installed into the CM-T3730 and has a proper partition:
 
<pre>
 
<pre>
cp /path/to/cm-t3730-android-demo/images/u-boot.bin /media/boot/
+
root@android:/ # ls -l /dev/block/
cp /path/to/cm-t3730-android-demo/images/uImage /media/boot/
+
...
 +
brw------- root    root    179,  0 2013-05-07 09:37 mmcblk0
 +
brw------- root    root    179,  1 2013-05-07 09:37 mmcblk0p1
 +
brw------- root    root    179,  2 2013-05-07 09:37 mmcblk0p2
 +
brw------- root    root    179,  3 2013-05-07 09:37 mmcblk0p3
 +
...
 +
brw------- root    root      8,  0 2013-05-07 09:37 sda
 +
brw------- root    root      8,  1 2013-05-07 09:37 sda1
 +
...
 +
root@android:/ # cat /proc/partitions
 +
major minor  #blocks  name
 +
 
 +
179        0    7842816 mmcblk0
 +
179        1    120456 mmcblk0p1
 +
179        2    5669520 mmcblk0p2
 +
179        3    2051815 mmcblk0p3
 +
  8        0    1970239 sda
 +
  8        1    1969215 sda1
 
</pre>
 
</pre>
  
== Booting Android ==
+
* Make sure the partition you're going to share is not mounted. Otherwise unmount it.
* Format ext4 partition:
+
 
 +
* Share the partition:
 
<pre>
 
<pre>
sudo mkfs.ext4 -L rootfs /dev/sdc2
+
root@android:/ # echo /dev/block/mmcblk0p3 > /sys/class/android_usb/f_mass_storage/lun/file
 
</pre>
 
</pre>
* Mount the partition under {{filename|/media/boot}} location:
+
 
 +
* Finally, connect the CM-T3730 to your host via USB OTG port.
 +
 
 +
==== ADB over USB ====
 +
Please refer to the [[Android: ADB setup]] article for more information about the ADB over USB.
 +
 
 +
== WiFi ==
 +
=== Introduction ===
 +
The CM-T3730 uses the TI WL1271 device.
 +
The CM-T3730 Android Demo package uses WL12XX Compat wireless SDK instead of the device driver integrated into the Linux kernel.
 +
The WL12XX Compat SDK includes the WL1271 device driver as well as the device firmware.
 +
 
 +
=== Android WiFi HAL Configuration ===
 +
* The TI version of wpa_supplicant 0.8.x is enabled in {{filename|device/compulab/cm_t3730/BoardConfig.mk}}:
 
<pre>
 
<pre>
sudo mkdir -p /media/rootfs
+
BOARD_WPA_SUPPLICANT_DRIVER      := NL80211
sudo mount /dev/sdc2 /media/rootfs
+
WPA_SUPPLICANT_VERSION          := VER_0_8_X_TI
 +
BOARD_HOSTAPD_DRIVER            := NL80211
 +
BOARD_WLAN_DEVICE                := wl12xx_mac80211
 +
BOARD_SOFTAP_DEVICE              := wl12xx_mac80211
 +
WIFI_DRIVER_MODULE_PATH          := "/system/lib/modules/wl12xx_sdio.ko"
 +
WIFI_DRIVER_MODULE_NAME          := "wl12xx_sdio"
 
</pre>
 
</pre>
* Extract the preliminary Android Demo root filesystem on to that partition:
+
This enables building the wpa_supplicant 0.8.x with NL80211.
 +
Additionally, it specifies the {{parameter|wl12xx_sdio}} as the WiFi driver that is loaded at run time.
 +
 
 +
* The WiFi interface name {{parameter|wlan0}} is set in the {{filename|device/compulab/cm_t3730/device.mk}}:
 
<pre>
 
<pre>
sudo tar -xpf /path/to/cm-t3730-android-demo/images/Android-Demo-image-cm-t3730.tar.bz2 -C /media/rootfs && sync
+
PRODUCT_PROPERTY_OVERRIDES += \
 +
        wifi.interface=wlan0
 
</pre>
 
</pre>
* Unmount all micro SD card partitions:
+
 
 +
* Finally, the {{parameter|wpa_supplicant}} and the {{parameter|dhcpcd}} daemons are started in the CM-T3730 init file. Please refer to the {{filename|device/compulab/cm_t3730/init.compulabcm-t3730.rc}} for more details.
 +
 
 +
=== Testing WiFi from command line ===
 +
* Check the WiFi modules are loaded:
 
<pre>
 
<pre>
sudo umount /dev/sdc1; sudo umount /dev/sdc2
+
root@android:/ # lsmod
 +
wl12xx 198125 0 - Live 0xbf0f6000
 +
mac80211 341334 1 wl12xx, Live 0xbf083000
 +
cfg80211 158648 2 wl12xx,mac80211, Live 0xbf04b000
 +
compat 7163 2 wl12xx,mac80211, Live 0xbf042000
 +
...
 
</pre>
 
</pre>
* Remove the micro SD card from the SD card reader and install it in the CM-T3730 micro SD card socket (P5).
+
* Load the WL12XX SDIO driver module:
* Continue to the [[#After Installation | After Installation]] section.
+
<pre>
 
+
root@android:/ # insmod /system/lib/modules/wl12xx_sdio.ko
== After Installation ==
+
[  384.983917] wl12xx: loaded
* Connect the host PC to the SB-T35 base-board (connector P12) via the serial cable supplied with the evaluation kit.
+
</pre>
* Start terminal emulation software on your PC. Set baud rate to 115200 bps, 8 bit per frame, 1 stop bit, no parity, no flow control.
+
* Turn the WiFi module up:
* Turn on the CM-T3730 evaluation system. The U-Boot boot-loader will start and you will get a command prompt.
+
<pre>
* Set the {{parameter|bootargs}} environment variable:
+
root@android:/ # netcfg wlan0 up
 +
[ 679.577941] wl12xx: state: 0
 +
[ 680.062042] wl12xx: firmware booted (Rev 6.3.10.0.132)
 +
[  680.082092] ADDRCONF(NETDEV_UP): wlan0: link is not ready
 +
</pre>
 +
:The above messages mean that the interface is up and the firmware is downloaded to the WiFi module.
 +
* Turn the WiFi module down and unload the driver module prior to trying WiFi configuration via Android user interface:
 
<pre>
 
<pre>
setenv bootargs "console=ttyO2,115200n8 androidboot.console=ttyO2 root=/dev/mmcblk0p2 rw rootfstype=ext4 rootwait init=/init ip=dhcp \
+
root@android:/ # netcfg wlan0 down
omap_vout.vid1_static_vrfb_alloc=y vram=8M omapfb.vram=0:8M omapdss.def_disp=dvi omapfb.mode=dvi:1024x768-16"
+
[ 1131.165161] wl12xx: down
 +
root@android:/ # rmmod wl12xx_sdio
 
</pre>
 
</pre>
* To boot preliminary Android Demo image type:
+
 
 +
== Bluetooth ==
 +
=== Introduction ===
 +
The CM-T3730 uses the Bluetooth module on the TI WL1271 device.
 +
The appropriate firmware for the Bluetooth module is supplied with the Android Demo package.<br>
 +
Following features are supported in this release:
 +
* Bluetooth 2.1
 +
* OPP, A2DP, AVRCP, HID profiles are supported
 +
* HSP, HFP profiles are NOT supported
 +
 
 +
=== Android Bluetooth HAL Configuration ===
 +
* The Bluetooth is enabled in {{filename|device/compulab/cm_t3730/BoardConfig.mk}}:
 
<pre>
 
<pre>
CM-T3x # setenv bootdelay 3
+
BOARD_HAVE_BLUETOOTH := true
CM-T3x # setenv bootcmd "mmc rescan; fatload mmc 0 82000000 uImage; bootm"
 
CM-T3x # saveenv
 
CM-T3x # boot
 
 
</pre>
 
</pre>
 +
This enables {{parameter|bluez}} HAL layer, which is used to connect Android Bluetooth Framework and {{parameter|SystemServer}} via DBUS.
 +
* The following services are registered in {{filename|init.rc}} for Bluetooth operation:
 +
** dbus-daemon: connects between hcid and system server
 +
** bluetoothd: create hcid (Bluetooth Host Controller Interface Daemon) service
 +
** uim-sysfs: userspace module for TI-ST kernel driver. This service attaches the BT UART HCI interface to the bluetooth stack. It is also responsible for loading the BT firmware on WL1271.
  
 
= See also =
 
= See also =
* [[CM-T3x: U-Boot: Firmware_Overview]]
+
* [[CM-T3730: Android: Getting started]]
* [[CM-T3x: Linux: Booting from MMC/SD card]]
+
* [[CM-T3730: Android: Building images]]
 +
* [[CM-T3730: Android: Kernel]]
 +
* [[Android: ADB setup]]
 
* [http://source.android.com Android Open Source Project]
 
* [http://source.android.com Android Open Source Project]
 
* [http://code.google.com/p/rowboat Android for Texas Instruments devices]
 
* [http://code.google.com/p/rowboat Android for Texas Instruments devices]
 
+
* [http://code.google.com/p/rowboat/wiki/JellybeanOnBeagleboard_WithSGX Android 4.1.2 Jelly Bean with SGX for AM37x platform]
 +
* [http://developer.android.com/guide/topics/connectivity/bluetooth.html Bluetooth | Android Developers]
  
 
[[Category:Android]]
 
[[Category:Android]]
 
[[Category:CM-T3730]]
 
[[Category:CM-T3730]]

Latest revision as of 10:12, 1 May 2014

Introduction

The Android Demo filesystem image for CM-T3730 is based on Rowboat Android 4.1.2 Jelly Bean support for TI's AM37x platform. The CompuLab Android Demo package for CM-T3730 includes ready to run Demo Android filesystem image and Linux kernel based on 2.6.37 version.

The Android Demo image for CM-T3730 includes following software components:

  • Android Jelly Bean 4.1.2 release from Google
  • Android Linux Kernel v2.6.37
  • SGX OpenGL ES Driver & Libraries DDK v1.10
  • Built-in Applications and Demos
    • Browser, Calculator, Clock, Contacts, Music, Search, File Manager, etc.
  • Peripherals drivers
    • MMC/SD, UART, Ethernet, Matrix Keypad, LCD, Touchscreen, etc.
    • USB (Host and Gadget), Audio out/in, WLAN, Bluetooth

The Getting started with Android on CM-T3730 page provides a brief introduction on how to install and boot the Android Demo image. This article describes package structure and peripheral device options specific to the CM-T3730.

Package contents

version.txt

The contents of the version.txt identifies the package version.

images

  • uImage-cm-t3730.bin - ready to run Linux kernel image binary for CM-T3730
  • Android-image-cm-t3730.tar.bz2 - Android root file system archive

development

The development directory contains a collection of patches with support for CM-T3730. The directory structure preserves the Rowboat Android Source tree structure. It contains patches for several Android sub-projects including Linux kernel.

  • build - contains a collection of patches that determine build specification for CM-T3730
  • device/compulab/cm_t3730 - contains a collection of patches that introduce CM-T3730 support
  • hardware - contains hardware specific patches
    • devmem2 - provides devmem2 utility
    • ti - TI platform specific patches
      • omap3 - patches for CM-T3730 audio
      • sgx - patches for Graphics SDK
  • kernel - contains a collection of patches for Linux kernel with support for CM-T3730 peripherals

kernel

  • uImage-2.6.37-cm-t3730-3.bin - ready to run Linux kernel 2.6.37-cm-t3730-3 for CM-T3730 can be used with either Android or Linux root filesystem
  • linux-2.6.37-cm-t3730-3.config - Linux kernel 2.6.37-cm-t3730-3 configuration file
  • linux-2.6.37-cm-t3730-3.patch - patch vs. rowboat-jb-am37x-4.1.2 tag with support for CM-T3730 peripherals
  • patches - ordered collection of patches, that form the single patch above (linux-2.6.37-cm-t3730-3.patch)

utilities

The utilities directory contains miscellaneous utilities useful for development

  • adb - prebuilt adb binary for Linux host
  • busybox - prebuilt busybox binary v1.19.4
  • eeprom-util - CompuLab EEPROM utility for reading information found inside the EEPROM on CompuLab boards

Using Android on CM-T3730

Audio

Introduction

CM-T3730 uses the audio module of the TPS65930 PMIC for analog audio input and output. The audio module is interfaced to the main processor through the TDM / I2S interface and used to transmit and receive audio data. The audio codec is connected via Multi-Channel Buffered Serial Port (McBSP) interface.

Android Audio HAL Configuration

Android uses the kernel ALSA framework for audio input/output.

The tinyalsa utilities are used for audio playback, capture and configuration. These can be used to test the audio functionality and configuration at kernel-level.

The ALSA HAL is named audio.primary.cm_t3730.so. It uses the file mixer_paths.xml to configure the audio driver. This file contains the ALSA mixer settings for the various audio paths supported by the driver.

Testing audio from command line

Use the tinyalsa utilities to test audio input/output from shell.

  • The tinymix is a mixer utility used for showing and configuring sound settings.
root@android:/ # tinymix
Number of controls: 70
ctl     type    num     name                                     value
0       ENUM    1       Codec Operation Mode                     Option 2 (voice/audio)
1       INT     2       DAC1 Digital Fine Playback Volume        63 63
2       INT     2       DAC2 Digital Fine Playback Volume        63 63
3       INT     2       DAC1 Digital Coarse Playback Volume      0 0
4       INT     2       DAC2 Digital Coarse Playback Volume      0 0
5       INT     2       DAC1 Analog Playback Volume              12 12
6       INT     2       DAC2 Analog Playback Volume              12 12
7       BOOL    2       DAC1 Analog Playback Switch              On On
...
69      BOOL    1       Right1 Analog Loopback Switch            Off
  • To play a simple audio file use the tinyplay media player:
root@android:/ # tinyplay <media-file-name>.wav
  • To record a simple audio file use the tinycap utility:
root@android:/ # tinycap <capture-file-name>.wav

Keypad

The matrix keypad is supplied with the CM-T3730 Evaluation Kit. Connect the keypad to the SB-T35 base-board (connector P10) via 20-pin flat cable supplied with the evaluation kit.

Android Keypad Configuration

The default Android keypad configuration is determined by the Android Key layout file /system/usr/keylayout/TWL4030_Keypad.kl. This file is responsible for mapping Linux key and axis codes to Android key and axis codes and specifying associated policy flags. The TWL4030_Keypad.kl for CM-T3730 looks as follows:

# CM-T3730 TWL4030 KEYPAD keylayout
key 30    BACK               WAKE_DROPPED
key 48    HOME               WAKE
key 46    MENU               WAKE_DROPPED
key 32    SEARCH             WAKE
key 28    POWER              WAKE

USB Gadget

Introduction

The CM-T3730 Android Demo image supports both USB host and USB device ports. USB host can be used to connect Keyboard/Mouse, Mass storage device, etc. The USB device port is used for adb and USB accessory gadgets.

Android USB Gadget Configuration

The Android USB gadget driver is configured via the sysfs entries. The sysfs settings depend on the features required to be enabled. By default only the adb and mtp mode is configured. The adb mode is configured by default. Please refer to the device/compulab/cm_t3730/init.compulabcm-t3730.rc for more details.

Android Mass Storage USB Gadgets

To enable Android Mass Storage USB Gadgets follow the instruction below:

  • Set the Android Gadget to the Mass Storage mode:
root@android:/ # echo 0 > /sys/class/android_usb/android0/enable
root@android:/ # echo mass_storage > /sys/class/android_usb/android0/functions
root@android:/ # echo 1 > /sys/class/android_usb/android0/enable
  • Make sure the external storage device you want to use (e.g. USB stick, SD/MMC card) is plugged/installed into the CM-T3730 and has a proper partition:
root@android:/ # ls -l /dev/block/
...
brw------- root     root     179,   0 2013-05-07 09:37 mmcblk0
brw------- root     root     179,   1 2013-05-07 09:37 mmcblk0p1
brw------- root     root     179,   2 2013-05-07 09:37 mmcblk0p2
brw------- root     root     179,   3 2013-05-07 09:37 mmcblk0p3
...
brw------- root     root       8,   0 2013-05-07 09:37 sda
brw------- root     root       8,   1 2013-05-07 09:37 sda1
...
root@android:/ # cat /proc/partitions
major minor  #blocks  name

 179        0    7842816 mmcblk0
 179        1     120456 mmcblk0p1
 179        2    5669520 mmcblk0p2
 179        3    2051815 mmcblk0p3
   8        0    1970239 sda
   8        1    1969215 sda1
  • Make sure the partition you're going to share is not mounted. Otherwise unmount it.
  • Share the partition:
root@android:/ # echo /dev/block/mmcblk0p3 > /sys/class/android_usb/f_mass_storage/lun/file
  • Finally, connect the CM-T3730 to your host via USB OTG port.

ADB over USB

Please refer to the Android: ADB setup article for more information about the ADB over USB.

WiFi

Introduction

The CM-T3730 uses the TI WL1271 device. The CM-T3730 Android Demo package uses WL12XX Compat wireless SDK instead of the device driver integrated into the Linux kernel. The WL12XX Compat SDK includes the WL1271 device driver as well as the device firmware.

Android WiFi HAL Configuration

  • The TI version of wpa_supplicant 0.8.x is enabled in device/compulab/cm_t3730/BoardConfig.mk:
BOARD_WPA_SUPPLICANT_DRIVER      := NL80211
WPA_SUPPLICANT_VERSION           := VER_0_8_X_TI
BOARD_HOSTAPD_DRIVER             := NL80211
BOARD_WLAN_DEVICE                := wl12xx_mac80211
BOARD_SOFTAP_DEVICE              := wl12xx_mac80211
WIFI_DRIVER_MODULE_PATH          := "/system/lib/modules/wl12xx_sdio.ko"
WIFI_DRIVER_MODULE_NAME          := "wl12xx_sdio"

This enables building the wpa_supplicant 0.8.x with NL80211. Additionally, it specifies the wl12xx_sdio as the WiFi driver that is loaded at run time.

  • The WiFi interface name wlan0 is set in the device/compulab/cm_t3730/device.mk:
PRODUCT_PROPERTY_OVERRIDES += \
        wifi.interface=wlan0
  • Finally, the wpa_supplicant and the dhcpcd daemons are started in the CM-T3730 init file. Please refer to the device/compulab/cm_t3730/init.compulabcm-t3730.rc for more details.

Testing WiFi from command line

  • Check the WiFi modules are loaded:
root@android:/ # lsmod
wl12xx 198125 0 - Live 0xbf0f6000
mac80211 341334 1 wl12xx, Live 0xbf083000
cfg80211 158648 2 wl12xx,mac80211, Live 0xbf04b000
compat 7163 2 wl12xx,mac80211, Live 0xbf042000
...
  • Load the WL12XX SDIO driver module:
root@android:/ # insmod /system/lib/modules/wl12xx_sdio.ko
[  384.983917] wl12xx: loaded
  • Turn the WiFi module up:
root@android:/ # netcfg wlan0 up
[  679.577941] wl12xx: state: 0
[  680.062042] wl12xx: firmware booted (Rev 6.3.10.0.132)
[  680.082092] ADDRCONF(NETDEV_UP): wlan0: link is not ready
The above messages mean that the interface is up and the firmware is downloaded to the WiFi module.
  • Turn the WiFi module down and unload the driver module prior to trying WiFi configuration via Android user interface:
root@android:/ # netcfg wlan0 down
[ 1131.165161] wl12xx: down
root@android:/ # rmmod wl12xx_sdio

Bluetooth

Introduction

The CM-T3730 uses the Bluetooth module on the TI WL1271 device. The appropriate firmware for the Bluetooth module is supplied with the Android Demo package.
Following features are supported in this release:

  • Bluetooth 2.1
  • OPP, A2DP, AVRCP, HID profiles are supported
  • HSP, HFP profiles are NOT supported

Android Bluetooth HAL Configuration

  • The Bluetooth is enabled in device/compulab/cm_t3730/BoardConfig.mk:
BOARD_HAVE_BLUETOOTH := true

This enables bluez HAL layer, which is used to connect Android Bluetooth Framework and SystemServer via DBUS.

  • The following services are registered in init.rc for Bluetooth operation:
    • dbus-daemon: connects between hcid and system server
    • bluetoothd: create hcid (Bluetooth Host Controller Interface Daemon) service
    • uim-sysfs: userspace module for TI-ST kernel driver. This service attaches the BT UART HCI interface to the bluetooth stack. It is also responsible for loading the BT firmware on WL1271.

See also