레이블이 adb인 게시물을 표시합니다. 모든 게시물 표시
레이블이 adb인 게시물을 표시합니다. 모든 게시물 표시

2015년 7월 27일 월요일

How to write images without fastboot on ODROID-XU4(android)

You can not use fastboot on ODROID-XU4, because It doesn't have USB otg port.

How to write images?

First! setup adb connection or copy image to fat partition.


http://codewalkerster.blogspot.kr/2015/07/adb-connect-over-tcpip-when-multiple.html

Push image to fat partition.

$ adb push xxxx.img /storage/sdcard0/
$ adb reboot

Enter u-boot prompt.


U-Boot 2012.07-00029-g0e9204d-dirty (Jul 17 2015 - 15:38:42) for Exynos5422

CPU: Exynos5422 Rev0.1 [Samsung SOC on SMP Platform Base on ARM CortexA7]
APLL = 800MHz, KPLL = 800MHz
MPLL = 532MHz, BPLL = 825MHz

Board: HardKernel ODROID
DRAM:  2 GiB
WARNING: Caches not enabled

TrustZone Enabled BSP
BL1 version: �/� ⁁
VDD_KFC: 0x44
LDO19: 0xf2

Checking Boot Mode ... SDMMC
MMC:   S5P_MSHC2: 0, S5P_MSHC0: 1
MMC Device 0: 7.4 GiB
MMC Device 1: [ERROR] response timeout error : 00000104 cmd 1
Card did not respond to voltage select!
*** Warning - bad CRC, using default environment

In:    serial
Out:   serial
Err:   serial
Net:   No ethernet found.
Double Press 'Enter' to stop autoboot:  0
Exynos5422 #


Example for zImage-dtb

Exynos5422 # fatload mmc 0:1 40008000 zImage-dtb
there are pending interrupts 0x00000001
reading zImage-dtb

4718814 bytes read
Exynos5422 # movi write kernel 0 40008000
writing kernel..device 0 Start 1263, Count 16384
MMC write: dev # 0, block # 1263, count 16384 ... 16384 blocks write: OK
completed
Exynos5422 #

Example for system.img

Exynos5422 # fatload mmc 0:1 40000000 system.img
there are pending interrupts 0x00000001
reading system.img

