Embedded, Linux

Modding Android for mini2440 & 12″ Screen

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 :

Kernel Mod

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.

[1] 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

with

config FB_S3C2410_TFT800600
boolean "12 inch 800x600 TFT LCD"
depends on FB_S3C2410
help
12 inch 800x600 TFT LCD

[2] 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;

[3] 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.

Kernel Compilation

make menuconfig

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

make

The kernel can then be found at arch/arm/boot/zImage Viola! the kernel is ready!

Android Filesystem Modifications

[1]Creating the console file. Untar the Android FS and do,

cd fs/dev
sudo mknod console c 5 1

[2]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,

./s3c2410_boot_usb zImage

After the transfer is complete, (it gives some error, ignore it),

./s3c2410_boot_usb 12inch_android.img

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.

Android on mini2440+12"

Android on mini2440+12"

Android on mini2440+12"

Android on mini2440+12"

Standard

17 thoughts on “Modding Android for mini2440 & 12″ Screen

  1. kapil pilankar says:

    Hi,
    Is there any way of increasing the resolution from 800×600 to something like 1024×768, using the same FriendlyArm 2440 board?

    Thanks,
    Kapil

    • 1024×768 can be supported by kernel but I am already skeptical about how it will perform with Android + LCD, as its already too slow on 800×600. Try it out and do share your trials. However a version of mini has a VGA daughter board which supports 1024×768 and I have tested it with Qtopia as rootfs.

  2. rolf says:

    great stuff, I was just checking about how to connect a 12 inch IBM PN07K9700 lcd display that has a touchscreen. Do you have any details about the mini2440lcd interface and could you share the reference of your sharp display ?

  3. Deepesh says:

    Hi Suchakra,

    excellent post. There is such powerful hardware out there at an attractive price point to the serious hobbyist. By adding such amazing display capability to low cost SBC’s you have fit a an important piece in the puzzle. This combo has a lot of potential applications.

    I am curious to know how is the performance of UI with the 12′ display and whether a faster processor (say beagleboard) would make things better.
    Also, did you source the panel locally ? if yes would appreciate details (contact/specs/price).

    keep up the good work.

    cheers,
    Deepesh.

  4. siva says:

    Hi Suchakra,
    I had a W35i panel on my mini2440 and the default configuration didnt support that panel either. I followed the procedure listed by a French developer to get it working using the same technique as you had indicated.

    Can you share what is the sharp panel you are using? I want to try that out next on them mini.
    Thanks
    siva

  5. Bhagavan says:

    Hi Chakra,

    Thank you very much for posting such a nice post. It was very good experience to watch mini2440 with Android.

    Do you have any idea, where can I get the latest Android (version 3 or later) to load on to Mini2440. Basically I need to run Mplayer on to Mini2440

    regards
    Bhagavan

    • Hi Bhagavan,
      As I had pointed out before too, Android on mini2440 is not at all good. I doubt if anyone else has followed up with porting anything above Android 1.6 Also, why do you need Android to get Mplayer running on your system? Mplayer is an open source project and may be ported to ARM too if you wish to do that. Some people have already tried that out to I suppose (still, there are issues related to ALSA it seems) See http://lists.mplayerhq.hu/pipermail/mplayer-users/2011-March/082255.html
      Also, search for other lightweight video players which may be ported for mini2440 too (if you are planing to make an AV application)

      • Bhagavan says:

        Hi Suchakra,

        I am sorry I misspelled your name in my last post.

        What is the development board you suggest to work on Android?

        Is it Ok, to share your email ID? I have few more questions to ask. My ID is ‘bhagavansprasad’ in google mail account.

        regards
        Bhagavan

    • I guess, its all standard Android now. I haven’t tried it yet, but if you have got the device instance (check by connecting through USB and try ‘adb devices’) Just install the apk using ‘adb install ‘

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s