Blog


How to port Android 4.0.3 Ice Cream Sandwich(ICS) on ODROID-7
Posted by ODROID on 19 December 2011 at 10:37 am
You can get a test image in the Download menu.



Screenshot of ICS 4.0.3 version information on ODROID-7.
ics_ver.png


Here is a brief instruction how to port/install the ICS into ODROID-7.
Note, this is a very early version. Unstable and there are many unsupported features.


1. Get the Kernel source code of ODROID-7 (ver 2.6.35)
http://com.odroid.com/sigong/nf_file_board/nfile_board_view.php?keyword=&bid=41

Modify the touch screen driver as below.
kernel/drivers/input/touchscreen/odroid7_MT_touch_portrait.c

169                 input_sync(hkc1xx_touch.driver);
170 
171 //codewalker
172                 input_mt_sync(hkc1xx_touch.driver);
173 
174                 input_sync(hkc1xx_touch.driver);
175 176 177 #if defined(DEBUG_HKC1XX_TOUCH_MSG) 178 printk("%s : Penup event send[x = %d, y = %d]n", __FUNCTION__, hkc1xx_touch.x, hkc1xx_touch.y); 179 #endif


2. Download GPU device driver source code of Nexus-S from this link.
https://github.com/Kwiboo/kernel_samsung_crespo/tree/master/drivers/gpu
Copy(overwrite) the GPU code to ODROID-7 kernel source and compile it.

3. Get the official Android ICS source code.(android-4.0.3_r1 IML74K)
repo init -u https://android.googlesource.com/platform/manifest -b android-4.0.3_r1
repo sync

4. Get the modified files from below link and overwrite it into /device & /vendor directory of ICS source tree.
http://dl.dropbox.com/u/4485660/ICS.tar.gz
This file contains various patches.

5. Modify WiFi code as below for internet access.

device/hardkernel/odroid7/BoardConfigCommon.mk

71 #WIFI_DRIVER_MODULE_ARG := "firmware_path=/vendor/firmware/fw_bcm4329.bin nvram_path=/vendor/firmware/nvram_net.txt iface_name=wlan" 72 WIFI_DRIVER_MODULE_ARG := "iface_name=wlan firmware_path=/vendor/firmware/fw_bcm4329.bin nvram_path=/vendor/firmware/nvram"

And copy the fw_bcm4329.bin & nvram into proper location.


Modify hardware/libhardware_legacy/wifi/wifi.c

#define WIFI_WAKEUP_CTL_FP "/sys/devices/platform/hkc1xx-sysfs/wifi_wakeup" // 1 -> wakeup on #define WIFI_REG_CTL_FP "/sys/devices/platform/hkc1xx-sysfs/wifi_reg" // 1 -> reg on #define WIFI_RESET_CTL_FP "/sys/devices/platform/hkc1xx-sysfs/wifi_reset" // 1 -> reset on int wifi_set_module_status (char *ctl_fp, unsigned char status); int wifi_get_module_status (char *ctl_fp); static int insmod(const char *filename, const char *args) {


