Thursday, November 28, 2013

Android command line tips

Change screen resolution:
#am display-size 800x480

Connect WiFi network
> scan
> scan_results
> list_networks
> add_network
> set_network 0 ssid "MY_SSID"
> set_network 0 psk "MY_PSK"
> enable_network 0
> save_config
> ^D

Button press from command line!
# input keyevent 26
# input keyevent 4
# input keyevent 24
# input keyevent 25
# input keyevent 82
# input keyevent 84

Remount /system rw
# mount -o remount,rw -t ext4 /system 

Write and erase rockchip rk2928 nand partitions

#erase kernel
sudo rkflashtool e 0x00004000 0x00006000
#erase boot
sudo rkflashtool e 0x0000a000 0x00008000
#erase recovery
sudo rkflashtool e 0x00012000 0x00010000
#erase cache
sudo rkflashtool e 0x00042000 0x00040000
#erase userdata
sudo rkflashtool e 0x00082000 0x00200000
#erase system
sudo rkflashtool e 0x00100000 0x00284000
#erase misc
sudo rkflashtool e 0x00002000 0x00002000

#write kernel
sudo rkflashtool w 00004000 0x00006000 < kernel.img
#write boot
sudo rkflashtool w 0x0000a000 0x00008000 < boot.img
#write recovery
sudo rkflashtool w 0x00012000 0x00010000 < recovery.img
#write system
sudo rkflashtool w 0x00100000 0x00284000 < system.img
#write misc
sudo rkflashtool w 0x00002000 0x00002000 < misc.img

Rockchip unpack/repack boot.img

rkunpack boot.img
mkdir boot-extracted
cd boot-extracted
cat ../boot.img-raw | gunzip | cpio -i

find . | cpio -o -H newc | gzip > ../newboot.img
rkcrc -k newboot.img newboot-signed.img


dd if=boot.img of=boot.img.gz skip=8 bs=1 count=100000000000
gunzip boot.img.gz
mkdir unpacked
cd unpacked
cpio -i <../boot.img

cd unpacked
find . | xargs -I file touch -d "1970-01-01 01:00" file
find . | cpio -o -H newc | gzip -n >../newboot.img.gz
rkcrc -k newboot.img.gz newboot.img

Thursday, November 21, 2013

CWM for RK2928

download recovery.img [1]
adb kill-server
adb devices
adb push flash_image /dev/
adb push recovery.img /dev/
adb shell
chmod 755 /dev/flash_image
/dev/flash_image recovery /dev/recovery.img


sudo rkflashtool w 0x00012000 0x00010000 < ~/shared/T711/rom/rk2928-CWM/recovery.img

ignore message:  rkflashtool: fatal: premature end-of-file reached.


RK2928sdk kernel compile notes [INCOMPLETE/IN PROGRESS]


Kernel source:
Base kernel config:

got error:
make[1]: *** No rule to make target `arch/arm/plat-rk/vpu_service.o', needed by `arch/arm/plat-rk/built-in.o'.  Stop.
fixed by:

cd bqCurie/kernel/arch/arm/mach-rk2928/include/mach
cd bqCurie/kernel/arch/arm/mach-rk2928
mv bqCurie/kernel/arch/arm/plat-rk/include/plat/vpu_service.h  bqCurie/kernel/arch/arm/plat-rk/include/plat/vpu_service.h-DELETED

remove line obj-$(CONFIG_RK29_VPU) += vpu_service.o from bqCurie/kernel/arch/arm/plat-rk/Makefile
got error:

arch/arm/mach-rk2928/devices.c:806:2: error: implicit declaration of function 'rk2928_init_i2c' [-Werror=implicit-function-declaration]
cc1: some warnings being treated as errors

fixed by:
                   removing line from MAKEFILE
-Werror-implicit-function-declaration \

### NEW TRIAL ###
sudo apt-get install git-core gnupg flex bison gperf libsdl-dev libesd0-dev libwxgtk2.8-dev build-essential zip curl libncurses5-dev zlib1g-dev ia32-libs-multiarch lib32z1-dev  gcc-multilib g++-multilib sharutils lzop sharutils

git clone initramfs
cd initramfs/
gzip -dc debian-3.0.8+fkubi.cpio.gz > initramfs.cpio
git clone

# CONFIG_VIDEO_RK29 is not set
# CONFIG_RK29_VPU is not set
# CONFIG_RK29_IPP is not set

patch [1] include/drm/drm.h

-#if defined(__linux__)
+#if defined(__KERNEL__) || defined(__linux__)
cp arch/arm/mach-rk30/include/mach/mtk_wcn_cmb_stub.h arch/arm/mach-rk2928/include/mach/

cp -a ~/rk/rk3x_kernel_3.0.36/drivers/mtk_wcn_combo/common/core/ drivers/mtk_wcn_combo/common/

### OLD NOTES ###

git clone toolchains
git clone
git clone initramfs
cd initramfs/
gzip -dc debian-3.0.8+fkubi.cpio.gz > initramfs.cpio
git clone

unbrick T711-NEO rk2928sdk with stock rom image

disconnect USB from computer
hold down POWER button ~20sec to be sure device is powered off
hold down VOL+
[hold down POWER]
Connect USB to computer
[release POWER]
release VOL+

Burn update.img [1] using RKDevelopTool_v1.35 [2]