355139392 bytes read
Exynos5422 # fastboot flash system 40000000 0
[Partition table on MoviNAND]
ptn 0 name='fwbl1' start=0x0 len=N/A (use hard-coded info. (cmd: movi))
ptn 1 name='bl2' start=N/A len=N/A (use hard-coded info. (cmd: movi))
ptn 2 name='bootloader' start=N/A len=N/A (use hard-coded info. (cmd: movi))
ptn 3 name='tzsw' start=N/A len=N/A (use hard-coded info. (cmd: movi))
ptn 4 name='kernel' start=N/A len=N/A (use hard-coded info. (cmd: movi))
ptn 5 name='ramdisk' start=N/A len=0x800000(~8192KB) (use hard-coded info. (cmd)
ptn 6 name='system' start=0x42B5800 len=0x40648800(~1055010KB) 
ptn 7 name='userdata' start=0x448FE000 len=0x80527800(~2102430KB) 
ptn 8 name='cache' start=0xC4E25800 len=0x1036C800(~265650KB) 
ptn 9 name='fat' start=0xD5192000 len=0x1002E5800(~4197270KB) 
flashing 'system'
Compressed ext4 image
*** erase start block 0x215ac ***
*** erase block length 0x202ff0 ***
mmc erase user 0 21800 202c00

MMC erase: dev # 0, block # 137216, count 2108416 ... START: 137216 BLOCK: 21086
high_capacity: 1
Capacity: 2
byte_addressing
before_send_cmd
start_addr
end_addr
erase_addr

Erase
........................................
........................................
........................................
........................................
........................................
..........
 1.0 GB erase Done
2108416 blocks erase: OK

MMC write: dev # 0, block # 136620, count 8 ... 8 blocks write: OK

MMC write: dev # 0, block # 136628, count 8 ... 8 blocks write: OK

MMC write: dev # 0, block # 136636, count 504 ... 504 blocks write: OK
......
.....




You can find other command to write image in this boot.ini files.

boot.ini for eMMC

$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
#------------------------------------------------------------------------------------------------------
#
# EMMC to EMMC Recovery boot.ini text file
#
#------------------------------------------------------------------------------------------------------
ODROIDXU-UBOOT-CONFIG
#------------------------------------------------------------------------------------------------------
# BL1 write to eMMC
#------------------------------------------------------------------------------------------------------
fatload mmc 0:1 40008000 bl1.bin
emmc open 0
movi w z f 0 40008000
emmc close 0
#------------------------------------------------------------------------------------------------------
# BL2 write to eMMC
#------------------------------------------------------------------------------------------------------
fatload mmc 0:1 40008000 bl2.bin
emmc open 0
movi w z b 0 40008000
emmc close 0
#------------------------------------------------------------------------------------------------------
# Bootloader write to eMMC
#------------------------------------------------------------------------------------------------------
fatload mmc 0:1 40008000 u-boot.bin
emmc open 0
movi w z u 0 40008000
emmc close 0
#------------------------------------------------------------------------------------------------------
# Turst Zone Soft Ware write to eMMC
#------------------------------------------------------------------------------------------------------
fatload mmc 0:1 40008000 tzsw.bin
emmc open 0
movi w z t 0 40008000
emmc close 0
#------------------------------------------------------------------------------------------------------
# UBOOT ENV Erase
#------------------------------------------------------------------------------------------------------
mmc write 0 40008000 0x4CF 0x20
#------------------------------------------------------------------------------------------------------
# Kernel Image write to eMMC
#------------------------------------------------------------------------------------------------------
fatload mmc 0:1 40008000 zImage-dtb
movi write kernel 0 40008000

#------------------------------------------------------------------------------------------------------
# System Image write to eMMC
#------------------------------------------------------------------------------------------------------
fatload mmc 0:1 40000000 system.img

#------------------------------------------------------------------------------------------------------
# Userdata Image write to eMMC
#------------------------------------------------------------------------------------------------------
fatload mmc 0:1 57000000 userdata.img

#------------------------------------------------------------------------------------------------------
# Cache Image write to eMMC
#------------------------------------------------------------------------------------------------------
fatload mmc 0:1 61000000 cache.img

#------------------------------------------------------------------------------------------------------
# Partition Create to eMMC
#------------------------------------------------------------------------------------------------------
fdisk -c 0

#------------------------------------------------------------------------------------------------------
fastboot flash system 40000000 0
fastboot flash userdata 57000000 0
fastboot flash cache 61000000 0

#------------------------------------------------------------------------------------------------------
# SD/eMMC FAT Format
#------------------------------------------------------------------------------------------------------
fatformat mmc 0:1

reset
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$


boot.ini for SD

$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
#------------------------------------------------------------------------------------------------------
#
# SD to SD Recovery boot.ini text file
#
#------------------------------------------------------------------------------------------------------
ODROIDXU-UBOOT-CONFIG

#------------------------------------------------------------------------------------------------------
# BL1 write to eMMC
#------------------------------------------------------------------------------------------------------
fatload mmc 0:1 40008000 bl1.bin
movi w f 0 40008000
#------------------------------------------------------------------------------------------------------
# BL2 write to eMMC
#------------------------------------------------------------------------------------------------------
fatload mmc 0:1 40008000 bl2.bin
movi w b 0 40008000
#------------------------------------------------------------------------------------------------------
# Bootloader write to eMMC
#------------------------------------------------------------------------------------------------------
fatload mmc 0:1 40008000 u-boot.bin
movi w u 0 40008000
#------------------------------------------------------------------------------------------------------
# Turst Zone Soft Ware write to eMMC
#------------------------------------------------------------------------------------------------------
fatload mmc 0:1 40008000 tzsw.bin
movi w t 0 40008000
#------------------------------------------------------------------------------------------------------
# UBOOT ENV Erase
#------------------------------------------------------------------------------------------------------
mmc write 0 40008000 0x4CF 0x20
#------------------------------------------------------------------------------------------------------
# Kernel Image write to eMMC
#------------------------------------------------------------------------------------------------------
fatload mmc 0:1 40008000 zImage-dtb
movi write kernel 0 40008000

#------------------------------------------------------------------------------------------------------
# System Image write to eMMC
#------------------------------------------------------------------------------------------------------
fatload mmc 0:1 40000000 system.img

#------------------------------------------------------------------------------------------------------
# Userdata Image write to eMMC
#------------------------------------------------------------------------------------------------------
fatload mmc 0:1 57000000 userdata.img

#------------------------------------------------------------------------------------------------------
# Cache Image write to eMMC
#------------------------------------------------------------------------------------------------------
fatload mmc 0:1 61000000 cache.img

#------------------------------------------------------------------------------------------------------
# Partition Create to eMMC
#------------------------------------------------------------------------------------------------------
fdisk -c 0

#------------------------------------------------------------------------------------------------------
fastboot flash system 40000000 0
fastboot flash userdata 57000000 0
fastboot flash cache 61000000 0

#------------------------------------------------------------------------------------------------------
# SD/eMMC FAT Format
#------------------------------------------------------------------------------------------------------
fatformat mmc 0:1

reset
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$

boot.ini for SD to eMMC

$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
#------------------------------------------------------------------------------------------------------
#
# EMMC to EMMC Recovery boot.ini text file
#
#------------------------------------------------------------------------------------------------------
ODROIDXU-UBOOT-CONFIG
#------------------------------------------------------------------------------------------------------
# BL1 write to eMMC
#------------------------------------------------------------------------------------------------------
fatload mmc 0:1 40008000 bl1.bin
emmc open 1
movi w z f 1 40008000
emmc close 1
#------------------------------------------------------------------------------------------------------
# BL2 write to eMMC
#------------------------------------------------------------------------------------------------------
fatload mmc 0:1 40008000 bl2.bin
emmc open 1
movi w z b 1 40008000
emmc close 1
#------------------------------------------------------------------------------------------------------
# Bootloader write to eMMC
#------------------------------------------------------------------------------------------------------
fatload mmc 0:1 40008000 u-boot.bin
emmc open 1
movi w z u 1 40008000
emmc close 1
#------------------------------------------------------------------------------------------------------
# Turst Zone Soft Ware write to eMMC
#------------------------------------------------------------------------------------------------------
fatload mmc 0:1 40008000 tzsw.bin
emmc open 1
movi w z t 1 40008000
emmc close 1
#------------------------------------------------------------------------------------------------------
# UBOOT ENV Erase
#------------------------------------------------------------------------------------------------------
mmc write 1 40008000 0x4CF 0x20
#------------------------------------------------------------------------------------------------------
# Kernel Image write to eMMC
#------------------------------------------------------------------------------------------------------
fatload mmc 0:1 40008000 zImage-dtb
movi write kernel 1 40008000

#------------------------------------------------------------------------------------------------------
# System Image write to eMMC
#------------------------------------------------------------------------------------------------------
fatload mmc 0:1 40000000 system.img

#------------------------------------------------------------------------------------------------------
# Userdata Image write to eMMC
#------------------------------------------------------------------------------------------------------
fatload mmc 0:1 57000000 userdata.img

#------------------------------------------------------------------------------------------------------
# Cache Image write to eMMC
#------------------------------------------------------------------------------------------------------
fatload mmc 0:1 61000000 cache.img

#------------------------------------------------------------------------------------------------------
# Partition Create to eMMC
#------------------------------------------------------------------------------------------------------
fdisk -c 1

#------------------------------------------------------------------------------------------------------
fastboot flash system 40000000 1
fastboot flash userdata 57000000 1
fastboot flash cache 61000000 1

#------------------------------------------------------------------------------------------------------
# SD/eMMC FAT Format
#------------------------------------------------------------------------------------------------------
fatformat mmc 1:1

fastboot poweroff
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$



Build android.

$ adb connect 192.168.x.x
$ cd out/target/products/odroidxu3/
$ adb push update.zip /storage/sdcard0/
$ adb push update.zip.md5sum /storage/sdcard0/

Run ODROID Update.


Now enable 'Validate file' button.



















2015년 7월 24일 금요일

adb connect over TCPIP when Multiple Devices

Get all device's IP.

shell@odroidxu3:/ $ su                                                          
root@odroidxu3:/ # netcfg                                                       
lo       UP                                   127.0.0.1/8   0x00000049 00:00:000
eth0     UP                               192.168.0.1/24  0x00001043 fa:e2:864
sit0     DOWN                                   0.0.0.0/0   0x00000080 00:00:000
ip6tnl0  DOWN                                   0.0.0.0/0   0x00000080 00:00:000
root@odroidxu3:/ # 

eth0 -> adb over Ethernet.
wlan0 -> adb over Wi-Fi.

device1 ip 192.168.0.1
device2 ip 192.168.0.2
device3 ip 192.168.0.3
......
deviceN ip 192.168.0.N

Restart adbd service at all devices.

root@odroidxu3:/ # setprop service.adb.tcp.port 5555     
root@odroidxu3:/ # stop adbd && start adbd                                      
[  286.223070] [c4] adb_release                                                 
[  286.224485] [c4] dwc3 12400000.dwc3: request de1f4f80 was not queued to ep0ot
root@odroidxu3:/ [  286.239830] [c1] adb_open                                   
[  286.242450] [c6] adb_bind_config                                             

Or Edit /system/build.prop. No more stop and start adbd.

add this line.
$ su
# mount -o rw,remount /system
# vi /system/build.prop

service.adb.tcp.port=5555

Connect device on 192.168.0.1

[~]$ adb connect 192.168.0.1
connected to 192.168.0.1:5555


[~]$ adb logcat

--------- beginning of /dev/log/main
I/installd( 2785): installd firing up
I/DEBUG   ( 2780): debuggerd: Jul  2 2015 14:27:22
I/Netd    ( 2779): Netd 1.0 starting
W/InterfaceController( 2779): Warning (dlopen failed: library "/system/lib/libnetcmdiface.so" not found) while opening the net interface command library
--------- beginning of /dev/log/system
I/Vold    ( 2774): Vold 2.1 (the revenge) firing up
E/Vold    ( 2774): boot_mode = 0
E/Vold    ( 2774): eMMC boot_mode
D/Vold    ( 2774): Volume sdcard0 state changing -1 (Initializing) -> 0 (No-Media)
D/Vold    ( 2774): Volume sdcard1 state changing -1 (Initializing) -> 0 (No-Media)
D/Vold    ( 2774): Volume usb2host state changing -1 (Initializing) -> 0 (No-Media)
D/Vold    ( 2774): Volume usb3host state changing -1 (Initializing) -> 0 (No-Media)
D/Vold    ( 2774): Volume usb3device state changing -1 (Initializing) -> 0 (No-Media)
D/Vold    ( 2774): Volume sdcard0 state changing 0 (No-Media) -> 1 (Idle-Unmounted)
W/Vold    ( 2774): Duplicate state (1)
W/Vold    ( 2774): Duplicate state (1)

On other terminal

[~]$ adb devices
List of devices attached 
192.168.0.1:5555 device

Connect deivce on 192.168.0.2

[~]$ adb connect 192.168.0.2
connected to 192.168.0.2:5555

There are multiple devices.

[~]$ adb devices
List of devices attached 
192.168.0.1:5555 device
192.168.0.2:5555 device

If you connect other device, It is impossible.

[~]$ adb logcat
- waiting for device -
error: more than one device and emulator

You can solve by option '-s'

[~]$ adb -s 192.168.0.2:5555 logcat
--------- beginning of /dev/log/main
I/installd( 2785): installd firing up
I/DEBUG   ( 2780): debuggerd: Jul  2 2015 14:27:22
I/Netd    ( 2779): Netd 1.0 starting
W/InterfaceController( 2779): Warning (dlopen failed: library "/system/lib/libnetcmdiface.so" not found) while opening the net interface command library
--------- beginning of /dev/log/system
I/Vold    ( 2774): Vold 2.1 (the revenge) firing up
E/Vold    ( 2774): boot_mode = 0
E/Vold    ( 2774): eMMC boot_mode
D/Vold    ( 2774): Volume sdcard0 state changing -1 (Initializing) -> 0 (No-Media)
D/Vold    ( 2774): Volume sdcard1 state changing -1 (Initializing) -> 0 (No-Media)
D/Vold    ( 2774): Volume usb2host state changing -1 (Initializing) -> 0 (No-Media)
D/Vold    ( 2774): Volume usb3host state changing -1 (Initializing) -> 0 (No-Media)
D/Vold    ( 2774): Volume usb3device state changing -1 (Initializing) -> 0 (No-Media)
D/Vold    ( 2774): Volume sdcard0 state changing 0 (No-Media) -> 1 (Idle-Unmounted)
W/Vold    ( 2774): Duplicate state (1)
W/Vold    ( 2774): Duplicate state (1)

2013년 11월 24일 일요일

ODROID adb/fastboot driver 설치 하기(Windows 7 64bit)

드라이버를 다운 받습니다.


'장치 관리자'를 실행합니다.


'Full Android on SMDK4412'를 선택합니다.
'드라이버 업데이트'를 클릭합니다.



'컴퓨터에서 드라이버 소프트웨어 찾아보기'를 선택합니다.


'컴퓨터의 장치 드라이버 목록에서 직접 선택'을 선택합니다.


'ADB Interface'를 선택합니다.


'ADB Testing Interface'를 선택합니다.


'디스크 있음' 선택합니다.


다운 받은 파일을 압축 풀고 그 폴더를 선택합니다.


windows 7 64bit의 경우 amd64 폴더의 android_usb.inf 선택하고 windows xp(32bit)인 경우 x86의 android_usb.inf를 선택합니다.








fastboot로 연결 시 드라이버(Android 1.0)를 다시 설치 하셔야 합니다.
아래 링크에서 fastboot와 driver를 받으실 수 있습니다.





2013년 5월 13일 월요일

adb shell sendevent로 pinch zoom in/out

adb shell sendevent로 android에 input event를 가상으로 보낼 수 있습니다.

http://toors.tistory.com/entry/android-touch-move-event-%EC%83%9D%EC%84%B1

위에 링크처럼 하면 move와 같이 single  touch event는 만들 수 있습니다.

pinch zoom in/out과 같은 multi touch event도 만들 수 있습니다.

getevent에서 odroidx-ts가 touch screen device이고 node는 event1입니다.

# getevent                                                    
add device 1: /dev/input/event0                                              
  name:     "odroid-keypad"                                                  
add device 2: /dev/input/event2                                              
  name:     "Microsoft Microsoft 3-Button Mouse with IntelliEye(TM)"          
add device 3: /dev/input/event1                                              
  name:     "odroidx-ts"


저의 시스템에서 touch의 노드는 /dev/input/event3입니다.

sh로 만드실 경우 system을 없애고 "adb shell sendevent"로 고치시면 됩니다.


//첫번째 pointer의 ABS_MT_TRACKING_ID를 1로 설정한다.
system("sendevent /dev/input/event1 3 57 1");
system("sendevent /dev/input/event1 3 53 %d", X1);
system("sendevent /dev/input/event1 3 54 %d", Y1);
//ABS_MT_PRESSURE 8정도의 값을 보내서 press 되었다고 알려 줍니다.
system("sendevent /dev/input/event1 3 58 8");
//한 pointer에 대한 EV_SYN, SYN_REPORT를 보낸다.
system("sendevent /dev/input/event3 0 0 0");


//두번째 pointer 입력 전에 ABS_MT_SLOT을 보낸다.
system("sendevent /dev/input/event3 3 47 1");


//두번째 pointer의 위치를 정한다.
X1 = X2 + 50;
Y2 = Y2 + 50;


//두번째 pointer
//첫번째 pointer의 ABS_MT_TRACKING_ID를 2로 설정한다.
system("sendevent /dev/input/event1 3 57 2");
system("sendevent /dev/input/event1 3 53 %d", X2);
system("sendevent /dev/input/event1 3 54 %d", Y2);  
system("sendevent /dev/input/event1 3 58 8");
system("sendevent /dev/input/event1 0 0 0");


//여기서 ABS_MT_POSITION_X(53), ABS_MT_POSITION_Y(54), 그리고 SYN_REPORT를 한 묶음으로 이동하고 싶은 만큼 반복한다.
system("sendevent /dev/input/event1 3 53 %d", X2 += 20);
system("sendevent /dev/input/event1 3 54 %d", Y2 += 20);
system("sendevent /dev/input/event1 0 0 0");


//첫번째 pointer의 ABS_MT_TR두ACKING_ID를 -1을 초기화 한다.
system("sendevent /dev/input/event1 3 57 -1");
system("sendevent /dev/input/event1 0 0 0");
//ABS_MT_SLOT(47)은 0,1로 번갈아 입력된다. 앞에서 1로 보냈으니 0으로 보낸다.
system("sendevent /dev/input/event1 3 47 0");
//두번째 pointer의 ABS_MT_TRACKING_ID를 -1을 초기화 한다.
system("sendevent /dev/input/event1 3 57 -1");
system("sendevent /dev/input/event1 0 0 0");

--------------------------------------------------------------------------------------------------

bionic/libc/kernel/common/linux/input.h에 define 되어 있습니다.

#define EV_ABS 0x03
#define ABS_MT_POSITION_X 0x35  -> 57(십진수)

#define ABS_MT_POSITION_Y 0x36 - > 58(십진수)
#define ABS_MT_PRESSURE 0x3a



아래와 같이 getevent -l 로 event를 확인 할 수 있는데 Multi touch시에 event가 어떻게 들어 오는지 확인하여 pinch zoom을 구현해 봤습니다.


$ adb shell getevent -l
add device 1: /dev/input/event0
  name:     "odroid-keypad"
add device 2: /dev/input/event2
  name:     "Microsoft Microsoft 3-Button Mouse with IntelliEye(TM)"
add device 3: /dev/input/event1
  name:     "odroidx-ts"
/dev/input/event2: EV_REL       REL_X                ffffffff          
/dev/input/event2: EV_REL       REL_Y                00000001          
/dev/input/event2: EV_SYN       SYN_REPORT           00000000          
/dev/input/event2: EV_REL       REL_X                ffffffff          
/dev/input/event2: EV_REL       REL_Y                00000002          
/dev/input/event2: EV_SYN       SYN_REPORT           00000000          
/dev/input/event2: EV_REL       REL_X                ffffffff          
/dev/input/event2: EV_REL       REL_Y                00000002          
/dev/input/event2: EV_SYN       SYN_REPORT           00000000          
/dev/input/event2: EV_REL       REL_X                ffffffff          
/dev/input/event2: EV_REL       REL_Y                00000002          
/dev/input/event2: EV_SYN       SYN_REPORT           00000000          
/dev/input/event2: EV_REL       REL_X                ffffffff          
/dev/input/event2: EV_REL       REL_Y                00000002          
/dev/input/event2: EV_SYN       SYN_REPORT           00000000          
/dev/input/event2: EV_REL       REL_X                ffffffff          
/dev/input/event2: EV_REL       REL_Y                00000002