int wifi_load_driver() { #ifdef WIFI_DRIVER_MODULE_PATH char driver_status[PROPERTY_VALUE_MAX]; int count = 100; /* wait at most 20 seconds for completion */ if (is_wifi_driver_loaded()) { return 0; } // Wifi power control & wakeup enable wifi_set_module_status(WIFI_WAKEUP_CTL_FP, 1); usleep(10000); wifi_set_module_status(WIFI_REG_CTL_FP, 1); usleep(10000); wifi_set_module_status(WIFI_RESET_CTL_FP, 1); sleep(1); sync(); if (insmod(DRIVER_MODULE_PATH, DRIVER_MODULE_ARG) < 0) { LOGE("insmod(DRIVER_MODULE_PATH = %s, DRIVER_MODULE_ARG = %s) FAIL!!!", DRIVER_MODULE_PATH, DRIVER_MODULE_ARG); wifi_set_module_status(WIFI_WAKEUP_CTL_FP, 0); usleep(10000); wifi_set_module_status(WIFI_REG_CTL_FP, 0); usleep(10000); wifi_set_module_status(WIFI_RESET_CTL_FP, 0); sleep(1); sync(); return -1; } if (strcmp(FIRMWARE_LOADER,"") == 0) {


int wifi_unload_driver() { usleep(200000); /* allow to finish interface down */ #ifdef WIFI_DRIVER_MODULE_PATH if (rmmod(DRIVER_MODULE_NAME) == 0) { int count = 20; /* wait at most 10 seconds for completion */ while (count-- > 0) { if (!is_wifi_driver_loaded()) break; usleep(500000); } wifi_set_module_status(WIFI_WAKEUP_CTL_FP, 0); usleep(10000); wifi_set_module_status(WIFI_REG_CTL_FP, 0); usleep(10000); wifi_set_module_status(WIFI_RESET_CTL_FP, 0); sleep(1); sync(); usleep(500000); /* allow card removal */ if (count) { return 0;

int wifi_set_module_status(char *ctl_fp, unsigned char status) { int fd, ret, nwr; char buf[10]; if((fd = open(ctl_fp, O_RDWR)) < 0) { LOGE("%s(%s) : Cannot access "%s"", __FILE__, __FUNCTION__, ctl_fp); return -1; // fd open fail } memset((void *)buf, 0x00, sizeof(buf)); if(status) nwr = sprintf(buf, "%dn", 1); else nwr = sprintf(buf, "%dn", 0); ret = write(fd, buf, nwr); close(fd); if(ret == nwr) { LOGI("%s : write success (on = %d)", ctl_fp, status); return 0; } else { LOGE("%s : write fail (on = %d)", ctl_fp, status); return -1; } } //---------------------------------------------------------------------------------------------------------------- int wifi_get_module_status(char *ctl_fp) { int fd, ret, nrd; char buf[10]; if((fd = open(ctl_fp, O_RDONLY)) < 0) { LOGE("%s(%s) : Cannot access "%s"", __FILE__, __FUNCTION__, ctl_fp); return -1; // fd open fail } memset((void *)buf, 0x00, sizeof(buf)); nrd = read(fd, buf, sizeof(buf)); close(fd); // read ok if(nrd) { if(!strncmp(buf, "1", 1)) { LOGI("%s : status == 1", ctl_fp); return 1; // wakeup } else { LOGI("%s : status == 0", ctl_fp); return 0; // suspend } } LOGI("%s(%s) : module status == unknown", __FILE__, __FUNCTION__); return -1; } //---------------------------------------------------------------------------------------------------------------- int wifi_module_wakeup_status() { int fd, ret, nrd; char buf[10]; if((fd = open(WIFI_WAKEUP_CTL_FP, O_RDONLY)) < 0) { LOGE("%s(%s) : Cannot access "%s"", __FILE__, __FUNCTION__, WIFI_WAKEUP_CTL_FP); return -1; // fd open fail } memset((void *)buf, 0x00, sizeof(buf)); nrd = read(fd, buf, sizeof(buf)); close(fd); // read ok if(nrd) { if(!strncmp(buf, "1", 1)) { LOGI("%s(%s) : module status == wakeup", __FILE__, __FUNCTION__); return 1; // wakeup } else { LOGI("%s(%s) : module status == suspend", __FILE__, __FUNCTION__); return 0; // suspend } } LOGI("%s(%s) : module status == unknown", __FILE__, __FUNCTION__); return -1; } //---------------------------------------------------------------------------------------------------------------- int wifi_module_wait_time(int waitTime) { LOGI("%s(%s) : module wait time = %d sec", __FILE__, __FUNCTION__, waitTime); sleep(waitTime); sync(); return 0; }

You will have a new libhardware_legacy.so with above modification.

Please note, bcm4329.ko file should be regenerated with "make modules" command of kernel build and copied to ODROID.



6. Let's start build the ICS
chmod u+x device/hardkerenl/odroid7/build_android.sh
device/hardkerenl/odroid7/build_android.sh



7. Install the Android system files and zImage and ramdisk-uboot.img as we do for Gingerbread installation.
http://dev.odroid.com/projects/odroid-t/



Tested features
- LCD driver with 3D accelerator
- Capacitive touch screen
- Sound output
- Sound input (Microphone)
- USB ADB driver
- USB Host HID (Mouse/Keyboard)
- WiFi
- MFC driver for media player
- GPS driver
- Accelerometer sensor
- HOME key function
- Backlight Brightness control
- Battery Gauge / Charger driver

To do list
- Camera
- Bluetooth
- HDMI
- Geo Magnetic Field sensor
- NFC

Update!
Modified DPI for tablet mode (density=120)
Softkey enabled
Enabled Home screen rotation















ODROID-7

Small embedded Linux root file system for ODROID-7/7E
Posted by ODROID on 05 December 2011 at 19:43 pm
ODROID-7¿¡¼­ Å×½ºÆ®µÈ ¸®´ª½º ·çÆ® ÆÄÀÏ ½Ã½ºÅÛÀÔ´Ï´Ù.
ODROID-E7¿¡µµ Àû¿ë °¡´ÉÇÕ´Ï´Ù.
Auto-LoginÀ» ±¸ÇöÇÏ¿©, SDL ¹× °£´ÜÇÑ ¾îÇñîÁö ¸¸µé¾î ¸ðµÎ ÀÚµ¿À¸·Î ½ÇÇàÇÏ´Â ½Ç¿ëÀûÀÎ ¿¹Á¦°¡ µÉ°Í °°½À´Ï´Ù.


How to make a Small embedded Linux root file !

I found a generic embedded root file system with EABI by Googling.
http://ftp.falinux.com/toolchain_ramdisk/recommendation/gcc-4.3.2/
At this moment, this link is broken.


To implement the auto login, I need to cross compile the mingetty in the Sourceforge.
http://sourceforge.net/projects/mingetty/
After compilation, the generated file must be copied in to /bin directory.

Add below line in to /etc/inittab for automatic login as a super user(root)
T0:12345:respawn:/bin/mingetty --autologin=root ttySAC2 115200 vt100


To test this root file system, I copied it to the system partition(mmcblk0p2) of Odroid-7.

And I changed bootargs as below.
For ODROID-7 (S5PC110/EXYNOS-3110)
setenv bootargs 'root=/dev/mmcblk0p2 rw rootfstype=ext4  init=/sbin/init console=ttySAC2,115200 rootdelay=1'
setevn bootcmd 'movi read kernel 30008000;bootm 30008000
'
savenv
For ODROID-E7 (S5P6450 ARM11)
setenv bootargs 'root=/dev/mmcblk0p2 rw rootfstype=ext4  init=/sbin/init console=ttySAC2,115200 rootdelay=1'
setevn bootcmd 'movi read kernel E0008000;bootm E0008000'
savenv

To make a SDL and application software, I followed below sequence.

Toolchain
Sourcery G++ Lite 2010.09-50  (GNUEABI version)
https://sourcery.mentor.com/sgpp/portal/release1600
* Note: EABI version can't compile SDL correctly. Must use the GNUEABI version.


SDL source code
http://www.libsdl.org/download-1.2.php
Source code location on host PC
/home/justin/sdl/SDL-1.2.14 (This is my working directory. It is just an example!)

Compile SDL
export CC=arm-none-linux-gnueabi-gcc
./configure --host=arm-none-linux-gnueabi --prefix=/home/justin/sdl/compiled --without-x
make -j 4
make install
* Note: Modify the SDL-1.2.14/src/video/fbcon/SDL_fbvideo.c
Comment out the mouse related code in FB_VideoInit() function.

Compile sdl test (Modify the SDL init function to 800x480 resolution and 32bit color, if the application uses graphic layer.)
./configure --host=arm-none-linux-gnueabi  --with-sdl-prefix=/home/justin/sdl/compiled --disable-sdltest
make -j 4

Compile Freetype
http://download.savannah.gnu.org/releases/freetype/freetype-2.1.10.tar.gz
./configure --host=arm-none-linux-gnueabi --without-zlib --prefix=/home/justin/sdl/compiled
make -j 4
make install

Compile SDL_ttf to display fonts.
http://www.libsdl.org/projects/SDL_ttf/
SDL_ttf-2.0.10.tar.gz
./configure --host=arm-none-linux-gnueabi --prefix=/home/justin/sdl/compiled --with-freetype-prefix=/home/justin/sdl/compiled --with-sdl-prefix=/home/justin/sdl/compiled

#undef HAVE_ICONV ==> showfont.c  ( Modify this to avoid annoying error. But, this one should be fixed for proper display of 2-byte languages.)
make -j 4
make install
showfont executable file is generated in .lib directory.

SDL_ShowCursor(SDL_DISABLE);  //To hide the mouse cursor !!!

Download and Install font.
http://ftp.gnu.org/gnu/freefont/freefont-ttf-20100919.tar.gz
Uncompress and copy the fonts in to /usr/fonts/ directory.

Let's test.
./showfont -i ../fonts/FreeSerif.ttf 30


To execute this application automatically, add below line in /root/.bashrc !!
/usr/bin/showfont -i /usr/fonts/FreeSerif.ttf 30



Finally we made a simple and useful root file system.
This is very light and fast embedded linux root file system.
Size is 35Mbyte approximately.
Get this root file system from
http://dev.odroid.com/projects/odroid-t/download/note/76



Reference.
http://www.crosscompile.org/static/pages/SDL.html



ODROID-7,ODROID-E7,ODROID-A,ODROID-PC,ODROID-A4

Open Accessory Library test on ODROID-7
Posted by ODROID on 29 June 2011 at 19:27 pm
Open Accessory is a new capability for integrating connected peripherals with applications running on the platform. The capability is based on a USB (Universal Serial Bus) stack built into the platform and an API exposed to applications. Peripherals that attach to Android-powered devices as accessories connect as USB hosts.
This was introduced with Android 3.1 Honeycomb and it is back ported in to Android 2.3.4 Gingerbread.

You can find more information about ADK in this link.
http://developer.android.com/guide/topics/usb/adk.html


Hardkernel recently ported the latest Gingerbread 2.3.4 to ODROID-7 and we've tested the ADK feature with PIC24F based simple board.
Enjoy this video and keep in touch~   We will make a new release for ODROID-7 and ODROID-A soon with this great Open Accessory Library.





Android_Accessory_Kit,ODROID-7

ODROID-7 Gingerbread source code released
Posted by PinkOdroid on 25 April 2011 at 10:43 am




















ODROID-7 Gingerbread source code is released. You can download it from the below link.
http://dev.odroid.com/sigong/nf_file_board/nfile_board.php

Linux Kernel version 2.6.35
Android version 2.3.3 Gingerbread


ODROID-7

Oscilloscope on ODROID-7
Posted by ODROID on 10 March 2011 at 13:38 pm
ODROID-7 has an expansion port of TTA20 connector.
There is an ADC port which is connected to S5PC110 processor.
We are using the ADC port to make a simple oscilloscope.

Please note the ADC sample rate is only 1Mega samples per sec and it causes very low band width.
But, it is still useful to see any moving/static level of signals on GPIO or audio frequency band.

We could grab SINE wave signal as below picture.
IMG_8213.JPG

Hardware structure.
- One OPAMP for signal conditioning (Attenuation as well as makes high input impedance)
- One LDO for power supply of OPAMP
- One LED can be controlled by CPU to display status
- This board can work with Odroid-T as well.
- TP1 is signal input and TP2 is reference(ground).
oscilloscope.jpg
This 20pin TTA connector can be attached to ODROID-7 directly or through debug board.

Schematics of OSC board.
scope_sch2.png



Software structure.
- Modified ADC device driver in Kernel
- JNI parts for inter-connection with Java (We call it NDK from time to time)
- Java application to display signals.

s_scope_wave2.png

What to do....  (Future improvement)
- Trigger function
- Zoom In/Out with multi-touch pinch input
- Better Horizontal/Vertical scaling
- Math lib for FFT/DCT


We will open the source code within couple of weeks.
I think this is a very nice example to learn how real embedded system can run with Android OS.
It also can be a good text book/reference for beginners.

Thanks,



ODROID-7