2010年9月7日 星期二

how to add busybox to android

When we use console on android file system,we often feel inconvenience.We can't type Backspeace、Tab function and have not some command instruction on android file system.

So,we can add busybox on android file system. But how to add busybox to android system?

We can download source in the URL
http://www.busybox.net/downloads/

new version is BusyBox 1.17.2
Download and extract it
Then we go to busybox folder and configure it.

mad@mad-desktop:~/LAB/busybox$ tar -jxvf busybox-1.17.2.tar.bz2
mad@mad-desktop:~/LAB/busybox$ cd busybox-1.17.2/
mad@mad-desktop:~/LAB/busybox/busybox-1.17.2$ make menuconfig


In order to get static binary,we must to select some item

Busybox Settings --->
Build Options --->
[*] Build BusyBox as a static binary (no shared libs)


Don't install BusyBox binary to your host /usr

Busybox Settings --->
Installation Options --->
[*] Don't use /usr


Then download cross compiler for arm and set up it in BusyBox
Our cross compiler use 2010q1-188 EABI.
We go to the url and download it
http://www.codesourcery.com/sgpp/lite/arm/portal/subscription?@template=lite


Busybox Settings --->
Build Options --->
() Cross Compiler prefix
/home/mad/LAB/omap/omap3_dvsdk/toolchain/2010q1-188/bin/arm-none-linux-gnueabi-


now we can select the command that we need
Default config are all selected,so Binary will be bigger
We cancel some unnecessary item
OK! make it


mad@mad-desktop:~/LAB/busybox/busybox-1.17.2$ make
mad@mad-desktop:~/LAB/busybox/busybox-1.17.2$ make install


We will get _install floder
go to _install floder
copy the bin and sbin floder to android file system


mad@mad-desktop:~/LAB/busybox/busybox-1.17.2$ cd _install
mad@mad-desktop:~/LAB/busybox/busybox-1.17.2/_install$ ls -al
total 16
drwxr-xr-x 4 mad mad 4096 2010-09-08 00:21 .
drwxr-xr-x 33 mad mad 4096 2010-09-08 00:21 ..
drwxr-xr-x 2 mad mad 4096 2010-09-08 00:35 bin
lrwxrwxrwx 1 mad mad 11 2010-09-08 00:21 linuxrc -> bin/busybox
drwxr-xr-x 2 mad mad 4096 2010-09-08 00:21 sbin

