Difference between revisions of "CM-T335: Android: Getting started"

From Compulab Mediawiki
Jump to: navigation, search
(Installing Android)
(Mount the installation source media)
 
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
= Introduction =
 
= Introduction =
The Android Demo filesystem image for CM-T335 is based on Android 4.1.2 Jelly Bean with SGX (3D graphics acceleration) support. The CompuLab Android Demo package for CM-T335 includes ready to run Demo Android filesystem image and Linux kernel based on 3.2.0 version.
+
The Android Demo filesystem image for the CompuLab CM-T335 System-on-Module / Computer-on-Module is based on Android 4.1.2 Jelly Bean with SGX (3D graphics acceleration) support.
{{Note|We do not recommend using Android Demo Image on CM-T335 devices with less then 256MB of RAM.}}
+
The CompuLab Android Demo package for CM-T335 includes ready to run Demo Android filesystem image and Linux kernel based on 3.2.0 version.
 +
{{Note|Minimal system requirements for Android Demo Image: CPU with 2D/3D graphics acceleration (SGX) support ('''C600G''' assembly option), memory of 256MB at least.}}
  
 
= Preparation steps =
 
= Preparation steps =
 
* Obtain a Linux PC workstation.
 
* Obtain a Linux PC workstation.
* Get a USB Card reader and a micro SD Card. Use either the micro SD card, supplied with the CM-T335 Evaluation kit, or create a new one.
+
* For networked installation you need to install a TFTP server on the host PC. For Windows machines we recommend [http://tftpd32.jounin.net/ TFTPD32] included in the Linux package for CM-T335 (link below).
* Plug the USB SD Card reader to a 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}}.
 
 
* Download the [http://compulab.co.il/products/computer-on-modules/cm-t335/#devres Android Demo package for CM-T335] from CompuLab website. Unzip the package to a directory on your host workstation.
 
* Download the [http://compulab.co.il/products/computer-on-modules/cm-t335/#devres Android Demo package for CM-T335] from CompuLab website. Unzip the package to a directory on your host workstation.
 
* All image files mentioned below can be found in {{filename|images}} subdirectory of the Demo package.
 
* All image files mentioned below can be found in {{filename|images}} subdirectory of the Demo package.
 +
* Connect the host PC to the SB-T335 base-board (connector P11) via the serial cable supplied with the evaluation kit.
 +
* 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 on the CM-T335 evaluation system. The U-Boot boot-loader will start and you will get a command prompt.
 +
*: {{Note|If the boot settings of your CM-T335 are different than the default, you may need to press and hold '''Ctrl-C''' while turning the CM-T335 on, in order to get command prompt.}}
 +
 +
= Install images on the target =
 +
== Boot into the installation environment (ramdisk) ==
 +
The first step in CM-T335 Android installation is starting the installation environment (Linux kernel and Ramdisk image).
 +
This can be done using one of the following media:
 +
* [[#Using installation environment on micro SD card|Micro SD card]]
 +
* [[#Using installation environment on USB storage device|USB storage device]]
 +
* [[#Using installation environment from TFTP server|Network TFTP server]]
 +
 +
=== Using installation environment on micro SD card ===
 +
* Copy {{filename|kernel.img}}, {{filename|ramdisk.img}} and {{filename|bootscr.img}} from [http://compulab.co.il/products/computer-on-modules/cm-t335/#devres Android Demo package for CM-T335] to the root directory on the first partition of the micro SD card.
 +
{{Note|The partition has to be formatted with either ext2/3/4 or FAT16/32 file system.}}
 +
* Insert the micro SD card into the SD socket (P23) on the SB-T335.
 +
* Use the following U-boot commands to boot the installation environment on the CM-T335:
 +
<pre>
 +
CM-T335 # mmc rescan
 +
CM-T335 # load mmc 0:1 80400000 bootscr.img
 +
CM-T335 # source 80400000
 +
</pre>
 +
* Continue to the [[#Install Kernel and Android Images | Install Kernel and Android Images]] section.
 +
 +
=== Using installation environment on USB storage device ===
 +
* Copy {{filename|kernel.img}}, {{filename|ramdisk.img}} and {{filename|bootscr.img}} from [http://compulab.co.il/products/computer-on-modules/cm-t335/#devres Android Demo package for CM-T335] to the root directory on the first partition on the USB storage device.
 +
{{Note|The partition has to be formatted with either ext2/3/4 or FAT16/32 file system.}}
 +
* Plug the USB storage device into:
 +
** USB host connector (either P25, P26, P27 or P28) on SB-T335 if the CM-T335 module has U4 configuration or
 +
** USB OTG connector (P19) on SB-T335 if the CM-T335 module has U1 configuration
 +
* Use the following U-boot commands to boot the installation environment on the CM-T335:
 +
<pre>
 +
CM-T335 # usb start
 +
CM-T335 # load usb 0:1 80400000 bootscr.img
 +
CM-T335 # source 80400000
 +
</pre>
 +
* Continue to the [[#Install Kernel and Android Images | Install Kernel and Android Images]] section.
  
= Preparing MMC/SD card =
+
=== Using installation environment from TFTP server ===
 +
* Connect the CM-T335 Ethernet port (connector P2 on the SB-T335) to your local network.
 +
* Put {{filename|kernel.img}} and {{filename|ramdisk.img}} from [http://compulab.co.il/products/computer-on-modules/cm-t335/#devres Linux package for CM-T335] to a location accessible by the TFTP server:
 +
*: - On Windows machine: copy {{filename|kernel.img}} and {{filename|ramdisk.img}} to the same folder and point the TFTP server to that folder
 +
*: - On Linux machine: copy {{filename|kernel.img}} and {{filename|ramdisk.img}} to the TFTP server root directory, usually {{filename|/tftpboot}} or {{filename|/tftproot}}.
 +
* You can use U-boot {{cmd|dhcp}} command to obtain IP address or manually set {{parameter|ipaddr}} environment variable:
 +
<pre>
 +
CM-T335 # setenv ipaddr <CM-T335 ip address>
 +
</pre>
 +
* Set the {{parameter|serverip}} environment variable and save the new environment:
 +
<pre>
 +
CM-T335 # setenv serverip <tftp server host ip address>
 +
CM-T335 # saveenv
 +
</pre>
 +
* Use the following U-Boot commands to boot Linux on CM-T335:
 +
<pre>
 +
CM-T335 # setenv bootargs "root=/dev/ram0 ramdisk_size=16384 console=ttyO0,115200"
 +
CM-T335 # tftpboot 82000000 kernel.img && tftpboot 81000000 ramdisk.img
 +
CM-T335 # bootm 82000000 81000000
 +
</pre>
 +
* Continue to the [[#Install Kernel and Android Images | Install Kernel and Android Images]] section.
 +
 
 +
== Install Kernel and Android Images ==
 +
After the ramdisk image is loaded the Linux command line prompt will appear.<br>
 +
 
 +
=== Mount the installation source media ===
 +
The next step is installing the kernel and Android images. Any one of the following media can be used as a source for installation:
 +
* [[#Mount a micro SD Card|Micro SD Card]]
 +
* [[#Mount a USB Storage Device|USB storage device]]
 +
* [[#Mount an NFS drive|NFS drive]]
 +
 
 +
==== Mount a micro SD Card ====
 +
* Copy the the {{filename|Android-image-cm-t335.tar.bz2}}, and the {{filename|uImage-cm-t335}} from the [http://compulab.co.il/products/computer-on-modules/cm-t335/#devres Android Demo package for CM-T335] to the root directory of any partition on the micro SD card. The partition can be formatted as either ext2/3/4 or FAT file system.
 +
* Insert the micro SD card into the SD socket (P23) on the SB-T335.
 +
* The micro SD card is mounted automatically under /media/mmcblk0pX. Where X is the partition number.
 +
* If for some reason the micro SD card hasn't been mounted automatically, use the following mount command:
 +
<pre>
 +
root@compulab:~# mkdir -p /media/mmcblk0pX && mount /dev/mmcblk0pX /media/mmcblk0pX
 +
</pre>
 +
* Continue to the [[#Install Images | Install Images]] section.
 +
 
 +
==== Mount a USB Storage Device ====
 +
* Copy the {{filename|Android-image-cm-t335.tar.bz2}} and the {{filename|uImage-cm-t335}} from [http://compulab.co.il/products/computer-on-modules/cm-t335/#devres Android Demo package for CM-T335] to the root directory of any partition on the USB storage device.
 +
* Plug the USB storage device to any USB host connector (either P25, P26, P27 or P28) on SB-T335 if the CM-T335 module has U4 configuration or to USB OTG connector (P19) on SB-T335 if the CM-T335 module has U1 configuration.
 +
* The USB device is mounted automatically under /media/sdXY. Where X is the device letter and Y is the partition number.
 +
* If for some reason the USB storage device hasn't been mounted automatically, use the following mount command:
 +
<pre>
 +
root@compulab:~# mkdir -p /media/sdXY && mount /dev/sdXY /media/sdXY
 +
</pre>
 +
* Continue to the [[#Install Images | Install Images]] section.
 +
 
 +
==== Mount an NFS drive ====
 +
* Connect the CM-T335 Ethernet port (connector P2 on the SB-T335) to your local network.
 +
* Copy the {{filename|Android-image-cm-t335.tar.bz2}}, and the {{filename|uImage-cm-t335}} from the [http://compulab.co.il/products/computer-on-modules/cm-t335/#devres Android Demo package for CM-T335] to a directory exported through NFS.
 +
* Obtain an IP address for the CM-T335:
 +
** Using DHCP:<pre>root@compulab:~# ifup `basename /sys/class/net/eth?`</pre>
 +
** If you do not have a DHCP server, you can set a static IP address using {{cmd|ifconfig}}:<pre>root@compulab:~#  ifconfig `basename /sys/class/net/eth?` <ip address></pre>
 +
* Mount the NFS share containing the {{filename|uImage-cm-t335}}, and the {{filename|Android-image-cm-t335.tar.bz2}} files:
 +
<pre>
 +
root@compulab:~#  mount -o nolock <host ip>:/path/to/nfs/share /mnt/net
 +
</pre>
 +
* Continue to [[#Install Images | Install Images]] section.
 +
 
 +
=== Install Images ===
 +
Once the ramdisk image is loaded and the media containing the CM-T335 Kernel and Android images is mounted, the installation can be done on either of the following:
 +
* [[#Install on the NAND flash|NAND Flash]]
 +
* [[#Install on the micro SD Card|Micro SD Card]]
 +
 
 +
==== Install on the NAND flash ====
 +
The installation on the NAND flash can be done using the mounted media containing the CM-T335 Kernel and Android images.
 +
* In this subsection the term {{filename|/mount/point}} can be:
 +
** {{filename|/mnt/net}} if NFS is used
 +
** {{filename|/media/mmcblk0pX}} if a micro SD card is used, where X is the partition number
 +
** {{filename|/media/sdXY}} if USB storage is used, where X is the USB drive letter and Y is the partition number.
 +
 
 +
* Format the NAND flash kernel partition and write the kernel image onto it:
 +
<pre>
 +
root@compulab:~# flash_erase /dev/mtd5 0 0
 +
root@compulab:~# nandwrite -p /dev/mtd5 /mount/point/uImage-cm-t335
 +
</pre>
 +
* Format the NAND flash root filesystem partition:
 +
<pre>
 +
root@compulab:~# ubiformat /dev/mtd6
 +
</pre>
 +
* Attach the NAND flash root filesystem partition:
 +
<pre>
 +
root@compulab:~# ubiattach -m 6 -d 0
 +
</pre>
 +
* Create a ubi volume and name it "rootfs":
 +
<pre>
 +
root@compulab:~# ubimkvol /dev/ubi0 -m -N rootfs
 +
</pre>
 +
* Mount the ubi volume:
 +
<pre>
 +
root@compulab:~# mkdir -p /media/rootfs && mount -t ubifs ubi0:rootfs /media/rootfs
 +
</pre>
 +
* Extract the content of {{filename|Android-image-cm-t335.tar.bz2}} onto the /media/rootfs:
 +
<pre>
 +
root@compulab:~# tar --numeric-owner -xpf /mount/point/Android-image-cm-t335.tar.bz2 -C /media/rootfs && sync
 +
</pre>
 +
* Unmount the ubi volume:
 +
<pre>
 +
root@compulab:~# umount /media/rootfs
 +
</pre>
 +
* Turn off the CM-T335 evaluation system.
 +
* Continue to the [[#After Installation | After Installation]] section.
 +
 
 +
==== Install on the micro SD Card ====
 +
{{Note|Micro SD card socket has no card detect feature. Thus make sure the micro SD card is plugged into the SD socket (P23) on the SB-T335 prior to booting into the installation environment.}}
 +
{{Note|All data stored on the micro SD card will be destroyed.}}
 +
* In this subsection the term {{filename|/mount/point}} can be:
 +
** {{filename|/mnt/net}} if NFS is used
 +
** {{filename|/media/sdXY}} if USB storage is used, where X is the USB drive letter and Y is the partition number.
 +
* Make sure no micro SD card partition is mounted:
 +
<pre>
 +
root@compulab:~# cat /proc/mounts | grep -c mmcblk0
 +
0
 +
</pre>
 +
* Otherwise unmount all micro SD card partitions:
 +
<pre>
 +
root@compulab:~# umount /dev/mmcblk0p*
 +
</pre>
 +
* Override the micro SD card partition table with zeros:
 +
<pre>
 +
root@compulab:~# dd if=/dev/zero of=/dev/mmcblk0 bs=4096 count=1
 +
</pre>
 +
* Re-scan the the micro SD card partition information and update the kernel partition table:
 +
<pre>
 +
root@compulab:~# hdparm -z /dev/mmcblk0
 +
</pre>
 +
* Create two partitions on the micro SD card. Please refer to the [[CM-T3x: U-Boot: Firmware_Overview#Default MMC.2FSD card mapping | Default MMC/SD Card mapping]] article for more information about the CM-T335 default SD card mapping.
 +
<pre>
 +
root@compulab:~# echo -e "u\nn\np\n1\n\n+120M\nt\nc\na\n1\nn\np\n2\n\n\nw\neof\n" | fdisk /dev/mmcblk0
 +
</pre>
 +
* Unmount both micro SD card partitions:
 +
<pre>
 +
root@compulab:~# umount /dev/mmcblk0p*
 +
</pre>
 +
* Format the first (FAT) partition:
 +
<pre>
 +
root@compulab:~# mkfs.vfat -F 32 -n boot /dev/mmcblk0p1
 +
</pre>
 +
* Format the second (Linux) partition:
 +
<pre>
 +
root@compulab:~# mkfs.ext4 -L rootfs /dev/mmcblk0p2
 +
</pre>
 +
* Use the following mount command to mount micro SD card partitions /media/mmcblk0pX, where X is the partition number:
 +
<pre>
 +
root@compulab:~# mkdir -p /media/mmcblk0pX && mount /dev/mmcblk0pX /media/mmcblk0pX
 +
</pre>
 +
* Copy the {{filename|uImage-cm-t335}} to the first partition:
 +
<pre>
 +
root@compulab:~# cp /mount/point/uImage-cm-t335 /media/mmcblk0p1/
 +
</pre>
 +
* Extract the content of {{filename|Android-image-cm-t335.tar.bz2}} onto the second partition:
 +
<pre>
 +
root@compulab:~# tar --numeric-owner -xpf /mount/point/Android-image-cm-t335.tar.bz2 -C /media/mmcblk0p2 && sync
 +
</pre>
 +
* Turn off the CM-T335 evaluation system.
 +
* Continue to the [[#After Installation | After Installation]] section.
 +
 
 +
= Install Images on the micro SD Card using Linux Host workstation =
 +
Installation of Kernel and Android images on micro SD card can be also performed using Linux Host workstation.
 +
* Obtain a Linux PC workstation.
 +
* Get a USB Card reader and a micro SD Card. Use either the micro SD card, supplied with the CM-T335 Evaluation kit, or create a new one.
 +
* Plug the USB SD Card reader to a 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}}.
 +
* Depending on the desktop system setup, following steps might require super user privileges.
 
* Create two partitions (FAT32 partition for 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:
 
* Create two partitions (FAT32 partition for 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:
 
<pre>
 
<pre>
Line 42: Line 246:
 
sudo mount /dev/sdc2 /media/rootfs
 
sudo mount /dev/sdc2 /media/rootfs
 
</pre>
 
</pre>
 
= Installing Kernel =
 
 
* Copy Linux kernel image on to the boot partition:
 
* Copy Linux kernel image on to the boot partition:
 
<pre>
 
<pre>
 
cp /path/to/cm-t335-android/images/uImage-cm-t335 /media/boot/
 
cp /path/to/cm-t335-android/images/uImage-cm-t335 /media/boot/
 
</pre>
 
</pre>
 
= Installing Android =
 
 
* Extract the Android Demo root filesystem on to that partition:
 
* Extract the Android Demo root filesystem on to that partition:
 
<pre>
 
<pre>
Line 62: Line 262:
  
 
= After Installation =
 
= After Installation =
* Connect the host PC to the SB-T335 base-board (connector P11) via the serial cable supplied with the evaluation kit.
+
Turn on the CM-T335 evaluation system. Hit any key to prevent autoboot and get into the U-Boot command prompt.
* 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.
+
 
* Connect the DVI display to the CM-T335 evaluation system. The U-Boot boot-loader will start and you will get a command prompt.
+
== Select video out ==
 +
Default CM-T335 video output device is DVI. Other video output devices can be used as well.
 +
* To enable LCD video output:
 +
<pre>
 +
CM-T335 # setenv disp_type lcd
 +
</pre>
 +
* To enable LVDS video output:
 +
<pre>
 +
CM-T335 # setenv disp_type lvds
 +
</pre>
 +
 
 +
== Boot from the NAND flash ==
 
* Set the {{parameter|bootargs}} environment variable:
 
* Set the {{parameter|bootargs}} environment variable:
 
<pre>
 
<pre>
setenv bootargs "console=ttyO0,115200n8 androidboot.console=ttyO0 root=/dev/mmcblk0p2 rw rootfstype=ext4 rootwait init=/init ip=off"
+
CM-T335 # setenv bootargs "console=ttyO0,115200n8 androidboot.console=ttyO0 root=ubi0:rootfs rootfstype=ubifs ubi.mtd=rootfs,2048 rw rootwait init=/init ip=off cm_t335_disp=${disp_type}"
 
</pre>
 
</pre>
 
* To boot Android Demo image type:
 
* To boot Android Demo image type:
 
<pre>
 
<pre>
CM-T3x # setenv bootdelay 3
+
CM-T335 # setenv bootdelay 3
CM-T3x # setenv bootcmd "mmc rescan; fatload mmc 0 82000000 uImage-cm-t335; bootm"
+
CM-T335 # setenv bootcmd "nboot 82000000 nand0 900000; bootm"
CM-T3x # saveenv
+
CM-T335 # saveenv
CM-T3x # boot
+
CM-T335 # boot
 
</pre>
 
</pre>
  
=== Select video out ===
+
== Boot from the micro SD card ==
 
+
* Set the {{parameter|bootargs}} environment variable:
Default CM-T335 video output device is DVI.  
+
<pre>
LCD video output can be enabled by adding the following boot options to the kernel command line parameters:
+
CM-T335 # setenv bootargs "console=ttyO0,115200n8 androidboot.console=ttyO0 root=/dev/mmcblk0p2 rw rootfstype=ext4 rootwait init=/init ip=off cm_t335_disp=${disp_type}"
 +
</pre>
 +
* To boot Android Demo image type:
 
<pre>
 
<pre>
cm_t335_disp=lcd
+
CM-T335 # setenv bootdelay 3
 +
CM-T335 # setenv bootcmd "mmc rescan; load mmc 0:1 82000000 uImage-cm-t335; bootm"
 +
CM-T335 # saveenv
 +
CM-T335 # boot
 
</pre>
 
</pre>
  

Latest revision as of 07:13, 23 June 2015

Introduction

The Android Demo filesystem image for the CompuLab CM-T335 System-on-Module / Computer-on-Module is based on Android 4.1.2 Jelly Bean with SGX (3D graphics acceleration) support. The CompuLab Android Demo package for CM-T335 includes ready to run Demo Android filesystem image and Linux kernel based on 3.2.0 version.

Admolition note.png Minimal system requirements for Android Demo Image: CPU with 2D/3D graphics acceleration (SGX) support (C600G assembly option), memory of 256MB at least.

Preparation steps

  • Obtain a Linux PC workstation.
  • For networked installation you need to install a TFTP server on the host PC. For Windows machines we recommend TFTPD32 included in the Linux package for CM-T335 (link below).
  • Download the Android Demo package for CM-T335 from CompuLab website. Unzip the package to a directory on your host workstation.
  • All image files mentioned below can be found in images subdirectory of the Demo package.
  • Connect the host PC to the SB-T335 base-board (connector P11) via the serial cable supplied with the evaluation kit.
  • 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 on the CM-T335 evaluation system. The U-Boot boot-loader will start and you will get a command prompt.
Admolition note.png If the boot settings of your CM-T335 are different than the default, you may need to press and hold Ctrl-C while turning the CM-T335 on, in order to get command prompt.

Install images on the target

Boot into the installation environment (ramdisk)

The first step in CM-T335 Android installation is starting the installation environment (Linux kernel and Ramdisk image). This can be done using one of the following media:

Using installation environment on micro SD card

Admolition note.png The partition has to be formatted with either ext2/3/4 or FAT16/32 file system.
  • Insert the micro SD card into the SD socket (P23) on the SB-T335.
  • Use the following U-boot commands to boot the installation environment on the CM-T335:
CM-T335 # mmc rescan
CM-T335 # load mmc 0:1 80400000 bootscr.img
CM-T335 # source 80400000

Using installation environment on USB storage device

Admolition note.png The partition has to be formatted with either ext2/3/4 or FAT16/32 file system.
  • Plug the USB storage device into:
    • USB host connector (either P25, P26, P27 or P28) on SB-T335 if the CM-T335 module has U4 configuration or
    • USB OTG connector (P19) on SB-T335 if the CM-T335 module has U1 configuration
  • Use the following U-boot commands to boot the installation environment on the CM-T335:
CM-T335 # usb start
CM-T335 # load usb 0:1 80400000 bootscr.img
CM-T335 # source 80400000

Using installation environment from TFTP server

  • Connect the CM-T335 Ethernet port (connector P2 on the SB-T335) to your local network.
  • Put kernel.img and ramdisk.img from Linux package for CM-T335 to a location accessible by the TFTP server:
    - On Windows machine: copy kernel.img and ramdisk.img to the same folder and point the TFTP server to that folder
    - On Linux machine: copy kernel.img and ramdisk.img to the TFTP server root directory, usually /tftpboot or /tftproot.
  • You can use U-boot dhcp command to obtain IP address or manually set ipaddr environment variable:
CM-T335 # setenv ipaddr <CM-T335 ip address>
  • Set the serverip environment variable and save the new environment:
CM-T335 # setenv serverip <tftp server host ip address>
CM-T335 # saveenv
  • Use the following U-Boot commands to boot Linux on CM-T335:
CM-T335 # setenv bootargs "root=/dev/ram0 ramdisk_size=16384 console=ttyO0,115200"
CM-T335 # tftpboot 82000000 kernel.img && tftpboot 81000000 ramdisk.img
CM-T335 # bootm 82000000 81000000

Install Kernel and Android Images

After the ramdisk image is loaded the Linux command line prompt will appear.

Mount the installation source media

The next step is installing the kernel and Android images. Any one of the following media can be used as a source for installation:

Mount a micro SD Card

  • Copy the the Android-image-cm-t335.tar.bz2, and the uImage-cm-t335 from the Android Demo package for CM-T335 to the root directory of any partition on the micro SD card. The partition can be formatted as either ext2/3/4 or FAT file system.
  • Insert the micro SD card into the SD socket (P23) on the SB-T335.
  • The micro SD card is mounted automatically under /media/mmcblk0pX. Where X is the partition number.
  • If for some reason the micro SD card hasn't been mounted automatically, use the following mount command:
root@compulab:~# mkdir -p /media/mmcblk0pX && mount /dev/mmcblk0pX /media/mmcblk0pX

Mount a USB Storage Device

  • Copy the Android-image-cm-t335.tar.bz2 and the uImage-cm-t335 from Android Demo package for CM-T335 to the root directory of any partition on the USB storage device.
  • Plug the USB storage device to any USB host connector (either P25, P26, P27 or P28) on SB-T335 if the CM-T335 module has U4 configuration or to USB OTG connector (P19) on SB-T335 if the CM-T335 module has U1 configuration.
  • The USB device is mounted automatically under /media/sdXY. Where X is the device letter and Y is the partition number.
  • If for some reason the USB storage device hasn't been mounted automatically, use the following mount command:
root@compulab:~# mkdir -p /media/sdXY && mount /dev/sdXY /media/sdXY

Mount an NFS drive

  • Connect the CM-T335 Ethernet port (connector P2 on the SB-T335) to your local network.
  • Copy the Android-image-cm-t335.tar.bz2, and the uImage-cm-t335 from the Android Demo package for CM-T335 to a directory exported through NFS.
  • Obtain an IP address for the CM-T335:
    • Using DHCP:
      root@compulab:~# ifup `basename /sys/class/net/eth?`
    • If you do not have a DHCP server, you can set a static IP address using ifconfig:
      root@compulab:~#  ifconfig `basename /sys/class/net/eth?` <ip address>
  • Mount the NFS share containing the uImage-cm-t335, and the Android-image-cm-t335.tar.bz2 files:
root@compulab:~#  mount -o nolock <host ip>:/path/to/nfs/share /mnt/net

Install Images

Once the ramdisk image is loaded and the media containing the CM-T335 Kernel and Android images is mounted, the installation can be done on either of the following:

Install on the NAND flash

The installation on the NAND flash can be done using the mounted media containing the CM-T335 Kernel and Android images.

  • In this subsection the term /mount/point can be:
    • /mnt/net if NFS is used
    • /media/mmcblk0pX if a micro SD card is used, where X is the partition number
    • /media/sdXY if USB storage is used, where X is the USB drive letter and Y is the partition number.
  • Format the NAND flash kernel partition and write the kernel image onto it:
root@compulab:~# flash_erase /dev/mtd5 0 0
root@compulab:~# nandwrite -p /dev/mtd5 /mount/point/uImage-cm-t335
  • Format the NAND flash root filesystem partition:
root@compulab:~# ubiformat /dev/mtd6
  • Attach the NAND flash root filesystem partition:
root@compulab:~# ubiattach -m 6 -d 0
  • Create a ubi volume and name it "rootfs":
root@compulab:~# ubimkvol /dev/ubi0 -m -N rootfs
  • Mount the ubi volume:
root@compulab:~# mkdir -p /media/rootfs && mount -t ubifs ubi0:rootfs /media/rootfs
  • Extract the content of Android-image-cm-t335.tar.bz2 onto the /media/rootfs:
root@compulab:~# tar --numeric-owner -xpf /mount/point/Android-image-cm-t335.tar.bz2 -C /media/rootfs && sync
  • Unmount the ubi volume:
root@compulab:~# umount /media/rootfs

Install on the micro SD Card

Admolition note.png Micro SD card socket has no card detect feature. Thus make sure the micro SD card is plugged into the SD socket (P23) on the SB-T335 prior to booting into the installation environment.
Admolition note.png All data stored on the micro SD card will be destroyed.
  • In this subsection the term /mount/point can be:
    • /mnt/net if NFS is used
    • /media/sdXY if USB storage is used, where X is the USB drive letter and Y is the partition number.
  • Make sure no micro SD card partition is mounted:
root@compulab:~# cat /proc/mounts | grep -c mmcblk0
0
  • Otherwise unmount all micro SD card partitions:
root@compulab:~# umount /dev/mmcblk0p*
  • Override the micro SD card partition table with zeros:
root@compulab:~# dd if=/dev/zero of=/dev/mmcblk0 bs=4096 count=1
  • Re-scan the the micro SD card partition information and update the kernel partition table:
root@compulab:~# hdparm -z /dev/mmcblk0
  • Create two partitions on the micro SD card. Please refer to the Default MMC/SD Card mapping article for more information about the CM-T335 default SD card mapping.
root@compulab:~# echo -e "u\nn\np\n1\n\n+120M\nt\nc\na\n1\nn\np\n2\n\n\nw\neof\n" | fdisk /dev/mmcblk0
  • Unmount both micro SD card partitions:
root@compulab:~# umount /dev/mmcblk0p*
  • Format the first (FAT) partition:
root@compulab:~# mkfs.vfat -F 32 -n boot /dev/mmcblk0p1
  • Format the second (Linux) partition:
root@compulab:~# mkfs.ext4 -L rootfs /dev/mmcblk0p2
  • Use the following mount command to mount micro SD card partitions /media/mmcblk0pX, where X is the partition number:
root@compulab:~# mkdir -p /media/mmcblk0pX && mount /dev/mmcblk0pX /media/mmcblk0pX
  • Copy the uImage-cm-t335 to the first partition:
root@compulab:~# cp /mount/point/uImage-cm-t335 /media/mmcblk0p1/
  • Extract the content of Android-image-cm-t335.tar.bz2 onto the second partition:
root@compulab:~# tar --numeric-owner -xpf /mount/point/Android-image-cm-t335.tar.bz2 -C /media/mmcblk0p2 && sync

Install Images on the micro SD Card using Linux Host workstation

Installation of Kernel and Android images on micro SD card can be also performed using Linux Host workstation.

  • Obtain a Linux PC workstation.
  • Get a USB Card reader and a micro SD Card. Use either the micro SD card, supplied with the CM-T335 Evaluation kit, or create a new one.
  • Plug the USB SD Card reader to a 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 /dev/sdc.
  • Depending on the desktop system setup, following steps might require super user privileges.
  • Create two partitions (FAT32 partition for Linux kernel and ext4 partition for root filesystem) as described in the Default MMC/SD Card mapping article:
Disk /dev/sdc: 8035 MB, 8035237888 bytes
32 heads, 32 sectors/track, 15326 cylinders, total 15693824 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x710ab397

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1   *        2048      242959      120456    c  W95 FAT32 (LBA)
/dev/sdc2          243712    15693823     7725056   83  Linux
  • Format FAT32 partition:
sudo mkfs.vfat -F 32 -n boot /dev/sdc1
  • Format ext4 partition:
sudo mkfs.ext4 -L rootfs /dev/sdc2
  • Mount the FAT32 partition under /media/boot location:
sudo mkdir -p /media/boot
sudo mount /dev/sdc1 /media/boot
  • Mount the partition under /media/boot location:
sudo mkdir -p /media/rootfs
sudo mount /dev/sdc2 /media/rootfs
  • Copy Linux kernel image on to the boot partition:
cp /path/to/cm-t335-android/images/uImage-cm-t335 /media/boot/
  • Extract the Android Demo root filesystem on to that partition:
sudo tar --numeric-owner -xpf /path/to/cm-t335-android/images/Android-image-cm-t335.tar.bz2 -C /media/rootfs && sync
  • Unmount all micro SD card partitions:
sudo umount /dev/sdc1; sudo umount /dev/sdc2
  • Remove the micro SD card from the SD card reader and insert into the CM-T335 micro SD card socket (P23).
  • Continue to the After Installation section.

After Installation

Turn on the CM-T335 evaluation system. Hit any key to prevent autoboot and get into the U-Boot command prompt.

Select video out

Default CM-T335 video output device is DVI. Other video output devices can be used as well.

  • To enable LCD video output:
CM-T335 # setenv disp_type lcd
  • To enable LVDS video output:
CM-T335 # setenv disp_type lvds

Boot from the NAND flash

  • Set the bootargs environment variable:
CM-T335 # setenv bootargs "console=ttyO0,115200n8 androidboot.console=ttyO0 root=ubi0:rootfs rootfstype=ubifs ubi.mtd=rootfs,2048 rw rootwait init=/init ip=off cm_t335_disp=${disp_type}"
  • To boot Android Demo image type:
CM-T335 # setenv bootdelay 3
CM-T335 # setenv bootcmd "nboot 82000000 nand0 900000; bootm"
CM-T335 # saveenv
CM-T335 # boot

Boot from the micro SD card

  • Set the bootargs environment variable:
CM-T335 # setenv bootargs "console=ttyO0,115200n8 androidboot.console=ttyO0 root=/dev/mmcblk0p2 rw rootfstype=ext4 rootwait init=/init ip=off cm_t335_disp=${disp_type}"
  • To boot Android Demo image type:
CM-T335 # setenv bootdelay 3
CM-T335 # setenv bootcmd "mmc rescan; load mmc 0:1 82000000 uImage-cm-t335; bootm"
CM-T335 # saveenv
CM-T335 # boot

See also