Professional Documents
Culture Documents
c
.
l
e
w
w
w
n
r
e
k
rd
a
.h
: ,
, ,
, ,
, ,
, ,
, ,
,
m
o
c
.
l
e
Samsung S5P6450
S5P6450 ODROIDODROID-E PCB
n
r
e
k
rd
Samsung S5P6450
S5P6450 ODROIDODROID-E
Samsung S5P6450
S5P6450 ODROIDODROID-E WinCE 6.0
Android Camera Porting
a
.h
w
w
w
m
o
c
.
l
e
w
w
w
n
r
e
k
rd
a
.h
c
.
l
e
m
o
?
?
n
r
e
k
rd
(RAM / FLASH)
w
w
w
a
.h
Application Processor
S5P6450
?
?
m
o
(WinCE,
(WinCE, Linux, Qt, QNX)
c
.
l
e
Connectivity
3G/WiFi/Bluetooth/NFC/USB/MicroSD/Camera/OpenCV
n
r
e
k
rd
User Interface / MM
OpengGL/SurfaceFligner/Stagefright
(SDK)
w
w
w
JAVA
a
.h
/
Application Processor
Cortex-A9 Dual core
Exynos-4210/4220
Cortex-A8
Tegra-2
EMMA Mobile
w
w
w
i.MX53/51
Sitara AM35/7/8
OMAP-4
i.MX6
c
.
l
e
n
r
e
k
rd
MSM8960 (S4)
Spear 13xx
m
o
Exynos-3110 (S5PC110)/C100
a
.h
Telechips/CoreLogic/ARMLogic
/WonderMedia(VIA)
ARM11 / ARM9 ( , 3D !)
S5P6450
m
o
? ?
c
.
l
e
n
r
e
k
rd
(RAM/FLASH)
a
.h
w
w
w
NFC
ZigBee
3G / LTE
GPS
(RAM / FLASH)
RAM
m
o
c
.
l
e
n
r
e
k
rd
DDR2 512Mbit (x16) / $1, DDR2 1Gbit (x16) / $1.5, DDR3 1Gbit (x16) / $1.3
mDDR 512Mbit (x16) / $2, mDDR 1Gbit (x16) / $3, mDDR 2Gbit (x32) / $5
FLASH
a
.h
NOR : OS/App
w
w
w
NAND
NAND () AP
iNAND/MoviNAND (//DDR-100Mhz-8bit[eMMC4.5])
//
S5P6450
24xx ,
, TI Sitara AM1xxx ,
, Freescale i.MX2x
- PND e-book
m
o
c
.
l
e
n
r
e
k
rd
- POS / / PDA / /
Migration
Samsung S5P6450
a
.h
2~3
2~3
3D / UI
w
w
w
800Mhz
S5P6450
Specification
-
w
w
w
m
o
c
.
l
e
a
.h
n
r
e
k
rd
m
o
c
.
l
e
w
w
w
n
r
e
k
rd
a
.h
Hardware Structure
c
.
l
e
m
o
n
r
e
k
rd
Knee Frequency
Calculation of Decap
a
.h
w
w
w
I2C
3M CAMERA
n
r
e
k
rd
24bpp RGB
4 LCD
Cam I/F
I2C
WIFI /BT
Ant
BCM4329
w
w
w
Boot
T-FLSH
PMIC
DC
JACK
a
.h
SDIO
RN5T614
1500mAH@ 3.7V
Battery
UART
BMA150
S5P6450
SD/MMC
I2C
I2C
I2S
MAX17040
m
o
c
.
l
e
Touch
Motor
Driver
MAX98095
Codec
TTA20
LRA
MIC
HP
SPK
m
o
c
.
l
e
a
.h
n
r
e
k
rd
w
w
w
n
r
c e
v = k
Er
d
r
a
.h
w
w
w
m
o
c
.
l
e
m
o
c
.
l
e
n
r
e
k
rd
Return current density in reference plane falls off with the square of the
distance
w
w
w
a
.h
n
r
e
k
rd
a
.h
w
w
w
m
o
c
.
l
e
m
o
c
.
l
e
n
r
e
k
rd
w
w
w
a
.h
m
o
Case 3.) The (2) trace layers reference different planes each at a different DC potential.
The return current encounters the plane capacitance impedance thereby inducing a
voltage drop across this impedance. This impedance drops over time as the current
spreads out and traverses a larger capacitive area.
This return path impedance (Z) can be estimated as:
Z ~ 5 ohm x [plane separation (inches) / time (nsec)]
Simple stack-up shown not suitable for commuting very fast edge rate signaling (<<1
nsec). Deploy thin core PWR//GND construction to minimize the impedance and
correspondingly the voltage drop.
c
.
l
e
w
w
w
a
.h
n
r
e
k
rd
m
o
Basic facts and tools for the analysis of the edge of a clock
c
.
l
e
Rise time (Tr) = time to rise from 10% to 90% of the signal.
90%
10%
w
w
w
n
r
e
k
rd
a
.h
Tr
A slow
rising edge
Knee frequency
Fknee =
0.35
Tr
or
Tr
m
o
c
.
l
e
0.5
n
r
e
k
rd
Fknee
a
.h
0.5
=
= 100MHz
5ns
w
w
w
Period/2=Tr
Reflection
Reflection ?
?
m
o
c
.
l
e
Device
Device Device
Device
Device Device
Device
.
.
n
r
e
k
rd
Reflection
w
w
w
Tr
Tf
a
.h
Overshoot
V
Undershoot
Tr
Tf
CROSSTALK
m
o
c
.
l
e
(Capacitance Coupling)
n
r
e
k
rd
Inductance, Lm
Mutual Inductance,
Mutual Capacitance,
Capacitance, Cm
Zo
w
w
w
a
.h
Cm
Zo
Zo
far
far
Lm
near
Zs
Zo
Zo
near
Zs
Zo
CROSSTALK PCB
m
o
c
.
l
e
Driver Aggressor
n
r
e
k
rd
Buffer
Shielding
90
a
.h
w
w
w
Rising Time
Ground Plane Signal Layer
Q I dt
=
c=
dv
dv
m
o
c
.
l
e
n
r
e
k
rd
w
w
w
a
.h
Decoupling Capacitors
Low ESR and ESL capacitor Recommend
Sizing Decap
m
o
c
.
l
e
n
r
e
k
rd
a
.h
ESL(pH)
400
w
w
w
1005
550
1608
700
2012
800
3216
1250
m
o
c
.
l
e
w
w
w
NPO
1pF
CODE: 1R0
10pF
100
n
r
e
k
rd
a
.h
X7R
X5R
100pF
101
1nF
102
Y5V
10nF
103
100nF
1uF
10uF
104
105
106
100uF
107
m
o
c
.
l
e
w
w
w
a
.h
n
r
e
k
rd
m
o
c
.
l
e
n
r
e
k
rd
w
w
w
a
.h
R
L
G
Characteristic Impedance
( R + j L )
Z0 =
(G + jC )
m
o
c
.
l
e
n
r
e
k
rd
a
.h
w
w
w
L
Z0 =
C
Topology
n
r
e
k
rd
a
.h
Impedance Control
w
w
w
m
o
c
.
l
e
Impedance Determined By
n
r
e
k
rd
Memory Port 1
mDDR(LPDDR)
m
o
c
.
l
e
a
.h
w
w
w
Stripline Microstrip
Stripline
Copper Trace
w
w
w
a
.h
Copper Plane
c
.
l
e
n
r
e
k
rd
m
o
Signal (microstrip
(microstrip)
microstrip)
Ground/Power
Signal (stripline
(stripline)
stripline)
Signal (stripline
(stripline)
stripline)
Ground/Power
Signal (microstrip
(microstrip)
microstrip)
Micro Strip
Parallel Plate Assumptions +
Large ground plane with zero
thickness
To accurately predict micro-strip
impedance, you must calculate the
effective dielectric constant.
w
w
w
e =
F =
r + 1
2
r 1
2 1+
+ F 0.217(r 1)
WC
0 . 02 ( r 1 ) 1
T
D
TC
Valid when:
0.1 < WC/TD < 2.0 and 1 < er < 15
a
.h
12TD
WC
m
o
c
.
l
e
rn
e
k
rd
5.98TD
ln
r + 1.41 0.8WC + TC
87
Z0
WC
2
for
WC
<1
TD
for
WC
>1
TD
TC
WCTD
TD
Stripline
m
o
c
.
l
e
rn
WC
e
k
rd
4(TD1 + TD1)
Z 0 sym
ln
r 0.67 (0.8WC + TC )
60
w
w
w
a
.h
TD1
TC
TD2
S5P6450 PCB
PCB (Layer Stack)
w
w
w
a
.h
n
r
e
k
rd
c
.
l
e
m
o
PCB
3W rule
n
r
e
k
rd
20H rule
m
o
c
.
l
e
a
.h
Return Path .
w
w
w
90
GND Plane .
Line Via
Via
Line
Antenna
m
o
c
.
l
e
GND
n
r
e
k
rd
Monopole GND
plastic
a
.h
Low-Q ,
PCB track ,
w
w
w
/4 Board
LPDDR DDR
VDD VDDQ
n
r
e
k
rd
Command
Input/output
2.5V -> 1.8V
a
.h
m
o
c
.
l
e
Initialization
Clocking(CAS latency)
w
w
w
m
o
c
.
l
e
w
w
w
n
r
e
k
rd
a
.h
n
r
e
k
rd
Memory Clock
Clock Positive edge
Memory Clock
50 ohm
Clock
w
w
w
a
.h
Differential Signals
80 ohm
m
o
c
.
l
e
Address/Command/Control Signals
VOH(MIN)
n
r
e
k
rd
1.150V
1.025V
a
.h
0.9V
w
w
w
Transmitter
0.775V
VOL (MAX)
VSSQ
VIH AC
VIH DC
VI L DC
VIL AC
0.650V
Receiver
m
o
c
.
l
e
c
.
l
e
m
o
w
w
w
a
.h
n
r
e
k
rd
6 Layers
S5P6450 - 0.65mm Pitch BGA PAD
NSMD PAD : 0.25mm / 0.26mm
(LAND/ Solder MASK)
Dog-bones Fan out
MLB(Multi Layer Board)
w
w
w
n
r
e
k
rd
a
.h
m
o
c
.
l
e
VIA
n
r
e
k
rd
BVH 0.5/0.1mm
(Clearance)
0.1mm / 0.075mm
PCB
1mm
Buildup 12 Layers
SP5C100 - 0.5mm Pitch BGA PAD 521 pin
NSMD PAD : 0.25mm / 0.3mm
w
w
w
a
.h
m
o
c
.
l
e
VIA
w
w
w
n
r
e
k
rd
a
.h
m
o
c
.
l
e
VIA
m
o
VIA
w
w
w
a
.h
n
r
e
k
rd
c
.
l
e
PMICPMIC-1(Ricoh RN5T614E)
High Efficiency Step-down DC/DC Converters
1.
c
.
l
e
Core)
2.
m
o
DC/DC1: 1.20V (0.9V to 1.5V/12.5mV steps) @1200mA with RAMP control (For
n
r
e
k
rd
DC/DC2: 1.15V (0.9V to 1.5V/12.5mV steps and 1.8V) @1000mA with RAMP
control (For Logic)
3.
4.
a
.h
w
w
w
PMICPMIC-2(Ricoh RN5T614E)
m
o
c
.
l
e
w
w
w
1. Package
a
.h
n
r
e
k
rd
m
o
c
.
l
e
w
w
w
n
r
e
k
rd
a
.h
m
o
c
.
l
e
(Uboot 1.3.4)
n
r
e
k
rd
(2.3.35.7)
a
.h
(Gingerbread 2.3.5)
w
w
w
U-Boot
ODROIDODROID-E Hardware
XOSCSEL
Frequency select
n
r
e
k
rd
0
1
XFXTSEL
XOSCSEL
UART2
S5P6450
DRAM
Controller
w
w
w
SD/MMC
Controller
iROM(BL0)
(64KB)
OM[3:0] = iROM
Boot
XFXTSEL
a
.h
NAND Controller
GPN[15:13] :
Booting
Device selection
DEBUG
Serial
Port
12 Mhz
19.2 Mhz
OM[3:0
]
GPN[15:13
]
Booting Mode
Boot Device
DDR
256MB
Boot
Device
m
o
c
.
l
e
0_111
000
001
010
011
iROM
Reserved
100
Reserved
101
110
111
DEBUG Port
Memory
UART2
DDR (256MB)
n
r
e
k
rd
/include
/board
/configs
/samsung
smdk6450.h
System clock
Debug Port
Default
w
w
w
/cpu
/s5p645x
/smdk6450
fastboot.c
lowlevel_init.s
usbdusbd-otgotg-hs.c
a
.h
A/M PLL
m
o
c
.
l
e
/uboot
/s5p6450
cpu_init.s
DMC
DMC Memory control
DMC Timing control
/common
cmd_mmc_disk.c
Fastboot partition
SYSTEM (256MB)
DATA (512MB)
CACHE (256MB)
U-Boot Build
make clean
make smdk6450_config
make j10
w
w
w
u-boot.bin
n
r
e
k
rd
a
.h
m
o
c
.
l
e
object, config .
U-Boot Fusing - 1
m
o
c
.
l
e
JTAG
n
r
e
k
rd
Memory(DDR) .
Memory(DDR) Uboot.bin .
Uboot fusing.
w
w
w
a
.h
fastboot
Host-PC
U-Boot Fusing - 2
T-Flash Map
c
.
l
e
(include/movi.h)
14K bytes
ST.
Sector
Partition Name
CACHE (Ext4)
DATA (Ext4)
SYSTEM (Ext4)
Lowlevel
Partition
(10MB)
a
.h
13377
Reserved
9281
Ramdisk
1089
Kernel
w
w
w
Size
n
r
e
k
rd
m
o
UBOOT BL1
BL1
u-boot.bin
256MB
512MB
Checksum(4bytes)
BL1Checksum
Uboot/cpu/s5p645x/movi.c
256MB
2MB
4MB
65
BL2 (u-boot.bin)
512KB
33
UBOOT config
16KB
BL1 (u-boot_bl1.bin)
16KB
MBR
512B
movi_write(image[1].start_blk,image[1].used_blk,
src);
*(ulong*)addr = tmp;
}
U-Boot
c
.
l
e
m
o
w
w
w
a
.h
n
r
e
k
rd
U-Boot Debugging
Debug console
Check H/W
Main Clock .
Boot mode, Boot Device .
SD/MMC Port .
DRAM .
DRAM Bus .
Debug Message .
Main Clock .
w
w
w
c
.
l
e
n
r
e
k
rd
OK .
a
.h
m
o
Check S/W
Debug port .
BL1 checksum .
Memory Configuration .
A/M PLL .
Kernel Driver
ODROIDODROID-E Device
Keypad
(GPIO)
IIC
Vibrator
(AUDX1001)
IIC
w
w
w
Kernel Porting
SPI
HSHS-MMC/SD/SDIO
Touchscreen
(AIMS902)
Accelerometor
(BMA150)
n
r
e
k
rd
LCD I/F
GPIO
UART
S5P6450
a
.h
Device
Device Driver
Makefile Kconfig file
Platform device driver
IIC
CAM I/F
IIC
3M Camera
(S5K5CAGX)
m
o
c
.
l
e
LCD 480X800(WVGA)
(LMS397KF04)
WiFi / BT
(BCM4329)
IIC
Battery Monitor
(MAX17040)
IIC
Regulator
(RN5T614)
IIC
IIS
Sound Codec
(MAX98095)
/input
/touchscreen
/aim902.c
/aim902-i2c.c
/aim902-sysfs.c
/aim902update.c
/Kconfig
/Makefile
/video
n
r
e
k
rd
/samsung
/odroide_keypad.c
/Kconfig
/Makefile
w
w
w
/sound
/soc
/arch
/arm
/rn5t614.c
/Kconfig
/Makefile
/video
/s5k5cagx.
c
/Kconfig
/Makefile
/s3cfb_lms397kf04.c
/Kconfig
/Makefile
/keyboard
/regulator
/media
a
.h
/codec
/s3c24xx
/max98095.c
/max98095_mixer.
c
/Kconfig
/Makefile
/hkdk6450-max98095.c
/Kconfig
/Makefile
/mach-s5p6450
m
o
c
.
l
e
/drivers
/mach-hkdk6450.c
/Kconfig
/Makefile
/misc
/axxx1001.c
/Kconfig
/Makefile
/accelerometor
/yas_acc_kernel_driver.c
/yas_acc_driverbma150.c
/Kconfig
/Makefile
Kconfig , Makefile
Kconfig file
config TOUCHSCREEN_TPS6507X
tristate "TPS6507x based touchscreens"
depends on I2C
help
Say Y here if you have a TPS6507x based touchscreen controller.
If unsure, say N.
To compile this driver as a module, choose M here: the module will be called tps6507x_ts.
n
r
e
k
rd
config TOUCHSCREEN_AIM902
bool "ODROID-E4 AIM902 based touchscreens"
depends on I2C
---help--Say Y here if you have a touchscreen interface using the AIM902 controller, and your board-specific initialization
code includes that.
This enables support for ODROTD-E WVGA(480X800) Touch panel
w
w
w
Makefile
m
o
c
.
l
e
-- drivers/input/touchscreen/Kconfig --
a
.h
Platform device
m
o
-- /arch/arm/mach-s5p6450/mach-hkdk6450.c --
c
.
l
e
n
r
e
k
rd
w
w
w
a
.h
#if defined(CONFIG_TOUCHSCREEN_AIM902)
&hkdk6450_i2c5,
#endif
}
//----------------------------------------------------------------------------------------
Kernel Build - 1
make distclean
make smdk6450_android_defconfig
config file .
w
w
w
n
r
e
k
rd
a
.h
m
o
c
.
l
e
object, config .
Kernel Build - 2
make menuconfig
w
w
w
n
r
e
k
rd
a
.h
m
o
c
.
l
e
Kernel Build - 3
make j10
w
w
w
n
r
e
k
rd
a
.h
cp .config arch/arm/configs/odroid_e_defconfig
arch/arm/boot/zImage .
m
o
c
.
l
e
Kernel Fusing
Uboot fastboot
n
r
e
k
rd
T-Flash Reader
Host PC :
sudo dd iflag=dsync oflag=dsync if=./zImage of=/dev/sdb seek=1089
w
w
w
a
.h
m
o
c
.
l
e
Host PC :
sudo fastboot flash kernel zImage
Android
/device
/odroide4
/hardkernel
BoardConfig.mk
build_android.sh
device.mk
/product
w
w
w
/common
/sec
/conf
init.product.rc
init.rc
ueventd.product.rc
vold.fstab
e
k
rd
device_common.mk
a
.h
AndroidProduct.mk
odroide4.mk
/proprietary
m
o
c
.
l
e
rn
Android Device
/keychars
Android Porting
Device product
BoardConfig.mk
init.rc
device.mk
vold.fstab
WiFi / Bluetooth
Sensor / Carmera library
/libcameraE4
/libsensor
/bin
Touch Firmware
WiFi / BT Firmware
BoardConfig.mk - 1
c
.
l
e
m
o
w
w
w
a
.h
n
r
e
k
rd
BoardConfig.mk - 2
c
.
l
e
m
o
#-------------------------------------------------------------------------# Camera
#-------------------------------------------------------------------------USE_CAMERA_STUB := false
ifeq ($(USE_CAMERA_STUB),false)
BOARD_CAMERA_LIBRARIES := libhkcamera_odroide
endif
#-------------------------------------------------------------------------# Bluetooth config
#-------------------------------------------------------------------------BOARD_HAVE_BLUETOOTH := true
BOARD_HAVE_BLUETOOTH_BCM := true
#-------------------------------------------------------------------------# GPS
#-------------------------------------------------------------------------BOARD_HAVE_HARDWARE_GPS := false
#-------------------------------------------------------------------------# Chip H/W Config
#-------------------------------------------------------------------------BOARD_USES_OVERLAY := true
BOARD_USES_HW_DECODER := true
BOARD_USE_JPEG := false
w
w
w
a
.h
n
r
e
k
rd
init.rc - 1
w
w
w
m
o
c
.
l
e
write /dev/cpuctl/bg_non_interactive/cpu.shares 52
on fs
# mount mtd partitions
# Mount /system rw first to give the filesystem a chance to save a checkpoint
mount ext4 /dev/block/mmcblk0p2 /system
mount ext4 /dev/block/mmcblk0p3 /data wait nosuid nodev noatime
mount ext4 /dev/block/mmcblk0p4 /cache /cache nosuid nodevon post-fs
# once everything is setup, no need to modify /
mount rootfs rootfs / ro remount
on boot
a
.h
n
r
e
k
rd
init.rc - 2
#
# bluetooth interface
#
chown bluetooth bluetooth /dev/s3c2410_serial0
chmod 0666
/dev/s3c2410_serial0
#
# bluetooth Mac address
#
chown bluetooth bluetooth /system/etc/bluetooth
chmod 755 /system/etc/bluetooth
a
.h
n
r
e
k
rd
w
w
w
c
.
l
e
m
o
init.rc - 3
m
o
c
.
l
e
class_start default
n
r
e
k
rd
#===================================================================
# baudrate change 115200 to 921600(Bluetooth)
#===================================================================
service hciattach /system/bin/hciattach -n -f /system/etc/firmware/bcm4329.hcd /dev/s3c2410_serial0 bcmbt 921600
flow
user bluetooth
group bluetooth net_bt_admin misc
disabled
w
w
w
a
.h
device.mk - 1
include $(LOCAL_PATH)/BoardConfig.mk
m
o
c
.
l
e
n
r
e
k
rd
a
.h
w
w
w
device.mk - 2
m
o
c
.
l
e
n
r
e
k
rd
w
w
w
a
.h
vold.fstab lib
vold.fstab
#######################
## Regular device mount
##
## Format: dev_mount <label> <mount_point> <part> <sysfs_path1...>
## label
- Label for the volume
## mount_point - Where the volume will be mounted
## part
- Partition # (1 based), or 'auto' for first usable partition.
## <sysfs_path> - List of sysfs paths to source devices
######################
n
r
e
k
rd
c
.
l
e
WiFi / Bluetooth
w
w
w
a
.h
hardware/libhardware_legacy/wifi/wifi.c
system/bluetooth/bluedroid/bluetooth.c
device/hardkernel/proprietary/libsensor/
device/hardkernel/proprietary/libcameraE4/
m
o
Android Build
m
o
make clean
c
.
l
e
object .
w
w
w
a
.h
n
r
e
k
rd
Android Fusing
Android system file
n
r
e
k
rd
m
o
c
.
l
e
a
.h
Android ramdisk-uboot.img
w
w
w
Android Booting
c
.
l
e
m
o
w
w
w
n
r
e
k
rd
a
.h
Q&A
www.hardkernel.com .
m
o
c
.
l
e
w
w
w
n
r
e
k
rd
a
.h
n
r
e
k
rd
m
o
c
.
l
e
w
w
w
a
.h
m
o
c
.
l
e
a
.h
BSP(SMDK6450_BSP)
BSP Copy
%WINCEROOT%\PLATFORM\SMDK6450
%WINCEROOT%\PLATFORM\COMMON
w
w
w
n
r
e
k
rd
ODROIDODROID-E OS Design -1
w
w
w
a
.h
n
r
e
k
rd
c
.
l
e
m
o
ODROIDODROID-E OS Design -2
m
o
c
.
l
e
w
w
w
a
.h
n
r
e
k
rd
ODROIDODROID-E OS Design -3
m
o
c
.
l
e
w
w
w
a
.h
n
r
e
k
rd
ODROIDODROID-E OS Design -4
m
o
c
.
l
e
w
w
w
a
.h
n
r
e
k
rd
ODROIDODROID-E OS Design -5
m
o
c
.
l
e
w
w
w
a
.h
n
r
e
k
rd
ODROIDODROID-E OS Design -6
m
o
c
.
l
e
w
w
w
a
.h
n
r
e
k
rd
Public Component -1
m
o
c
.
l
e
w
w
w
a
.h
n
r
e
k
rd
Public Component -2
m
o
c
.
l
e
w
w
w
a
.h
n
r
e
k
rd
Public Component -3
m
o
c
.
l
e
w
w
w
a
.h
n
r
e
k
rd
Public Component -4
m
o
c
.
l
e
w
w
w
a
.h
n
r
e
k
rd
c
.
l
e
m
o
w
w
w
a
.h
n
r
e
k
rd
c
.
l
e
m
o
w
w
w
a
.h
n
r
e
k
rd
Build Solution
w
w
w
a
.h
n
r
e
k
rd
c
.
l
e
m
o
ODROIDODROID-E H/W
ODROIDODROID-E Hardware
XOSCSEL
Frequency select
n
r
e
k
rd
0
1
XFXTSEL
XOSCSEL
UART2
S5P6450
DRAM
Controller
w
w
w
SD/MMC
Controller
iROM(BL0)
(64KB)
OM[3:0] = iROM
Boot
XFXTSEL
a
.h
NAND Controller
GPN[15:13] :
Booting
Device selection
DEBUG
Serial
Port
12 Mhz
19.2 Mhz
OM[3:0
]
GPN[15:13
]
Booting Mode
Boot Device
DDR
256MB
Boot
Device
m
o
c
.
l
e
0_111
000
001
010
011
iROM
Reserved
100
Reserved
101
110
111
DEBUG Port
Memory
UART2
DDR (256MB)
m
o
WINCE600\
WINCE600\PLATFORM\
PLATFORM\
COMMON\
c
.
l
e
rn
SMDK6450\
SRC\
SRC\SOC\
Architecture
SOC HW
w
w
w
OAL
CATALOG\
S5P6450_SEC_V1
OAL\
e
k
rd
FILES\
a
.h
BOOTLOADER\
COMMON\
Booting Device
EBOOT
DRIVERS\
Public Driver
USB Driver
Download Tool
JTAG Script file
SDK\
ETC\
MPVD Driver
(Multi Purpose Video Decoder)
INC\
KITL\
KITL
\PLATFORM\COMMON\SRC\SOC\S5P6450_SEC_V1\OAL\INC\soc_cfg.h file
#define TARGET_CLK
CLK_800_166MHz
//#define TARGET_CLK
CLK_667_166MHz
//#define TARGET_CLK
CLK_533_133MHz
\PLATFORM\COMMON\SRC\SOC\S5P6450_SEC_V1\OAL\INC\S5P6450.inc file
TARGET_CLK
SETA CLK_800_166MHz
;TARGET_CLK
SETA CLK_667_166MHz
;TARGET_CLK
SETA CLK_533_133MHz
w
w
w
m
o
c
.
l
e
n
r
e
k
rd
a
.h
\PLATFORM\COMMON\SRC\SOC\S5P6450_SEC_V1\OAL\INC\soc_cfg.h file
#define DRAM_TYPE
LPDDR
//#define DRAM_TYPE
DDR2
\PLATFORM\COMMON\SRC\SOC\S5P6450_SEC_V1\OAL\INC\S5P6450.inc file
DRAM_TYPE
SETA LPDDR
;DRAM_TYPE
SETA DDR2
\PLATFORM\SMDK6450\SMDK6450.bat file
@REM set BSP_DEBUGPORT=SERIAL_UART0
@REM set BSP_DEBUGPORT=SERIAL_UART1
set BSP_DEBUGPORT=SERIAL_UART2
@REM set BSP_DEBUGPORT=SERIAL_UART3
n
r
e
k
rd
\PLATFORM\SMDK6450\SRC\Inc\bsp_cfg.h
#define DEBUG_UART3 (3)
#define DEBUG_BAUDRATE (115200)
w
w
w
a
.h
\PLATFORM\SMDK6450\SMDK6450.bat file
set BOOTLOADER_OPTION=SDBOOT
set
set
set
set
BSP_NONANDFS=1
BSP_NOHSMMC_CH0=1
BSP_NOHSMMC_CH1=
BSP_NOHSMMC_CH3=1
m
o
c
.
l
e
ODROIDODROID-E HW
\PLATFORM\SMDK6450\SMDK6450.bat file
set BSP_NOI2C=
set BSP_NOSPI=1
m
o
c
.
l
e
ODROID-E(S5P6450) HW
n
r
e
k
rd
@REM ----- CAMERAFILTER Device Driver Configuration ------------@REM CAMERA FILTER/I2C Device Driver
set BSP_NOCAMERA=1
a
.h
w
w
w
c
.
l
e
n
r
e
k
rd
LCD I/F
S5P6450
w
w
w
a
.h
Backlight Driver
LCD Controller Init
LCD I/F Timing
SPI
PWM_1
m
o
Backlight
HW Driver
LCD I/F
LCD 480X800(WVGA)
(LMS397KF04)
Backlight
\PLATFORM\SMDK6450\SRC\DRIVERS\BACKLIGHT\PDD\backlight_pdd.cpp file
PWM_1 Driver PWM_0
void BL_InitPWM() function
GPF14 pin_function PWM_0
- Timer0
n
r
e
k
rd
w
w
w
m
o
c
.
l
e
a
.h
n
r
e
k
rd
a
.h
\PLATFORM\SMDK6450\SRC\DRIVERS\DISPLAY\INC\ldi.h file
typedef enum
{
LDI_LTE480WV_RGB,
// 4.8" WVGA 800*480 in SMDK6450
LDI_LMS397KF04_RGB,
// 3.97" WVGA 480*800 in ODROIDE
LDI_HT101HD1_RGB,
// 1376*768 in SMDK6450
w
w
w
static
static
static
static
void LDI_LMS397KF04_RGB_port_initialize(void);
LDI_ERROR LDI_LMS397KF04_RGB_power_on(void);
LDI_ERROR LDI_LMS397KF04_RGB_power_off(void);
LDI_ERROR LDI_LMS397KF04_RGB_initialize(void);
m
o
c
.
l
e
\PLATFORM\SMDK6450\SRC\INC\bsp_cfg.h file
#define LCD_MODULE_LTP700
(8) // Landscape 7" WVGA RGB24
#define LCD_MODULE_LMS397KF04 (9) // Portrait 3.97" WVGA RGB24
//#define SMDK6450_LCD_MODULE (LCD_MODULE_LTE480)
#define SMDK6450_LCD_MODULE (LCD_MODULE_LMS397KF04)
n
r
e
k
rd
\PLATFORM\SMDK6450\SRC\DRIVERS\DISPLAY\DISPLAY_DRV\display_main.cpp file
PMIC LDO(VDD_LCD) Enable
#if (SMDK6450_LCD_MODULE == LCD_MODULE_LTE480)
LDI_set_LCD_module_type(LDI_LTE480WV_RGB);
#elif (SMDK6450_LCD_MODULE == LCD_MODULE_LMS397KF04)
LDI_set_LCD_module_type(LDI_LMS397KF04_RGB);
w
w
w
c
.
l
e
m
o
\PLATFORM\SMDK6450\SRC\DRIVERS\DISPLAY\DISPLAY_DRV\sources file
\PLATFORM\SMDK6450\SRC\DRIVERS\DISPLAY\DISPLAY_DRV\i2c_pmic.h file add
\PLATFORM\SMDK6450\SRC\DRIVERS\DISPLAY\DISPLAY_DRV\i2c_pmic.cpp file add
PMIC(RN5T614) LDO(VDD_LCD) I2C Interface add
a
.h
\PLATFORM\SMDK6450\SRC\DRIVERS\DISPLAY\LDI_LIB\LDI\ldi.c file
SPI interface function add (GPIO Bit-Bang)
LCD
- static void LDI_LMS397KF04_RGB_port_initialize(void);
- static LDI_ERROR LDI_LMS397KF04_RGB_power_on(void);
- static LDI_ERROR LDI_LMS397KF04_RGB_power_off(void);
- static LDI_ERROR LDI_LMS397KF04_RGB_initialize(void);
LCD Interface Timing
- case LDI_LTE480WV_RGB:
- case LDI_LMS397KF04_RGB
n
r
e
k
rd
\PLATFORM\SMDK6450\FILES\config.bib
#define NKSTART
80100000
#define NKLEN
01F00000 ; 31 MB
a
.h
CONFIG
ROMSTART = $(NKSTART)
ROMSIZE = $(NKLEN)
w
w
w
c
.
l
e
\PLATFORM\SMDK6450\SRC\INC\oemaddrtab_cfg.inc
g_oalAddressTable
DCD
0x80000000, 0x20000000, 128
; 128 MB DRAM
m
o
Target
w
w
w
m
o
c
.
l
e
Booting on Uboot
- dnw [Load address]
a
.h
n
r
e
k
rd
c
.
l
e
m
o
w
w
w
a
.h
n
r
e
k
rd
Target
go 20100000
- WinCE OS Image Booting
ST.
Sector
n
r
e
k
rd
Partition Name
Normal
Partition
DATA (Ext4)
a
.h
SYSTEM (Ext4)
Size
256MB
ODROID-E
WinCE OS Image
(Size 32MB)
512MB
256MB
79313
Reserved
13377
WinCE OS Image
9281
Ramdisk
2MB
1089
Kernel
4MB
65
BL2
512KB
33
UBOOT config
16KB
BL1
16KB
MBR
512B
w
w
w
Lowlevel
Partition
(10MB)
m
o
c
.
l
e
32MB
T-Flash raw-Image
Movi R/W command
Filesystem MBR
Bootcmd, ext_env
Multi-Boot
T-Flash raw-image
$uboot$/include/movi.h file
#define PART_SIZE_WINCE (32 * 1024 * 1024)
$uboot$/common/cmd_movi.c file
int init_raw_area_table (block_dev_desc_t * dev_desc)
- wince 32MB
int do_movi(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
- movi write wince command
- mmc raw area write command
n
r
e
k
rd
a
.h
m
o
c
.
l
e
$uboot$/common/cmd_mmc_fdisk.c
Filesystem block start address : 0 64MB
w
w
w
Bootcmd , EXT_ENV
$uboot$/include/configs/smdk6450.h
dnw_ce : dnw 20100000;movi write wince 20100000
Android_boot : movi read kernel 20008000;movi read rootfs 20A00000 200000;bootm
20008000
20A00000
wince_boot : movi read wince 20100000;go 20100000
wince_dl : dnw 20100000;go 20100000
w
w
w
n
r
e
k
rd
c
.
l
e
a
.h
m
o
Multi Boot
c
.
l
e
m
o
$uboot$/board/samsung/smdk6450/smdk6450.c file
/* --------------------------------------------------------- */
#define GPNCON (*(unsigned long *)(ELFIN_GPIO_BASE + GPNCON_OFFSET))
#define GPNDAT
(*(unsigned long *)(ELFIN_GPIO_BASE + GPNDAT_OFFSET))
#define GPNPUD
(*(unsigned long *)(ELFIN_GPIO_BASE + GPNPUD_OFFSET))
void check_bootmode(void)
{
char
run_cmd[100];
unsigned long data=0;
n
r
e
k
rd
a
.h
w
w
w
}
m
o
c
.
l
e
w
w
w
n
r
e
k
rd
a
.h
c
.
l
e
n
r
e
k
rd
framework
a
.h
m
o
APP Touch-to-focus
w
w
w
Camera Module
m
o
c
.
l
e
s5k5aafa
a
.h
1.3MPixel
1280x1024
Max 15 fpx @ SXGA
w
w
w
n
r
e
k
rd
s5k5cagx
s5k4eagx
3MPixel
5MPixel
2048x1536
2592x1944
Full @15fps,
Full @15fps
VGA @30fps
JPEG
JPEG
m
o
c
.
l
e
rn
Image
w
w
w
AF
Module
e
k
rd
a
.h
I2C
Image
Data
Mclk
c
.
l
e
m
o
w
w
w
* Parallel(CCIR)
Parallel(CCIR) 2 port
* MIPI 2 port
(2 Lane, 4 Lane)
a
.h
n
r
e
k
rd
m
o
c
.
l
e
w
w
w
a
.h
n
r
e
k
rd
Front
Rear
c
.
l
e
rn
CPU Module
Connector
w
w
w
e
k
rd
a
.h
m
o
3M Rear
Cam
1.3M Front
Cam
w
w
w
n
r
e
I2C
k
rd
Camera setup
a
.h
c
.
l
e
VIDIOC_G_CTRL s5k5cagx_g_ctr()
VIDIOC_S_CTRL s5k5cagx_s_ctr()
VIDIOC_S_FMT s5k5cagx_s_fmt()
VIDIOC_G_PARM s5k5cagx_g_parm()
VIDIOC_S_PARM s5k5cagx_s_parm()
...
m
o
V4L2 interface.
V4L2 device-subdev registration.
kernel/driver/media/video/v4l2*
Mclk, Camera Power On/Off
v4l2_subdev_call() s5k5cagx_init()
w
w
w
fimc_output.c
size,rotation, format
fimc_overlay.c
a
.h
fimc_capture.c
n
r
e
k
rd
fimc_v4l2.c
LCD
fimc_regs.c
m
o
c
.
l
e
fimc_dev.c
/dev/video0
FIMC
Fimc_Overlay
n
r
e
k
rd
open(/dev/video0)
V4L2
User App
or
Android
YUV422sp, Jpeg
w
w
w
a
.h
Fimc_Output
Scaler
Rotator
ColorSpace Conversion
YUV,RGB,JPEG,RAW
Fimc_Capture
V4L2
/dev/video0
m
o
c
.
l
e
RGB32
Cam
LCD
(dev/fb0)
w
w
w
m
o
c
.
l
e
a
.h
n
r
e
k
rd
clock source(clock.c)
Power On/Off
RESET, STBYn
arch/arm/mach-s5pv310/mach-hkdkc210.c
V4L2 Interface
fbcam.c, capture.c(http://v4l2spec.bytesex.org)
n
r
e
k
rd
open(/dev/video0)
VIDIOC_QUERYCAP
VIDIOC_S_FMT
a
.h
VIDIOC_REQBUFS
VIDIOC_QUERYBUF
w
w
w
ON
OFF
VIDIOC_QBUF
V4L2_CAP_VIDEO_CAPTURE
V4L2_CAP_VIDEO_OUTPUT
V4L2_CAP_VIDEO_OVERLAY
V4L2_CAP_STREAMING
VIDIOC_QBUF
VIDIOC_STREAMON
VIDIOC_DQBUF
VIDIOC_DQBUF
VIDIOC_STREAMOFF
close()
m
o
c
.
l
e
Exchange a
buffer with
the driver
m
o
android/frameworks/base/services/camera/libcameraservice
Reference codes
Emulator : FakeCamera.cpp
c
.
l
e
n
r
e
k
rd
a
.h
Porting
android/device/hardkernel/proprietary/libcamera
w
w
w
SecCameraHWInterface.cpp
SecCameraHWInterface.h
SecCamera.cpp
SecCamera.h
open(/dev/video0)
libcamera.so
m
o
c
.
l
e
rn
JNI
w
w
w
a
.h
e
k
rd
open()
close()
getCameraInfo()
setParameters()
TakePicture()
startPreview()
stopPreview()
...
Touch-to-focus?
m
o
n
r
e
k
rd
Focus X,Y
w
w
w
Touch event
JAVA Apps
c
.
l
e
a
.h
Libraries
CIS
Device Driver
Linux Kernel
Touch2Focus Parameters
m
o
android/frameworks/base/core/java/android/hardware/Camera.java
Class Camera.Parameters
public class Parameters {
// Parameter keys to communicate with the camera driver.
private static final String KEY_PREVIEW_SIZE = "preview-size";
private static final String KEY_PREVIEW_FORMAT = "preview-format";
private static final String KEY_PREVIEW_FRAME_RATE = "preview-frame-rate";
...
private static final String KEY_FOCUS_LOCATION = "focus-location";
}
n
r
e
k
rd
c
.
l
e
a
.h
android/frameworks/base/libs/camera/CameraParameters.cpp
namespace android {
// Parameter keys to communicate between camera application and driver.
const char CameraParameters::KEY_PREVIEW_SIZE[] = "preview-size";
const char CameraParameters::KEY_SUPPORTED_PREVIEW_SIZES[] = "preview-size-values";
const char CameraParameters::KEY_PREVIEW_FORMAT[] = "preview-format";
const char CameraParameters::KEY_PREVIEW_FRAME_RATE[] = "preview-frame-rate";
...
const char CameraParameters::KEY_FOCUS_LOCATION[] = "focus-location";
}
w
w
w
$ make update-api
m
o
android/packages/apps/Camera/
android/packages/apps/Camera/src/com/android/camera/Camera.java
src/com/android/camera/Camera.java
c
.
l
e
n
r
e
k
rd
100,200
a
.h
Camera.java
Parameters
SecCameraHWInterface.cpp
SecCamera.cpp
mParameters.setFocusLocation(touchX+","+ touchY);
mCameraDevice.setParameters(mParameters);
w
w
w
return true;
}
S5k5cagx.c
android/frameworks/base/core/java/android/hardware/Camera.java
public void setFocusLocation(String value) {
set(KEY_FOCUS_LOCATION, value);
}
Parameter
m
o
android/device/hardkernel/proprietary/libcamera/SecCameraHWInterface.cpp
c
.
l
e
n
r
e
k
rd
Camera.java
Parameters
a
.h
SecCameraHWInterface.cpp
SecCamera.cpp
android/device/hardkernel/proprietary/libcamera/SecCamera.cpp
int SecCamera::setFocusLocation(int lx, int ly){
int ret;
unsigned int val;
val = lx<<16 | ly;
w
w
w
V4L2 call
Device Driver
ret = fimc_v4l2_s_ctrl(m_cam_fd,
V4L2_CID_CAM_FOCUS_LOCATION, val);
fimc_v4l2_s_ctrl
return 0;
}
static int fimc_v4l2_s_ctrl (int fp, unsigned int id, unsigned int value)
{ ...
ctrl.value = value;
Kernel V4L2
ret = ioctl(fp, VIDIOC_S_CTRL, &ctrl);
m
o
kernel/media/video/v4l2-ioctl.c
c
.
l
e
static long __video_do_ioctl(struct file *file, unsigned int cmd, void *arg) {
...
case VIDIOC_S_CTRL:
if (ops->vidioc_s_ctrl) {
n
r
e
k
rd
kernel/media/video/samsung/fimc/fimc_v4l2.c
V4L2
static int fimc_s_ctrl(struct file *filp, void *fh, struct v4l2_control *c) {
if (ctrl->cap != NULL) {
a
.h
w
w
w
kernel/media/video/samsung/fimc/fimc_capture.c
if (FIMC2 != ctrl->id)
break;
}
return ret;
}
subdev_call()
subdev_call()
S5k5cagx.c
m
o
Kernel/drivers\media\video /S5k5cagx.c
c
.
l
e
w
w
w
a
.h
n
r
e
k
rd
Camera.java
SecCameraHWInterface.cpp
SecCamera.cpp
S5k5cagx.c
m
o
c
.
l
e
w
w
w
n
r
e
k
rd
a
.h
m
o
c
.
l
e
11.10(Beta 2)
- ()
- rootstock command
- fdisk &
- wifi
- booting
a
.h
n
r
e
k
rd
WWW Service
w
w
w
1. 11.10(Beta 2)
m
o
c
.
l
e
-
: uboot Kernel Ubuntu(Root File System)
n
r
e
k
rd
1) uboot : kernel
.
a
.h
w
w
w
-() :
()
.
m
o
2) kernel : , , OS .
(2.6.35.7) VFAT /boot .
3) ubuntu(rootfs) : Root File System(EXT4)
c
.
l
e
n
r
e
k
rd
a
.h
root
root
360
root
root
TIME
CMD
0 0
13:20
00:00:01
/sbin/init
0 0
13:20
00:00:00
[kthreadd]
1 0
13:20
00:00:00
udevd --daemon
586
360 0
13:20
00:00:00
udevd --daemon
791
2 0
13:20
00:00:00
[hd-audio0]
w
w
w
kernel
w
w
w
n
r
e
k
rd
a
.h
m
o
c
.
l
e
uboot
rootstock command
m
o
c
.
l
e
n
r
e
k
rd
a
.h
--fqdn
--fqdn : Target system Hostname(/etc/hostname) odroid
.
.
--imagesize
--imagesize : Target filesystem
w
w
w
--dist
--dist : apt(Advanced Package Tool) source release version.
--login
--login : Login ID
--password
--password :
--seed
--seed :
--components(The
--components(The repository components are) :
Main - Officially supported software.
license.
Universe - Community maintained software, i.e. not officially supported
software.
fdisk
- fdisk
w
w
w
n
r
e
k
rd
a
.h
m
o
c
.
l
e
: T-flash partition
w
w
w
a
.h
n
r
e
k
rd
c
.
l
e
m
o
Wifi - 1
- Network : wifi
m
o
c
.
l
e
n
r
e
k
rd
, .
kernel wifi on .
w
w
w
a
.h
[$KERNEL/arch/arm/mach-s5pv310/hkc1xx-sysfs.c]
Wifi - 2
m
o
c
.
l
e
n
r
e
k
rd
a
.h
w
w
w
Wifi - 3
auto lo
auto eth0
n
r
e
k
rd
m
o
c
.
l
e
a
.h
w
w
w
wpawpa-apap-scan 2
wpawpa-proto RSN
wpawpa-pairwise CCMP
wpawpa-group CCMP
wpawpa-keykey-mgmt WPAWPA-PSK
wpawpa-psk 81b2ae31a8dede0e05e446fbf6a243c71f865909c349bba1ecdca996e5e0417e
81b2ae31a8dede0e05e446fbf6a243c71f865909c349bba1ecdca996e5e0417e <--<--your WPA hex_key
Wifi - 4
: How to make a WPAWPA-PSK key.
network={
n
r
e
k
rd
Ssid="test
Ssid="test
="test
#psk="12345678
psk="12345678
="12345678
m
o
c
.
l
e
$ wpa_passphrase <your_essid><
your_essid><your_ascii_key
><your_ascii_key>
your_ascii_key>
psk=fe727aa8b64ac9b3f54c72432da14faed933ea511ecab1
5bbc6c52e7522f709a
9a
psk=fe727aa8b64ac9b3f54c72432da14faed933ea511ecab1 5bbc6c52e7522f70
<--- Copy this to wpawpa-psk !
w
w
w
a
.h
Booting - 1
- Booting
w
w
w
c
.
l
e
m
o
a
.h
n
r
e
k
rd
Booting - 2
w
w
w
m
o
c
.
l
e
- Booting
a
.h
n
r
e
k
rd
APM
2. WWW Service APM(Apache, Php, Mysql)
$ sudo aptapt-get update
m
o
c
.
l
e
n
r
e
k
rd
: .
.
- Apache
a
.h
- mysql mysql
w
w
w
- php5 mysql
$ sudo aptapt-get install php5php5-common php5 libapache2libapache2-modmod-
php5
WWW Service - 1
3. WWW Service
c
.
l
e
m
o
n
r
e
k
rd
w
w
w
?>
</font><p>
<?
a
.h
phpinfo(); ?>
</center>
WWW Service - 2
- WWW Service
w
w
w
a
.h
n
r
e
k
rd
c
.
l
e
m
o
m
o
c
.
l
e
w
w
w
n
r
e
k
rd
a
.h
: /
a
.h
n
r
e
k
rd
w
w
w
Framework
Gadget
Open Accessory Library
Thermal Printer Application
m
o
c
.
l
e
/
n
r
e
k
rd
( )
(USB 2.0 HS)
w
w
w
a
.h
m
o
c
.
l
e
( )
n
r
e
k
rd
w
w
w
a
.h
m
o
c
.
l
e
Atmel ATMEGA2560
m
o
c
.
l
e
n
r
e
k
rd
16-bit MCU core with built-in USB Host, 256KB Flash / 16KB RAM
($ ?)
Firmware source / Application source
I/O Bus Analog/I2C
w
w
w
a
.h
Microchip PIC24/PIC32
16bit/32bit, , ,
Firmware source / Application source
I/O
ODROIDODROID-ADK
Temperature Sensor
Pressure(Altitude)
Pressure(Altitude)
Sensor
I/O Ports
PWM
ADC
I2C
GPIO
w
w
w
c
.
l
e
Lithium Polymer
Battery Charger
n
r
e
k
rd
PIC24F
16Bit/Lower Power
MCU
+
Embedded
USB Host
a
.h
m
o
5Volt output
StepStep-up DC/DC
Converter
(For USB Host )
LiLi-Polymer
Rechargeable
Battery
ODROIDODROID-ADK
PIC24FJ64GB002
n
r
e
k
rd
/
USB ( BaB )
/
(I/O Kit )
w
w
w
a
.h
m
o
c
.
l
e
(?) /
ODROIDODROID-ADK
ADK Thermal printer Interface
m
o
c
.
l
e
n
r
e
k
rd
a
.h
USB/12Mbps
w
w
w
Sending Data
AndroidAppIsWriteComplete()
Check to see if the last write to the Android device was completed
AndroidAppWrite()
Sends data to the Android device specified by the passed in handle.
Receiving Data
AndroidAppIsReadComplete()
Check to see if the last read to the Android device was completed
AndroidAppRead()
Attempts to read information from the specified Android device
384 x 24 matrix
UART / 9600bps
ODROIDODROID-ADK
m
o
w
w
w
a
.h
Programmer (In
(In Circuit Emulator)
PICKIT3 (Program )
)
-US$ 45 ( 60,000)
-US$ 25 (Clone )
PICKIT2 (Program )
)
- US$ 35 /18
* Microchip
Microchip Development Tools Main Page
c
.
l
e
n
r
e
k
rd
Toolchain (Compiler)
1. MPLAB IDE (Windows)
-c30 gcc
2. MPLAB-X (Linux/Mac/Windows)
-ODROID-ADK/BaB import
-
- Android C30-coff.a Android C30-elf.a )
Lite /
ADB WiFi
USB
m
o
c
.
l
e
w
w
w
n
r
e
k
rd
a
.h
USB Basic
USB is an asymmetric protocol
Host
n
r
e
k
rd
c
.
l
e
w
w
w
Devices
a
.h
m
o
m
o
c
.
l
e
w
w
w
a
.h
n
r
e
k
rd
m
o
n
r
e
k
rd
c
.
l
e
w
w
w
a
.h
Android phone
device(Accessory) .
c
.
l
e
m
o
Odroid
w
w
w
n
r
e
k
rd
a
.h
ADK Board
PC(ADB or
Mass Storage)
Odroid
c
.
l
e
m
o
w
w
w
a
.h
n
r
e
k
rd
c
.
l
e
m
o
w
w
w
a
.h
n
r
e
k
rd
c
.
l
e
m
o
w
w
w
a
.h
n
r
e
k
rd
c
.
l
e
m
o
w
w
w
a
.h
n
r
e
k
rd
n
r
e
k
rd
a
.h
w
w
w
Request 52(Information)
Request 53(startup)
Establish communication
m
o
c
.
l
e
ADK Board
Device
Accessory mode
Check
vendor ID :
Google(0x18D1),
Product ID :
Accessory mode
(0x2D00)
n
r
e
k
rd
w
w
w
c
.
l
e
a
.h
m
o
Gadget
kernel/include/linux/usb/f_accessory.h
kernel/drivers/usb/gadget/f_accessory.c
n
r
e
k
rd
c
.
l
e
m
o
w
w
w
a
.h
Gadget
c
.
l
e
m
o
f_accessory.c
Communicate with usb accessory designed for android device
Define usb descriptor (interface, endpoint)
Process android accessory protocol if accessory function is
disabled
(Android device side)
GET PROTOCOL
n
r
e
k
rd
a
.h
w
w
w
SEND STRING
ACCESSORY_START
Gadget
m
o
c
.
l
e
kernel/drivers/usb/gadget/f_accessory.c
w
w
w
a
.h
n
r
e
k
rd
m
o
c
.
l
e
n
r
e
k
rd
a
.h
kernel/arch/arm/configs/odroida_android_defconfig
kernel/arch/arm/plat-s5p/devs.c
kernel/drivers/usb/gadget/composite.c
kernel/drivers/usb/gadget/f_mass_storage.c
kernel/drivers/usb/gadget/f_accessory.c
kernel/include/linux/usb/f_accessory.h
kernel/include/linux/usb/composite.h
w
w
w
android-2.3.3 vs android-2.3.4
c
.
l
e
m
o
w
w
w
a
.h
n
r
e
k
rd
c
.
l
e
m
o
w
w
w
a
.h
n
r
e
k
rd
Android-2.3.3
UsbObserver.java uevent
c
.
l
e
n
r
e
k
rd
AndroidAndroid-2.3.4
UsbService.java uevent
m
o
frameworks/base/services/jni/com_android_server_UsbService.cpp
a
.h
31 #include <linux/usb/f_accessory.h>
32
33 #define DRIVER_NAME "/dev/usb_accessory"
34
35 namespace android
w
w
w
UsbManager class
n
r
e
k
rd
openAccessory()
m
o
c
.
l
e
getAccessoryList()
ParcelFileDescriptor return
hasPermission()
requestPermission()
w
w
w
a
.h
n
r
e
k
rd
a
.h
m
o
c
.
l
e
AndroidAndroid-2.3.3
public class Usb {
w
w
w
UsbManager class
AndroidAndroid-2.3.4
public class UsbManager {
private static final String TAG = "UsbManager";
c
.
l
e
n
r
e
k
rd
m
o
a
.h
w
w
w
com.android.hardware.usb.*
n
r
e
k
rd
a
.h
w
w
w
m
o
c
.
l
e
n
r
e
k
rd
<activity android:name=".ThermalPrinterActivity"
a
.h
w
w
w
m
o
c
.
l
e
c
.
l
e
m
o
w
w
w
a
.h
n
r
e
k
rd
http://dev.odroid.com/projects/accessory
n
r
e
k
rd
Passwod : anonsvn
w
w
w
a
.h
m
o
c
.
l
e
Source repository
w
w
w
n
r
e
k
rd
a
.h
m
o
c
.
l
e
m
o
c
.
l
e
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.hardkernel.adk" android:versionCode="1" android:versionName="1.0">
<uses-feature android:name="android.hardware.usb.accessory"/>
<uses-sdk android:minSdkVersion="10" />
n
r
e
k
rd
w
w
w
a
.h
<intent-filter>
<action android:name="android.hardware.usb.action.USB_ACCESSORY_ATTACHED" />
</intent-filter>
<meta-data android:name="android.hardware.usb.action.USB_ACCESSORY_ATTACHED"
android:resource="@xml/accessory_filter" />
</activity>
m
o
c
.
l
e
n
r
e
k
rd
<resources>
<usb-accessory manufacturer="Hardkernel Co., Ltd." model="Thermal Printer"/>
</resources>
main.c
195
196
197
198
199
200
201
202
static
static
static
static
static
static
char
char
char
char
char
char
a
.h
description[] = "ODROID-ADK1";
manufacturer[] = "Hardkernel Co., Ltd.";
model[] = "Thermal Printer";
uri[] = "http://www.hardkernel.com";
version[] = "1.1";
serial[] = "N/A";
w
w
w
n
r
e
k
rd
USBAccessoryManager.java
w
w
w
a
.h
if(packageName.equals(action)) {
...
m
o
c
.
l
e
c
.
l
e
m
o
w
w
w
a
.h
n
r
e
k
rd
c
.
l
e
n
r
e
k
rd
USBAccessoryManager::enable(this);
m
o
a
.h
w
w
w
deviceManager = (UsbManager)context.getSystemService("UsbAccessory");
accessories = deviceManager.getAccessoryList();
parcelFileDescriptor = deviceManager.openAccessory(accessory);
handler.obtainMessage(what,
new
USBAccessoryManagerMessage(USBAccessoryManagerMessage.MessageType.READY,
accessory)).sendToTarget();
m
o
c
.
l
e
n
r
e
k
rd
a
.h
w
w
w
}
outputStream.write(data);
} catch (IOException e) {
}
n
r
e
k
rd
a
.h
...
@Override
public void run() {
byte[] buffer = new byte[1024]; // buffer store for the stream
int bytes; // bytes returned from read()
w
w
w
m
o
c
.
l
e
while(continueRunning) {
try {
bytes = inputStream.read(buffer);
byte[] data = new byte[bytes];
System.arraycopy(buffer, 0, data, 0, bytes);
...
new
USBAccessoryManagerMessage(USBAccessoryManagerMessage.MessageType.READ,
data)).sendToTarget();
c
.
l
e
n
r
e
k
rd
a
.h
m
o
w
w
w
switch(msg.what)
{
case USBAccessoryWhat:
switch(((USBAccessoryManagerMessage)msg.obj).type) {
case READ:
...
case READY:
setTitle("Device connected.");
mBtnPrint.setEnabled(true);
n
r
e
k
rd
m
o
c
.
l
e
view.getDrawingCache();
Scan line
(384 pixel * 8 = 384 byte)
w
w
w
a
.h
read()
OK(define 1)
write()
1 + 384byte
385byte
USBAccessoryManager
UsbManager
1byte(0x01)
m
o
c
.
l
e
n
r
.
e
k
d
r
a
.h
.
.
w
www.hardkernel.com
w
w