mad@mad-desktop:~/LAB/busybox/busybox-1.17.2/_install$ cp -rf ./bin/* ~/0xlab-androidfs/system/bin/
mad@mad-desktop:~/LAB/busybox/busybox-1.17.2/_install$ cp -rf ./sbin/* ~/0xlab-androidfs/system/sbin/


ok! we push android to board

use console and we can use Tab and BackSpace

2010年8月27日 星期五

How to use libupnp sample code

First, download the libupnp source code

http://sourceforge.net/projects/pupnp/files/

version is libupnp-1.6.6

now we extract and compiler it


mad@mad-desktop:~$ tar -jxvf libupnp-1.6.6.tar.bz2
mad@mad-desktop:~$ cd libupnp-1.6.6/
mad@mad-desktop:~/libupnp-1.6.6$ ./configure
mad@mad-desktop:~/libupnp-1.6.6$ make


now we compiler sample code


mad@mad-desktop:~/libupnp-1.6.6$ cd upnp/
mad@mad-desktop:~/libupnp-1.6.6/upnp$ cd sample/
mad@mad-desktop:~/libupnp-1.6.6/upnp/sample$ make check


now you can see the execute file.upnp_tv_ctrlpt and upnp_tv_device
upnp_tv_ctrlpt is UPnP control point and
upnp_tv_device is upnp virtual device
we execute it


mad@mad-desktop:~/libupnp-1.6.6/upnp/sample$ ./upnp_tv_device


you can see upnp virtual device information


mad@mad-desktop:~/LAB/libupnp/libupnp-1.6.6/upnp/sample$ ./upnp_tv_device
Initializing UPnP Sdk with
ipaddress = (null) port = 0
UPnP Initialized
ipaddress= 192.168.0.123 port = 49154
Specifying the webserver root directory -- ./web
Registering the RootDevice
with desc_doc_url: http://192.168.0.123:49154/tvdevicedesc.xml
RootDevice Registered
Initializing State Table
Found service: urn:schemas-upnp-org:service:tvcontrol:1
serviceId: urn:upnp-org:serviceId:tvcontrol1
Found service: urn:schemas-upnp-org:service:tvpicture:1
serviceId: urn:upnp-org:serviceId:tvpicture1
State Table Initialized
Advertisements Sent

>>


you can see the device's service at the url
http://192.168.0.123:49154/tvdevicedesc.xml



and then you execute control point

mad@mad-desktop:~/LAB/libupnp/libupnp-1.6.6/upnp/sample$ ./upnp_tv_ctrlpt


mad@mad-desktop:~/LAB/libupnp/libupnp-1.6.6/upnp/sample$ ./upnp_tv_ctrlpt
Initializing UPnP Sdk with
ipaddress = (null) port = 0

UPnP Initialized
ipaddress= 192.168.0.123 port = 49153

Registering Control Point
Control Point Registered




then you can see virtual device's discovery



======================================================================

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

UPNP_DISCOVERY_SEARCH_RESULT

ErrCode = 0

Expires = 100

DeviceId = uuid:Upnp-TVEmulator-1_0-1234567890001

DeviceType = urn:schemas-upnp-org:device:tvdevice:1

ServiceType =

ServiceVer =

Location = http://192.168.0.123:49155/tvdevicedesc.xml

OS = Linux/2.6.28-18-generic, UPnP/1.0, Portable SDK for UPnP devices/1.6.6

Ext =

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

======================================================================



to be continued

How to run 0xlab android 2.1 audio player on devkit8000

How to run 0xlab android 2.1 audio player

Step 1:

reference to:http://code.google.com/p/0xdroid/wiki/Source

then repo the android2.1 source code

just "make" it

when successfully built,we want to generated new root file system, just copy the rebuild file


mad@mad-desktop:~$ mkdir fatma
mad@mad-desktop:~$ cd fatma
mad@mad-desktop:~$ cp out/target/product/beagleboard/root/* .
mad@mad-desktop:~$ cd ~/fatma/system
mad@mad-desktop:~$ cp out/target/product/beagleboard/system/* .
mad@mad-desktop:~$ cd ~/fatma


solve thing the 0xlab cant play audio,we add some script command in android script


mad@mad-desktop:~$ vim ~/fatma/system/etc/init.goldfish.sh


add command to last line


# kernel 2.6.29
alsa_amixer set 'PredriveL Mux' DACL2
alsa_amixer set 'PredriveR Mux' DACR2
# kernel 2.6.32
# alsa_amixer set 'PredriveR Mixer AudioR2' on
# alsa_amixer set 'PredriveL Mixer AudioL2' on

alsa_amixer set PreDriv 100 unmute
alsa_amixer set 'DAC2 Digital Fine' 50



mad@mad-desktop:~$ vim ~/fatma/system/etc/init.omap3.sh


add command to last line


# kernel 2.6.29
alsa_amixer set 'PredriveL Mux' DACL2
alsa_amixer set 'PredriveR Mux' DACR2
# kernel 2.6.32
# alsa_amixer set 'PredriveR Mixer AudioR2' on
# alsa_amixer set 'PredriveL Mixer AudioL2' on

alsa_amixer set PreDriv 100 unmute
alsa_amixer set 'DAC2 Digital Fine' 50


ok! now we compress the "fatma folder" to ubi fs image

we must use CD's attach tool, copy three files"mkfs.ubifs","ubinize","ubinize.cfg" to the linux OS.


mad@mad-desktop:~$ mkdir fatmaubi
mad@mad-desktop:~$ cd fatmaubi
mad@mad-desktop:~$ ls
total 78344
drwxr-xr-x 2 mad mad 4096 2010-07-29 22:01 .
drwxr-xr-x 6 mad mad 4096 2010-07-29 17:28 ..
-rw-r--r-- 1 mad mad 174424 2010-01-04 19:28 mkfs.ubifs
-rw-r--r-- 1 mad mad 79030 2010-01-04 19:28 ubinize
-rw-r--r-- 1 mad mad 124 2010-01-04 19:28 ubinize.cfg


we must change file mode to excutable


mad@mad-desktop:~$ chmod 755 mkfs.ubifs
mad@mad-desktop:~$ chmod 755 ubinize
mad@mad-desktop:~$ sudo ./mkfs.ubifs -r ~/fatma -m 2048 -e 129024 -c 812 -o ubifs.img
generate ubifs.img
mad@mad-desktop:~$ sudo ./ubinize -o ubi.img -m 2048 -p 128KiB -s 512 ubinize.cfg
generate ubi.img


download the 0xloab's devkit8k-eclair-0x4.zip and flash-uboot.bin
http://downloads.0xlab.org/release/devkit8k-eclair-0x4/devkit8k-eclair-0x4.zip
http://downloads.0xlab.org/release/devkit8k-eclair-0x4/flash-uboot.bin
unzip devkit8k-eclair-0x4.zip,and put flash-uboot.bin to folder
now we can see 5 file

0xkernel.bin
android.ubi
flash-uboot.bin
install.conf
uImage.bin

reference to http://code.google.com/p/0xdroid/wiki/UsingPreBuiltImages
copy to SD card FAT32 partition

rename ubi.img to android.ubi and cover the android.ubi on the folder

2010年7月23日 星期五

omap3530 Devkit8000 SD card boot

Devkit8000 有時連window格式化後的SD card都不能開的話

此時,建議使用HP USB Disk Storage Format Tool 2.0.6

http://www.embedinfo.com/english/download/SP27213.exe

把第一個Partiton格式化為FAT32即可

PS:

MLO即為X-loader通常是for MMC/SD,

在x-loader source code(include/configs/ omap3devkit8000.h)

更改define CFG_CMD_MMC部份,即為燒於NAND flash的X-loader

通常會命名為x-load.bin.ift_for_NAND

2010年7月9日 星期五

編譯android & DevKit8000 SD boot

1.假如ubuntu系統有兩個java版本,編譯android如何設定系統java版本


mad@mad-desktop:~$ sudo update-alternatives --config java

提供“java”的替換項式共有 2。

可使用的替換項目
===========================
* 1 /usr/lib/jvm/java-1.5.0-sun/jre/bin/java
+ 2 /usr/lib/jvm/java-6-openjdk/jre/bin/java

按下 enter 來指定預設選項[*],或者輸入選擇的號碼:


此時便可選擇你所需的版本。



2.Omap3530 DevKit8000發展版,若不小心把NAND裡的U-boot洗掉,該如何?

可從SD卡,燒寫回去,這時需對SD卡格式化好FAT與EXT3兩個Partition

方法如user guide所示,唯一需注意的是

若是發展版按下Boot Key指名從SD boot卻無反應,則這是可能需把SD卡上

FAT Partition在Window上重新格式化一遍

測試

大家好,我是馬哥

我來紀錄我的嵌入式學習歷程