35
BYOT with Android w/ Capacitive Touch Screen under US$200

Build Your Own Android Tablet

Embed Size (px)

DESCRIPTION

Presentation at October SG Android Developer Meetup by Jeff Pang. Jeff Pang shows us how you can build your own Android Tablet using BeagleBone and a capacitive touch screen. BeagleBone is an $89 MSRP, credit-card-sized Linux computer that connects to the Internet and runs software such as Android 4.0 and Ubuntu. With plenty of I/O and processing power for real-time analysis provided by an AM335x 720MHz ARM® processor, BeagleBone can be complemented with cape plug-in boards to augment functionality.

Citation preview

Page 1: Build Your Own Android Tablet

BYOT with Android

w/ Capacitive Touch Screen under

US$200

Page 2: Build Your Own Android Tablet

Overview

The simple way to BYOT

The harder way

Page 3: Build Your Own Android Tablet

Introduction

Beaglebone Black (Texas Instrument)

Load it with Android

Install Chipsee Capacitive Touch Cape

Page 4: Build Your Own Android Tablet

Difficulty Levels

Different ways to do it, at varying difficulty levels:

1. Level: Easy

2. Level: Hard (Offers more features)

3. Level: Ninja!!! (Do crazy stuff)

Page 5: Build Your Own Android Tablet

The easy way

Make bootable SD (min 2GB)

Mount Chipsee Touch Screen Cape

Boot up

Page 6: Build Your Own Android Tablet

Specs

1. Android Jelly Bean 4.1.2

2. Linux 3.2

3. ADB

4. SGX Graphics Accelerator

Page 7: Build Your Own Android Tablet

Android

Linux Kernel

Bootloader

Page 8: Build Your Own Android Tablet

Components

1. Bootloader

• U-boot.img

• MLO

2. Kernel

• uImage

3. Android Filesystem

• Rootfs

Page 9: Build Your Own Android Tablet

Making bootable SD

Make sure rootfs the correct archive type depending on mkmmc-android.sh

Tip: bunzip2 -c < file.tar.bz2 | gzip -c > file.tar.gz

Check SD card’s mount

Run script

$ sudo ./mkmmc-android.sh /dev/sdX

Page 10: Build Your Own Android Tablet
Page 11: Build Your Own Android Tablet

If you are not asleep yet

Here we goooo .

Page 12: Build Your Own Android Tablet

The hard way

Compiling from source

Choose Android version (Rowboat? TI? Chipsee?)

Choose Kernel version (3.2, 3.8 , 3.12)

Choose boot-loader (u-boot, fastboot)

Choose download method

From Gitorious

From Pre-packaged source from TI

From Pre-packaged source from Chipsee

Page 13: Build Your Own Android Tablet

Preparation

1. Install JDK 6

• Some complications here

2. Install packages (apt-get)

3. Install Repo (if getting from Git)

Page 14: Build Your Own Android Tablet

Toolbox (Optional)

FTDI (Chip) Cable, used for Console Output in debugging

(USB to TTL) 3.3v or 5v

USB to RS232 to USB Cable

Page 15: Build Your Own Android Tablet

Build Host Requirements

Simple? Not quite…

1. x64 Ubuntu 10.x or above (12.04 recc)

2. 100GB disk space and 4GB RAM

3. Virtual Machine (Optional)

4. Lots of time and patience

Page 16: Build Your Own Android Tablet

Tools (Optional)

FDTI (Chip) Cable for console output/debugging

USB to TTL (3.3v or 5v)

USB to RS232

Page 17: Build Your Own Android Tablet

Steps

Prep Host

Download sources

Customise (Optional)

Build (make commands)

u-bootKernelAndroid (Do this last, trust me …)

Copy Chipsee Additions

Make SD Card

Page 18: Build Your Own Android Tablet

Install Packages

$ sudo apt-get install git-core gnupg flex bison gperf build-essential \zip curl libc6-dev libncurses5-dev:i386 x11proto-core-dev \ libx11-dev:i386 libreadline6-dev:i386 libgl1-mesa-dri:i386 libgl1-mesa-glx:i386 \ libgl1-mesa-dev g++-multilib mingw32 openjdk-6-jdk tofrodos \ python-markdown libxml2-utils xsltproc zlib1g-dev:i386 \ minicom tftpd uboot-mkimage expect

$ sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/lib/i386-linux-

gnu/libGL.so

Page 19: Build Your Own Android Tablet

Install JDK 6

Register and login at Oracle

http://www.oracle.com/technetwork/java/javasebusiness/downloads/java-archive-downloads-javase6-419409.html

Download and unpack jdk-6u45-linux-x64.bin from Oracle

$ chmod a+x jdk6u45-linux-x64.bin

$ cd .\jdk6u45-linux-x64.bin

Page 20: Build Your Own Android Tablet

Install JDK 6 (cont.)

Install java update tool from Google

$ sudo mkdir /usr/lib/jvm

$ sudo mv jdk.1.6.0.45

