I have been playing for sometime with the FriendlyARM mini2440 development board and trying out Android on it with various touchscreens at various resolutions. However, my application demanded a 12.1″ screen and all I was doing was just fooling around with the 3.5″ screen. This post will clear up some doubts (or probably add more confusion in this regard), but it surely would get you an ‘awe’ feel. This is also not meant to be a tutorial, but intermediate level embedded guys would love to burn their boards upon reading this for sure🙂
Note : Android performance on mini2440 is actually very poor. the touchscreen is still not calibrated, but I’m working on it. Also, the kernel and the rootFS have been modded to some extent (not by me of course)
Things you should have :
- FriendlyARM mini2440 of course
- 12.1″ screen, make : Sharp
- All the necessary cabling : USB, Serial etc.
- A Fedora/Ubuntu box
- A net connection
- 375ml of breezer (or a cup of coffee for the nocturnals), earplugs and patience🙂
Things you should get :
The kernel source you downloaded has a display configured for the 3.5″ default screen. We shall be adding a new module to the Kernel and making changes to some source files to get our 12.1″ screen working perfectly.
 Making a new Module : In the kernel source open the file drivers/video/Kconfig and staring from line 1920, replace
#config FB_S3C2410_TFT800480 #boolean "7 inch 800x480 TFT LCD" #depends on FB_S3C2410 #help #7 inch 800x480 TFT LCD
config FB_S3C2410_TFT800600 boolean "12 inch 800x600 TFT LCD" depends on FB_S3C2410 help 12 inch 800x600 TFT LCD
 Now, the driver for touchscreen is located at drivers/input/touchscreen/s3c2410_ts.c Here, the original resolution is 320×240 and we have to modify it to 800×600. Add the following after line 19
#ifdef CONFIG_FB_S3C2410_TFT800600 #define SCREEN_X 800 #define SCREEN_Y 600 #else #define SCREEN_X 240 #define SCREEN_Y 320 #endif
Modify as follows after line 99,
//disX = disX * 1024 / 240; //disY = disY * 1024 / 320; disX = SCREEN_X - disX; disX = disX * 1024 / SCREEN_X; disY = disY * 1024 / SCREEN_Y;
 Some more modding is required for front and back porch settings of LCD. It varies for different LCD vendors. Refer the LCD datasheet for your reference. Considering my Sharp LCD, you can try it out on your’s too, modify the file arch/arm/mach-s3c2440/mach-mini2440.c in your kernel source as follows
#elif defined(CONFIG_FB_S3C2410_TFT800600) #define LCD_WIDTH 800 #define LCD_HEIGHT 600 #define LCD_PIXCLOCK 40000 #define LCD_RIGHT_MARGIN 120 #define LCD_LEFT_MARGIN 40 #define LCD_HSYNC_LEN 60 #define LCD_UPPER_MARGIN 25 #define LCD_LOWER_MARGIN 20 #define LCD_VSYNC_LEN 1
Play with the right,left,upper and lower margins till you get the perfect display once compilation is over.
Save the .config file when asked to do so. Now,
cp config_mini2440 .config make menuconfig
Now select Device Drives -> Graphic support -> Support for frame buffer devices -> S3C2410 LCD framebuffer support -> [x] 12 inch 800×600 TFT LCD
Assuming that the Cross Compiler is set and the PATH variable knows about it, bake the kernel by doing
The kernel can then be found at arch/arm/boot/zImage Viola! the kernel is ready!
Android Filesystem Modifications
Creating the console file. Untar the Android FS and do,
cd fs/dev sudo mknod console c 5 1
Pointer Callibration file (WARNING : GREY AREA)
cd fs/system/etc/shine echo "134 57734 -3147464 -40090 1465 35070384 65536" > pointercal
Now I have been unsuccessful in this stuff till now. Actually, the pointercal stores the calibration values for touchscreen which is automatically generated once the ts_calibrate utility runs. unfortunately, I haven’t got a clear idea on how tslib works yet.
Creating Android Filesystem Image
Untar the mkyaffs2image-128M binary to /usr/sbin or any other place of your choice. Considering the directory ‘fs’ stores your modified FS,
mkyaffs2image-128M fs 12inch_android.img
So now, you have the kernel zImage and the 12inch_android.img file system ready for you. Start the board in NOR mode and write the kernel and Android FS to the board after formatting the NAND Flash. Connect the USB and use the s3c2410_boot_USB tool (after compiling the tool itself for your host, of course) Then,
After the transfer is complete, (it gives some error, ignore it),
Boot the board in NAND mode after the transfer is complete. Thats all. I’m sharing some pics of my trials. Feel free to suggest and/or educate me or for any other queries.