I recently purchased a 7″ touchscreen for my Raspberry Pi.

>mount /dev/mmcblk0p1 /fat32/

>nano /fat32/config.txt


 Now that the screen displays correctly, time to get the touchscreen to work!

Attach the controller to the RPi and check that it sees the screen, you’re looking for an eGalax entry:

$ lsusb
Bus 001 Device 005: ID 0eef:0001 D-WAV Scientific Co., Ltd eGalax TouchScreen

$ cd ~
$ mkdir src
$ cd src

Get the kernel sources:

$ wget
$ tar -zxvf rpi-3.12.y.tar.gz
$ cd linux-rpi-3.12.y

Install dependencies:

$ sudo apt-get install git libncurses5 libncurses5-dev qt4-dev-tools build-essential

Install toolchain:

$ sudo apt-get install gcc-arm-linux-gnueabihf

Make sure the source objects are clean:

$ make mrproper

Create a folder for the generated kernel:

$ mkdir ../kernel

Genereate the .config file:

$ make O=../kernel/ ARCH=arm CROSS_COMPILE=/usr/bin/arm-linux-gnueabihf- bcmrpi_cutdown_defconfig

Configure the kernel:

$ make O=../kernel/ ARCH=arm CROSS_COMPILE=/usr/bin/arm-linux-gnueabihf- menuconfig

Navigate to Device Drivers -> Input Device Support -> Touch Screens and select it. Go to USB Touchscreen Driver select it. Go to “eGalax, eTurboTouch CT-410/510/700 device support” and select it. Exit all the way and save the file when prompted.

Compile the kernel:
$ make O=../kernel/ ARCH=arm CROSS_COMPILE=/usr/bin/arm-linux-gnueabihf- -k -j3

The -j3 option enables parallel build. The number should be the number of cores (of the machine where you’re compiling) +1.

The build took about 10 minutes on my pc. When the build completes, you will have the new kernel in ../kernel created above.

Create the kernel image:

$ cd ../
$ git clone git://

$ cd ~/src/tools/mkimage
$ ./ ../../kernel/arch/arm/boot/Image

Build the modules

$ cd ../../kernel
$ mkdir ../modules
$ make modules_install ARCH=arm CROSS_COMPILE=/usr/bin/arm-linux-gnueabihf- INSTALL_MOD_PATH=../modules/

To replace the kernel, get the latest firmware:

$ wget
$ tar -zxvf next.tar.gz

In the small partition of the SD card (/boot):
– replace the /boot/bootcode.bin in the SD card with ~/src/kernel/firmware-next/boot/bootcode.bin
– replace the /boot/kernel.img in the SD card with ~/src/tools/mkimage/kernel.img
– replace the /boot/start.elf in the SD card with ~/src/kernel/firmware-next/boot/start.elf

In the big partition of the SD card (/root):
– replace the /lib/firmware in the SD card with ~/src/modules/lib/firmware
– replace the /lib/modules in the SD card with ~/src/modules/lib/modules
– replace the /opt/vc in the SD card with ~/src/kernel/firmware-next/hardfp/opt/vc

Now your SD card contains the new image. Safely eject the SD card, plug the touch controller to your RPi, boot it with the SD card, run startx, and check that you can move the cursor.

Once I was in the desktop, my touch input was working but it needed to be calibrated.

To calibrate, you need to install an X input calibrator and some dependencies:

$ sudo apt-get install libx11-dev libxext-dev libxi-dev x11proto-input-dev
$ cd ~
$ wget
$ tar -zxvf xinput_calibrator-0.7.5.tar.gz
$ cd configure
$ make
$ sudo make install
$ xinput_calibrator

Follow the instructions on the screen. After calibration you should see something like this:

Calibrating EVDEV driver for “eGalax Inc. USB TouchController” id=8
current calibration values (from XInput): min_x=1938, max_x=114 and min_y=1745, max_y=341

Doing dynamic recalibration:
Setting new calibration data: 121, 1917, 317, 1741

–> Making the calibration permanent <–
copy the snippet below into ‘/etc/X11/xorg.conf.d/99-calibration.conf’
Section “InputClass”
Identifier “calibration”
MatchProduct “eGalax Inc. USB TouchController”
Option “Calibration” “121 1917 317 1741”
Option “SwapAxes” “1”

For Raspbian, you have to create the file:

$ sudo nano /usr/share/X11/xorg.conf.d/01-input.conf

Add in this file the content above, starting with Section “InputClass” line and save the file.

Note: Make sure that you don’t have sections like MatchProduct “eGalax Inc. USB TouchController” in other files from /usr/share/X11/xorg.conf.d/ folder (highest number files are processed last).

Now touchscreen should be calibrated and after reboot it will keep the settings. Yolu can run xinput_calibration again in order to have the pointer to the desired points. You can update the numbers given by the xinput_calibration utility in the usr/share/X11/xorg.conf.d/01-input.conf file in order to have the best calibration at boot.