VAR-SOM-MX6 Android Unit Testing KK 100

From Variscite Wiki
Unit 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/media_rw/extsd/test0.wav 

Hit CTRL-C after couple of seconds or more.

root@android:/ # tinyplay /mnt/media_rw/extsd/test0.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. Test USB Stick with:

$ dd if=/dev/zero of=/dev/sdb bs=128K count=10000

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.

FASTBOOT

Install tools on host

$ sudo add-apt-repository ppa:nilarimogard/webupd8
$ sudo apt-get update
$ sudo apt-get install android-tools-fastboot
$ sudo apt-get install android-tools-adb android-tools-fastboot

Flash target:NAND

NOTE:

In order to flash u-boot make sure you have updated your u-boot to commit e2d4f1d10f192072a3166d7e051340c955ce4975. You can do the update bu running: "setenv fbparts 2m@2m(uboot) 16m@4m(boot) 28m@20m(recovery) 464m@48m(android_root)" from u-boot.

Boot the target press spacebar to stop at u-boot and run "fastboot". From KitKat build folder

$ sudo `which fastboot` flash uboot out/target/product/var_som_mx6/u-boot-mx6-nand.img
$ sudo `which fastboot` flash boot out/target/product/var_som_mx6/boot.img
$ sudo `which fastboot` flash recovery out/target/product/var_som_mx6/recovery.img
$ sudo `which fastboot` flash android_root out/target/product/var_som_mx6/android_root.img
$ sudo `which fastboot` reboot

Flash target:eMMC

NOTE:

Make sure you built Android for sdcard. "./build.sh mx6 sdcard"

You need to rebuild u-boot with eMMC suport.

gedit include/configs/mx6_var_som_nand_android.h
-#define CONFIG_FASTBOOT_STORAGE_NAND
-/* #define CONFIG_FASTBOOT_STORAGE_EMMC_SATA */
+/* #define CONFIG_FASTBOOT_STORAGE_NAND */
+#define CONFIG_FASTBOOT_STORAGE_EMMC_SATA

In case you already have partitions on the eMMC you can skip the next step.

$ sudo `which fastboot` flash mbr  emmc_mbr.img

The mbr need to be collected once of an eMMC formatted target. You can install the eMMC by using our nand-recovery utility.

$ dd if=/dev/mmcblk1 of=emmc_mbr.img bs=512 count=1

Boot the target press spacebar to stop at u-boot and run "fastboot". From KitKat build folder

$ sudo `which fastboot` flash boot out/target/product/var_som_mx6/boot.img
$ sudo `which fastboot` flash recovery out/target/product/var_som_mx6/recovery.img
$ sudo `which fastboot` flash system out/target/product/var_som_mx6/system.img
$ sudo `which fastboot` reboot

Change your boot command

$ setenv bootcmd booti mmc0
$ saveenv

HDMI

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

Change enviroment setting with the folowing command

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

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.

Audio over HDMI

Download and install SoundAbout pm install /mnt/media_rw/udisk/apk/SoundAbout-com.woodslink.android.wiredheadphoneroutingfix-122-v2.5.8.0.apk Use the GUI to set the service as foreground and select the audio over HDMI.

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=mxcfb2:off vmalloc=400M androidboot.console=ttymxc0 androidboot.hardware=freescale caam mtdparts=gpmi-nand:4m(bootloader),16m(bootimg),28m(recovery),-(root) ubi.mtd=3 androidboot.serialno=190e61d4df64632c var_ts_type=ctw6120

Ethernet

Just plug a cable into the system

WLAN

Setup

VAR-SOM-MX6 V2.X & V1.x(Wilink6/WiLink8): First time need to set mac address to be used automatically

$ mount -o remount,rw /system 
$ calibrator set nvs_mac /system/etc/firmware/ti-connectivity/wl1271-nvs.bin 00:00:00:00:00:00

VAR-SOM-MX6 V2.X (WiLink8): First time need to select your correct device

  • Select your WL183x p/n:
$ mount -o remount,rw /system 
$ cd /etc/wifi/wlconf
$ . ./configure-device.sh wl1831
select one out of : WL1831, WL1833, WL1835, WL1837.
As a result some additional information may be required like 1/2 antenna connected

Test

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 camera. You can take a picture and send it over Bluetooth to a PC host.

NOTE:

First time boot of Android must be with camera module installed. If you booted without the camera module installed Android will mark the system as "no camera". In such a case you need to re flash the Android and first time boot it with camera installed.

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.

Canbus

We added support for canbus in the kernel and the support library layer.

Connect 2 boards. Each board JP26 connect to the other with the right cable. Set the 2 boards:

$ ip link set can0 up type can bitrate 1000000
$ busybox ifconfig can0 up up

On board 1:

$ candump can0

On board 2:

$ cansend can0 500#1E.10.10