$ sudo wget http://webupd8.googlecode.com/files/update-java-0.5b

$ sudo chmod +x update-java-0.5b

$ sudo ./update-java-0.5b

Page 21: Build Your Own Android Tablet

Install JDK (cont.)

If you want to get source from Rowboat, install Repo

$ mkdir bin

$ PATH=~/bin:$PATH

$ sudo bash -c "curl http://commondatastorage.googleapis.com/git-$

repo-downloads/repo > ~/bin/repo

$ sudo chmod a+x ~/bin/repo

Page 22: Build Your Own Android Tablet

Setup toolchain

Set Path

$ export PATH=<android-src>/prebuilts/gcc/linux-x86/arm/arm-eabi-

4.6/bin:$PATH

Page 23: Build Your Own Android Tablet

U-Boot

Download Source or use pre-packed

*patch if using Kernel 3.8 or higher

$ wget

https://raw.github.com/eewiki/u-boot-patches/master/v2013.04/0001-

am335x_evm-uEnv.txt-bootz-n-fixes.patch

$ patch -p1 < 0001-am335x_evm-uEnv.txt-bootz-n-fixes.patch

Page 24: Build Your Own Android Tablet

U-boot

Build

$ make CROSS_COMPILE=arm-eabi- distclean

$ make CROSS_COMPILE=arm-eabi- am335x_evm_config

$ make CROSS_COMPILE=arm-eabi- -j<N><N> is the number of cores x 2 for faster compilation

Page 25: Build Your Own Android Tablet

Kernel Options

Kernel 3.2 (Maintained by TI)

No Device Tree Support

Git or pre-packaged source

Kernel 3.8 and above (Linux mainlining project)

No SGX Support

3.12 recently added

Page 26: Build Your Own Android Tablet

*Kernel 3.8 and 3.12

Checkout the source (3.8 and 3.12)

$ git clone git://github.com/RobertCNelson/linux-dev.git$ cd linux-dev$ git checkout origin/am33x-v3.8 -b tmp$ ./build_kernel.sh

Page 27: Build Your Own Android Tablet

Kernel 3.2

Found in source from TI (or Chipsee’s)

$ cd linux

$ make CROSS_COMPILE=arm-eabi- distclean

$ make CROSS_COMPILE=arm-eabi- am335x_evm_android_defconfig

$ make CROSS_COMPILE=arm-eabi- uImage -j<N><N> is the number of cores x 2 for faster compilation

Page 28: Build Your Own Android Tablet

Build Android Filesystem

Build Android

$ cd ~/<android-src>

make TARGET_PRODUCT=am335xevm_sk OMAPES=4.x

Wait…

Wait…

Wait…

ZZzzz …

Page 29: Build Your Own Android Tablet

Create Boot Script

Create a file uEnv.txt with contents

bootargs=console=ttyO0,115200n8 androidboot.console=ttyO0 mem=256M root=/dev/mmcblk0p2 rw rootfstype=ext4 rootwait init=/init ip=off bootcmd=mmc rescan ; fatload mmc 0 81000000 uImage ; bootm 81000000 uenvcmd=boot

Page 30: Build Your Own Android Tablet

Make bootable SD

Copy files to tmp location and make Tarball$ cd ~/<android-src>

$ make TARGET_PRODUCT=am335xevm_sk fs_tarball

$ cp <uEnv-location>/uEnv.txt image/boot

$ cp kernel/arch/arm/boot/uImage image/boot

$ cp u-boot/u-boot.img image/boot

$ cp u-boot/MLO image/boot

$ cp out/target/product/a,335xevm_sk/rootfs.tar.bz2 image

Follow the instructions described previously to make bootable SD

Page 31: Build Your Own Android Tablet

*WiFi

1. WiFi (RTL8188CUS Chipset)

1. More downloads and builds

2. SoftAP/WiFi hotspot and WiFi Direct

3. Default Linux Wl2xx chipset drivers

Page 32: Build Your Own Android Tablet

It’s a wrap!

For cheap prototypes…

Custom build for enterprise/industrial applications

Frustrated with Emulators and VMs?

Peeking under the pants hood of Android

Page 33: Build Your Own Android Tablet

More Information

TI Website

Rowboat Project

Robert C Nelson

My (almost defunct) Website www.colormecode.com

Page 34: Build Your Own Android Tablet

Where to buy

RS Components (Singapore)

http://singapore.rs-online.com/web/

Beaglebone Black

USB-TTL (Optional)

USB to RS232 (Optional but recommended)

Chipsee Capacitive

http://www.chipsee.com/

Ships to Singapore for about SG$40

Page 35: Build Your Own Android Tablet

Where to download

Android

https://gitorious.org/rowboat

http://www.ti.com/lsds/ti/tools-software/android.page

Chipsee CD

Kernel 3.8 and 3.12

https://github.com/RobertCNelson/linux-dev

Chipsee CD

U-Boot

git://git.denx.de/u-boot.git

Chipsee CD