Archive for October, 2012

October 30, 2012   Posted by: Dr. Ace Jeangle

Android Jelly Bean running on Pandaboard (ES)

Linaro team made a huge step forward towards an automated kernel and full Android builds. Below are these simple steps I did to get Android JB running on my Pandaboard ES with LG 10″ with touchscreen. Compare it to our old How-to: https://www.chalk-elec.com/?p=1426 and feel the difference 🙂

  1. Go to http://releases.linaro.org/12.10/android/leb-panda/ and proceed with “Binary Image Installation” steps. Windows users can get file pandaboard.img.bz2, unzip it and write to SD card with Windows32DiskImager utility.
  2. Update boot.scr file in boot partition of SD card with correct LCD resolution (1280×800 for LG panel). Ready boot.scr file is here: boot.scr
  3. After step 2 you should get LCD working. You will see Android GUI and can use mouse. Adding touchscreen requires some kernel re-build.
  4. Download file linaro_kernel_build_cmds.sh to your Linux computer, change its attribute (+x) and run it. It will automatically download and re-build kernel for Android. Final kernel is located in ./linaro-kernel/out/arch/arm/boot folder (file uImage)
  5. Now you should update kernel config to include touchscreen support and re-build kernel again. Find file .config in ./linaro-kernel/out folder and uncomment/add options CONFIG_HID_MULTITOUCH=y and CONFIG_HID_NTRIG=y – first option is for old AUO panel, second is for new LG panel. You can add both just in case 🙂
  6. Comment line “mkdir out/modules_for_android” in script linaro_kernel_build_cmds.sh and run it again. Copy final uImage file to boot partition of your SD card. You can also skip these steps and get my final uImage here: uImage
  7. Last step is to configure touchscreen as an internal device to fit with LCD panel size. Download file Vendor_1b96_Product_0007.idc and put it to folder /usr/idc on system partition of SD card.

Final SD card image (4Gb card) is here: Android 4.1.2 for Pandaboard(ES)

Video in action is here: Android Jelly Bean (4.1.2) running on Pandaboard ES with touchscreen LCD

23 comments posted in: How-To
October 9, 2012   Posted by: Dr. Ace Jeangle

How to build kernel for Beaglebone for custom cape support

In this How-to we will try to build kernel for Beaglebone that will support our LVDS cape.

Download and install all required sources:

sudo apt-get install gcc-arm-linux-gnueabi git ccache libncurses5-dev u-boot-tools lzma
cd ~
git clone git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git
git clone git://github.com/RobertCNelson/linux-dev.git
cd linux-dev
git checkout origin/am33x-v3.2 -b am33x-v3.2
cp system.sh.sample system.sh

Then make the following changes in system.sh:
– uncomment line CC=arm-linux-gnueabi-
– uncomment line LINUX_GIT=~/linux-stable/
– uncomment line ZRELADDR=0x80008000
– uncomment line BUILD_UIMAGE=1
– uncomment and change line MMC=/dev/sde to your SD card system name (mine is /dev/sdb)

Next commands:

./build_kernel.sh

will bring you directly to kernel config GUI, and then will assemble it.

After kernel is compiled, please make changes to file ~/linux-dev/KERNEL/arch/arm/mach-omap2/board-am335xevm.c (see below), then recompile kernel again (command “tools/rebuild.sh”). Once the build had completed there will be a uImage file in ~/linux-dev/deploy. You can install this to your SD card with:

./tools/load_uImage.sh

Built kernel modules are located in ~/linux-dev/deploy/mod/lib

To add support for our LVDS cape you need to patch file board-am335xevm.c located in /kernel/arch/arm/mach-omap2. You should find function beaglebone_cape_setup(struct
memory_accessor *mem_acc, void *context)
in this file and change it to always invoke function dvi_init(0,0). The easiest way is to put
the following lines:

pr_info("BeagleBone cape: initializing DVI cape\n");
dvi_init(0,0);
return;

at the beginning of function.

19 comments posted in: How-To
October 4, 2012   Posted by: Dr. Ace Jeangle

How to get touchscreen working

Some Linux distros come with these drivers included in kernel, others not. If you can’t use touchscreen after Linux is running in X GUI mode or if you don’t have assigned input device in console mode, then you should do the following:

  1. First of all, check all connections. We had many cases when customers forgot or incorrectly connected touchscreen to miniUSB add-on board.
  2. Connect just touchscreen through USB cable to normal PC running Windows. If touchscreen is detected and you can use it in Windows, then all connections are OK and you can proceed further.
  3. If your Linux kernel does not include drivers for touchscreen, then you should recompile kernel with the following options:
    • for AUO LCD (1024×600 px): “Device Drivers –> HID Devices –> Special HID drivers –> HID Multitouch panels“, option name: CONFIG_HID_MULTITOUCH, available in mainline kernel since version 2.6.38
    • for LG LCD (1280×800 px, black frame): “Device Drivers –> HID Devices –> Special HID drivers –> N-Trig touchscreens“, option name: CONFIG_HID_NTRIG, available in mainline kernel since version 2.6.31
  4. If you run Android, then you can encounter problem with non-correct touchscreen vs screen resolution. This happen because Android supposes default screen resolution for external LCD as 720p or 1080p (touchscreen is connected by USB and is considered as external device), but our LCD is 1024×600 or 1280×800. You can easy check it by simply turning on option “Show touches” in Settings->Developer options of Android. Then you will notice the difference in real position of touch and Android touch position. This can be easy improved by placing one of below files to /system/usr/idc folder of Android rootfs. After that touchscreen size and LCD size will match.
    File for Ntrig touchscreen (1280×800, black frame)
    File for Cando touchscreen (1024×600)

    See below links for additional information on touchscreen devices functionality under Android:
    Touch devices in Android
    Input device configuration files
  5. You can use console command getevent (sources for Linux are here: getevent.zip) to check what touchscreen returns when you touch it. Also, you can get more details about touchscreen and its modes with commands getevent -p and getevent -i.
  6. N-trig touchscreen can be tuned with some parameters:
    • min_width – minimum touch contact width to accept
    • min_height – minimum touch contact height to accept
    • activate_slack – number of touch frames to ignore at the start of touch input
    • deactivate_slack – number of empty frames to ignore before deactivating touch
    • activation_width – width threshold to immediately start processing touch events
    • activation_height – height threshold to immediately start processing touch events

    They can be changed right from console, see here for details: http://baruch.siach.name/blog/posts/linux_kernel_module_parameters/

  7. If you have problems with touchscreen, like “crazy” cursor jumps or “phantom” mouse clicks, then try to follow this guide How to calibrate N-Trig touchscreen
  8. Still no success? Drop e-mail to support@chalk-elec.com and provide description of problem + photo of your LCD touch connection + output of commands “lsusb” and “dmesg” entered in Linux console.
11 comments posted in: blog   |   How-To
Follow us