Hardware Technology

Lessons learned about the A13 OLinuXino with A13-LCD7-TS

I have recently purchased two of those very sweet Olinuxino A13 boards for a new project I’m working on. I bought them directly from Olimex in Bulgaria, only to later discover that I could have ordered them from another website in the US. The prices are a bit higher, but shipping is lower so for small quantities it might work better.

I also bought two LCD Touch screens, two MOD-RS232, and some other boards that I plan to experiment with further down the road (for example to control higher voltage relays).

What this guide contains

In this guide I will show you:

  1. What hardware to purchase for your development kit
  2. How to build your own custom Linux Kernel
  3. How to build a bootable SD Card with Debian Wheezy
  4. How to get X11 working on the A13-LCD7-TS with Debian
  5. How to get the Touch Screen to work with X11
  6. How to start a locked-down, full screen web browser

By the end of this guide, you will hopefully learn how all the components work together, and as an added benefit you will also get a fully working development system that allows you to comfortably start working on your product, based on a very solid platform, with stable, reliable, and reproducible results. I believe learning is more important than doing, and this is why I’m making this guide as detailed as possible.

Another important aspect is the comments to this post, which come from pretty smart people who tried all this out, and had really important feedback. Without this feedback, this guide would certainly be lacking. I would like to thank all of you for taking the time to give feedback so that others may have a better configuration with their systems.

My initial impression

I was initially trying to purchase a Raspberry Pi, but supplies being non-existent I was forced to look for alternatives, and I’m very glad I did because the end result is that I have a more powerful platform to work with. It’s faster, has 3 USB ports with tons of gpio pins, has an on-board nand chip, wifi adapter, sd card reader, audio in/out, and the pretty useful UEXT connector. It runs very cool, and since there are no moving parts or fans it is naturally silent.

In addition to this specific product being quite amazing, feature wise, Olimex has a very talented team of engineers who crank out new boards and designs at a pace rarely seen. They are already working on an A10 board, which packs even more impressive hardware and features. Once in a while they even find the time to write a new guide or how-to, and post it on their blog.

Apart from the Olimex engineers who are obviously dedicated to their cause, there’s a good number of individuals working on the “ARM Netbook” project. The Olimex and ARM engineers, as well as the community of users, all hang out on the Freenode IRC Network, on channels #olimex and #arm-netbook (If you have an IRC client you can click those links to directly join the rooms). I strongly urge you to join those chat rooms if you have questions, or if you feel you can help others with your skills and knowledge.

And if this is not enough to convince you, consider this: All Olimex products are 100% open source hardware, which includes the CAD files for the boards, routing, etc. You can truly do whatever you want with the designs, and all the designs are fully available and downloadable from their github account. This is not the case with the Raspberry Pi where some parts are closed with strange excuses given by project members.

Important adjustment of expectations

I think that for a short while I was under the illusion that things will just work great out of the box. I was quickly disillusioned however, because the problems piled up and some of them proved quite a challenge initially. Thankfully, the Olimex hardware has quite a following; a mix of hardware enthusiasts as well as commercial entities purchasing the boards to include in their embedded linux projects. They all socialize and help each other on the Olimex forums.

On the other hand, the issues I encountered are all software related, and platform specific. This means that with some reasonable effort and enough reading, they can all be solved. I solved my issues within a week, and I am now very pleased with the results. I am by no means done – As of this moment, I still have a segmentation fault with the touchscreen driver, but I’m sure I will have this issue resolved within the next 24 hours.

So what I learned is something I should have known right from the start: This is not a mass market product. It is a very new product (May 2012!), and this means whoever utilizes this platform is pretty much on the bleeding edge of open source hardware technologies, and this is not without implications. On the other hand, this is what makes it fun. Reading data sheets, really understanding how the board functions, what components are on the board and why they were chosen, what each pin does in the various on-board connectors, and so on and so forth. This is a platform that forces you to take off your shirt and dive into unknown waters, but you get to swim with some pretty cool fish!

Simple challenges during my first order

No Power Supply: While ordering the boards, I needed to purchase power supplies separately. Olimex does not sell power supplies for America. A quick search on Amazon based on the power rating, polarity, and dimensions of the connector, and I found a pretty good power supply on Amazon. It arrived within a few days and I was able to power the boards.

No LCD Cable: This is when I realized the LCD comes without the cable that connects it to the board. Fortunately Olimex support (Tsvetan) replied that the cables are the same as IDE cables. Again Amazon to the rescue, and within 2 days I had two cables and the LCD was hooked up to the board. At this point I was able to boot the system, which comes preloaded with Android.

Wrong Screen Resolution: When Android booted I noticed the entire screen is offset some 20% to the right and some 10% to the bottom. The touch screen however was properly calibrated, so I had to touch the icons in the area where I thought they should be. This is pretty easy to resolve, as I found out later, but not from Linux or Mac. You need to install a program called LiveSuit on Windows. A port of LiveSuite for Linux exists, but it does not recognize the Android IMG file. I tell this to you now, but it took many days of trying and failing and talking to people online until I received a final confirmation that it only works on Windows, because of people at Allwinner, the company that produced the SOC (Systen On Chip).

Bad USB to Serial Strategy: I had a PL2303 at home, so I didn’t buy the USB to Serial cable sold by Olimex. This was a mistake because the one I had did not work very well. I should have just purchased it but I didn’t think I would need it. It ended up being very important, because it helps you login to the console and configure the OS to connect to the network, for example, or to see the output from u-boot while the system is booting. It’s just a good idea to have console access.

Which brings me to the next section for any person considering buying Olimex products, or any products in general since this does not apply only to Olimex but to any hardware project.

What to buy as a starter kit

I feel I have learned quite a lot about the platform because of all the mistakes I made and all the obstacles I encountered, so I am thankful that I made those mistakes. However if you are in a hurry to create a commercial product based on this platform, you will avoid all the mistakes I made by simply buying the correct products for your kit.

This is my recommended list of materials for any person trying to develop on this platform for the first time:

  • From the Olinuxino A13 category:
    • One of the Olinuxino Boards (based on whether you need 1 or 3 usb ports, wifi or no wifi, 512mb RAM or 256mb RAM on the Micro version, etc). I purchased the most expensive one A13-OLinuXino-WIFI
    • One of the LCD products, without the touchscreen A13-LCD7 or with a touchscreen A13-LCD7-TS (that’s the one I have). I like having the LCD because it’s cheap enough and will not take away one of your monitors while you work with your kit. The size is perfect for development purposes and the resolution is high enough (800×480) which makes the fonts quite sharp and readable.
    • One of the SD cards (A13-OLinuXino-MICRO-SD or A13-OLinuXino-SD), it comes preloaded with Debian Linux (Wheezy), and will save you a lot of time and efforts (and most of the mistakes I made).
  • If you are getting an LCD, get this cable: CABLE-IDC40-15cm
  • Get the following cables for sure:
  • If you live in Europe or a country with European power sockets and voltage, definitely get this power supply: SY0612E
  • If you plan on using an off the shelf USB to Serial cable with a DB9 connector, definitely get this UEXT adapter: MOD-RS232

Lessons about building and booting a Debian SD Card

The main lesson here is that if you want to be up and running as soon as possible, that you should not even focus on trying to build the Debian image yourself. Olimex sell you the SD Card with the Debian image already pre-built for you.

On the other hand, I do feel it is a great learning experience. And more importantly, I believe that if you are serious about the product you are building, you have to learn how the parts all fit together. Building your own Debian image is a great way to learn about that.

Remember how I said in the beginning that this is all very fresh technology? Some of the options I’m going to show you here, were only just committed into the Github repository of the sunxi-bsp project by techn_ from IRC.

Before we start – Installing Prerequisites

It’s important to have a correct system time, or you will get warnings about some dates being in the future. While we’re at it, let’s also install git, the compilers and other utilities required to build our packages:

# Install compilers and related utilities
apt-get install build-essential git automake autoconf libtool ntpdate pkg-config

# Let's make sure our system time is correct

If you connect to your A13 over SSH (Like I do, which is way more convenient than working on the A13 directly), then it is quite possible the network will disconnect after you update the system time. I’m not exactly sure why this happens (I have some theories), but if you find yourself disconnected from your A13 after you update the system time, don’t panic, and don’t reboot your A13. Just connect to the console as root and type:

/etc/init.d/networking restart
/etc/init.d/ssh restart

That’s it, your A13 will now be available again via SSH.

Quick start guide – Building the Kernel

Fortunately for us, this task has been made infinitely simpler by the good guys on #arm-netbook via the sunxi-bsp project, which is an umbrella project, as well as a set of scripts, designed to bring everything you need in order to build the kernel, u-boot, and the script.bin file, as well as tools that help you hack around with the AllWinner hardware.

# Let's fetch the sunxi-bsp project into /usr/src:
cd /usr/src/
git clone git://

# Now we configure it for the A13 Olinuxino:
cd sunxi-bsp
./configure a13_olinuxino

# This time, make will build everything!

Once this is done, you’ll have the kernel, as well as the modules and u-boot under the /build/ directory. You now have the latest supported kernel (At the moment 3.0.52).

Important step: Enabling sun4i-gpio

If you own the A13-LCD7-TS hardware, you will notice it doesn’t power on under Debian. It took me a while to figure out the reason behind this. Turns out the backlight is powered by pin 15 of the GPIO port to which the LCD is hooked up. Android has a PWM (Pulse Width Modulation) component that pulses this pin in various frequencies, to give you different levels of brightness.

Since Debian does not have a PWM module, all we can do is power the pin, and the display will always be stuck on maximum brightness. That’s fine by me anyway.

To set that pin to the On mode, we need two things:

  1. Enable GPIO in script.bin, set pin 15 to be On by default, and update that file in your boot partition (same place where uImage is).
  2. When Debian loads, we need to load the sun4i-gpio module, so that the settings will actually be in effect. But first we’ll need to build it with the kernel, since it’s not enabled by default.

Let’s enable the GPIO Kernel modules:

cd /usr/src/sunxi-bsp/
make linux-config

This will get you into the standard “menuconfig” option, except it will edit the correct .config for your setup (in our case: a13_defconfig). Navigate to Device Drivers —> Misc Devices and enable the following features as Module <M>:

<M> An ugly sun4i gpio driver
<M> Sunxi platform register debug driver

Exit back and save the settings, then run make again:


This time, make sure you see sun4i-gpio.ko in the list of generated modules. If you see it there, you have enabled the correct modules.

A word of caution about the Paranoid Android…

During my trial and errors with trying to activate the LCD, I experimented with a pre-built kernel that I extracted from the built-in Android OS that came with the A13. The theory was that it might have a PWM module to power the LCD.

It booted the OS just fine, but I discovered that non-root users did not have permission to create Network File Descriptors. Through some more research on google, I discovered this is a Kernel config flag called CONFIG_ANDROID_PARANOID_NETWORK. If enabled, the kernel will require users to be on a group with gid 3003 to be allowed network access, and that’s just one of the restrictions. This broke the xf86-input-tslib module with a segmentation fault.

So my warning to you is: Do not enable CONFIG_ANDROID_PARANOID_NETWORK unless you are prepared to deal with the implications (making code modifications in several modules, and configuring the system very carefully).

Preparing the bootable Debian SD Card

Coming soon. In the mean time, consult this guide on the A13 Olinuxino Wiki Page

In fact, that page contains ready made images, along with various tools that will help you tweak the script.bin file to your hardware configuration (VGA vs. LCD for example).

Building tslib and xf86-input-tslib

In order to support the A13-LCD7-TS we have to use a patched tslib and xf86-input-tslib. The way I understand the patches, they are designed to work around the multi-touch limitation in the hardware.

1. First download the 3 patch files from this github directory and place them in /usr/src/

2. Perform the steps below to patch, compile and install tslib in your system:

cd /usr/src
git clone
cd tslib
patch -p1 < ../tslib.patch
autoreconf -vi
./configure --prefix=/usr/local
make install

At this stage, tslib will be installed on your system, and by running ldconfig we make sure that the libraries can be accessible immediately. Note that if you installed the libraries into a non-standard location, you should make sure to add that path to /etc/ and then run ldconfig again. To find out the touchscreen device number run “dmesg | grep sun4i-ts“. Sample output below:

[email protected]:/usr/src/tslib# dmesg | grep sun4i-ts
[ 15.540000] sun4i-ts.c: sun4i_ts_init: start ...
[ 15.560000] sun4i-ts: tp_screen_size is 5 inch.
[ 15.560000] sun4i-ts: tp_regidity_level is 5.
[ 15.570000] sun4i-ts: tp_press_threshold_enable is 0.
[ 15.580000] sun4i-ts: rtp_sensitive_level is 15.
[ 15.590000] sun4i-ts: rtp_exchange_x_y_flag is 0.
[ 15.600000] sun4i-ts.c: sun4i_ts_probe: start...
[ 15.620000] input: sun4i-ts as /devices/platform/sun4i-ts/input/input1
[ 15.640000] sun4i-ts.c: sun4i_ts_probe: end

As we can see in the output above (on my system), the device number is input 1.

To run ts_test and ts_calibrate, as well as run X11 with tslib support, we need to export the following environment variables:

export TSLIB_FBDEVICE=/dev/fb0
export TSLIB_TSDEVICE=/dev/input/event1
export TSLIB_CALIBFILE=/etc/pointercal
export TSLIB_CONFFILE=/etc/ts.conf
export TSLIB_PLUGINDIR=/usr/local/lib/ts

Note that in the TSLIB_TSDEVICE environment variable, the “event1” part corresponds to the “input1” device that we saw earlier. If your device is on “input4” then you should replace “event1” with “event4“.

I have placed this block of exports in /etc/environment so they are all set on system boot. I also erased /etc/pointercal and reran ts_calibrate to re-generate that file. ts_calibrate will guide you through the calibration process, and when done it will write the new values into /etc/pointercal. You can then run ts_test to make sure you are happy with the calibration. ts_test will allow you to draw on the screen, or drag a small block around, which is great because it gives you a good feel for the accuracy and responsiveness of the touch screen.

By the way, one small “visual bug” I noticed is that ts_calibrate and ts_test do not clear the screen when they exit, but don’t worry about that.

3. Perform the steps below to patch and compile the xf86-xorg-tslib module:

# Let's get some X11 dependencies first
apt-get install xorg-dev xserver-xorg-dev x11proto-core-dev

# Now we fetch the module's source code and unpack it:
cd /usr/src
tar zxfv xf86-input-tslib_0.0.6.orig.tar.gz
cd xf86-input-tslib-0.0.6/

# Apply the patches
patch -p1 < ../1-xf86tslib-sigfault.patch
patch -p1 < ../xf86-input-tslib-port-ABI-12-r48.patch

# Finally, let's get this thing built and installed
./configure –prefix=/usr
make install

Now that we have the module compiled and installed, we need to tell X11 about the new device. We’ll do this by creating a new file under /usr/share/X11/xorg.conf.d/. I chose to call this file: 20-touchscreen.conf.

Here’s what my file looks like:

Section "InputClass"
        Identifier "Sun4iTouchscreen"
        Option "Device" "/dev/input/event1"
        Driver "tslib"
	Option "ScreenNumber" "0"
	Option "Rotate" "NONE"
	Option "Width" "800"
	Option "Height" "480"
	Option "SendCoreEvents" "yes"
	Option "Type" "touchscreen"

At this point you are ready to start X. Let’s start it with in Verbose mode so you can see the logging on screen:

X -verbose

If you did everything right, you should see a mouse cursor on the screen, and you should be able to properly click on screen items and even drag scroll bars to scroll around. Congratulations!

51 replies on “Lessons learned about the A13 OLinuXino with A13-LCD7-TS”

Big thanks for your blog !
I’ve already read your comment on olimex forum.
When your image with touchScreen support will be ready i will immediatly try it…because as you said earlier, it will save to me a lot of time !

So… see you soon

hi, i’ve followed all the instructions here to get lubuntu 12.04 working on a 7″ tablet. ts_calibrate and ts_test works fine, xorg detects the touch device (sun4i-ts), but it doesn’t work. Did you know what can it be?

Saying “it doesn’t work” is a little bit too vague. Can you be a bit more specific about what doesn’t work?
When you start X, do you see graphics on the display?
Did you erase /etc/pointercal before you ran ts_calibrate?

Sorry, i forgot to mention more details: Lubuntu boots ok, graphics work, if i attach a keyboard i can login and work normally. If i open lxterminal, ts_calibrate and ts_test works ok. I also deleted /etc/pointercal and calibrated the touch.
xinput shows a sun4i-ts device and inside Xorg.0.log shows that the device has been recognized with the driver “tslib” assigned.
I’ve added the Section “InputClass”…inside a file named 50-tslib.conf, because if i add in 20-touchscreen.conf, xorg doesn’t detect it.
So i assume that if ts_test works fine, the touch is working and has been calibrated. I think that there’s something in xorg-tslib that has not been properly configurated, that’s why i was asking how i can do some kind of debug.
Thanks for your answer!

In the shell, just before running X, make sure you paste this:

export TSLIB_FBDEVICE=/dev/fb0
export TSLIB_TSDEVICE=/dev/input/event1
export TSLIB_CALIBFILE=/etc/pointercal
export TSLIB_CONFFILE=/etc/ts.conf
export TSLIB_PLUGINDIR=/usr/local/lib/ts

Make sure the /dev/input/event1 corresponds to your correct touchscreen device.

If you put this in a shell script, say /root/ then just running that script is not going to work. You need to run it like this:

[email protected]:/root# . /root/

That’s a dot, then a space, then the path to the script where you put your exports.
This will run it in the “local shell” context, so the exports will exist.

Let me know if this helps somehow.

i’ve added that into /etc/environment and the command env shows that all the exports were loaded.
My device is input0, i’ve looked with dmesg | grep sun4i-ts. Just remember that ts_calibrate and ts_test works ok, so the input device must be right.
I’m searching about more info on tslib and xorg, maybe looking into the source of xorg-input-tslib i can find more answers…

thank you, but i was able to patch that files, patch throws errors, so i have to pass a modifier that avoids spaces. That make the work.
I’m tracing inside xorg-input-tslib, seems like the device is opened ok (with ts_open), but then, inside the ReadInput function, the “ts_read” keeps returning 0, so it never gets a value from the touchscreen. That function is the same used inside ts_test, so i assume that there’s something in ts_read that is not going well. Maybe the pointer of the device?
ts_read is just some wrapper of a normal “read” function, i need to look what exactly a 0 returned means.
Seems like i’m close to getting it working.

What kernel are you using? Did you build it yourself? I’m assuming you mod probed sun4i-ts and that you can see it in lsmod or else ts_test wouldn’t work as well. Are you sure the little ribbon that comes from the touch screen is connected the right way to the little connector? (Try flipping it?).

And if the patches gave you errors, that’s the problem. I had the same issue. Try downloading my own patched files (see links above), and use them instead.

Just a few word to say that … IT WORKS !!!
Just need to type ldconfig after make install for tslib and ts-calibrate and ts-test works.
I use XFCE4 as windows manager. I also tested with some small programs using QT4 : all OK!

Have a nice day….

Thank you for your guide and all your work!
I have problems with patching that 2 files (tslib.c and input-raw.c) too and I was hopping to use yours, but links from Dropbox doesn’t work right (files are empty, 0 bytes).
Could you pls. check it?

I’m almost there now with a working system so thanks for this blog!

Since you are ahead of all of us what are the chances of creating a complete SD image of a working LCD/touchscreen system? I’m sure Olimex would host it; if not then I would!

I’m sure there are a number of A13/LCD developers that would be eternally grateful for a leg-up on this.

Hi, thanks a lot it worked for me too ! I’ve just past the exports in /root/.bashrc and it’s perfect !
But… I have a problem if I try to reboot my debian. I’ve tried with reboot, reboot -f, and the same with shutdown. It doesn’t restart. Do you have the same problems ?

I’m not experiencing this problem for some reason. Reboots fine. In fact, for QA purposes, I had it reboot in a loop for a while, to see that X11 starts, with my application loading all the way, just to make sure it is reliable (and it is ;-)).

Are you sure you built the latest Sunxi-Linux kernel?

Note to Sisse – the reboot problem is a bug in my opinion. I have raised it on the Olimex forum but no takers so far. shutdown -r doesn’t work either but I think reboot calls shutdown so that is not unexpected. At this time it’s annoying but not a show stopper.

Hi Skaag – nice to meet you! I understand your reasoning on not wanting to issue a “dirty” image into the community. I currently use 2,4 and 8 GB SD cards but not a 16 (so far). I think your minimal spec is right on the money. If you need someone to test for you then I have a pair of A13/LCD’s on the bench.

David: I consider my own image “Dirty” at this point (meaning, there are many packages that I am using for my own purposes, which I’m sure most people won’t need). Also, my SD card is 16GB so if I made an image file it would not fit in the smaller SD cards. I have no problem hosting huge IMG files (I own a small hosting company), but it’s really more about releasing something “worthy” of someone’s time, and I think my own image would be inadequately large and messy, wasting people’s time (something I wish not to do). What I’m going to do, however, is prepare a working OS + Touch Screen on a 2GB SD card (will “steal” it from my wife’s camera), and prepare a “clean” setup on that. I will then image it into an IMG file, compress it, and put it up for download. Will update here once it’s online.

I’m thinking these should be the minimal features on that SD Card:

1. Working Kernel, with modules for LCD and Touch Screen
2. Working WIFI with WPA2 support (wpa_supplicant)
3. TSLIB, XFree and GDM3 working perfectly (you boot and reach the Gnome login screen)

That will probably be a very good starting point for most people working on a similar setup, and something I wish I could download myself when I was starting.

I do not seem to suffer that reboot bug. It reboots just fine for me. I will work on the 2GB SD Card this weekend, hopefully will release it Saturday evening or Sunday evening the latest. Will be exciting to hear feedbacks on it.

I have TouchScreen working with your help, thank you!
But I have one, small (or big for me) problem – my keyboard stops working after X starts.
I can move cursor with touchscreen, but keyboard is not working. Have you experienced same issue with keyboard (evdev) after enabling tslib?

Actually in my setup I have not tried a keyboard at all, since my product is touch-screen only by design. But I do have a USB keyboard here, so I can try it out.

How did you enable the keyboard in the first place? I think that in general, my setup is configured for serial console only.

for “./configure –prefix=/usr”
it’s “./configure –prefix=/your/x11/lib/dir/”

on linaro I have “/usr/share/X11/”

I have to put “./configure –prefix=/usr” or “./configure –prefix=/usr/share” or
“./configure –prefix=/usr/share/X11”?
I can not make it work 🙁

And when I type “su” and after “ts_calibrate” , calibrate work good
but if I type “ts_calibrate” or “sudo ts_calibrate” in user linaro it don’t work
this is normal or there is a problem? Thank you for your help

I don’t know what linaro is, but in general if you can’t get “sudo ts_calibrate” to work, it means the exports are not there under sudo.
Try putting them in /root/.bashrc and then try again to ts_calibrate with sudo.

Hi Skaag,
I’m also trying to make the touchscreen work, but without any success.
ts_calibrate and ts_test are working fine.
But I keep getting this in my Xorg log file:

[ 23.055] (II) config/udev: Adding input device sun4i-ts (/dev/input/event1)
[ 23.056] (**) sun4i-ts: Applying InputClass “tslib touchscreen”
[ 23.056] (II) LoadModule: “tslib”
[ 23.056] (II) Loading /usr/lib/xorg/modules/input/
[ 23.066] (II) Module tslib: vendor=”X.Org Foundation”
[ 23.066] compiled for 1.12.4, module version = 0.0.1
[ 23.066] Module class: X.Org XInput Driver
[ 23.066] ABI class: X.Org XInput driver, version 16.0
[ 23.066] (II) Using input driver ‘tslib’ for ‘sun4i-ts’
[ 23.066] (**) Option “SendCoreEvents” “yes”
[ 23.066] (**) sun4i-ts: always reports core events
[ 23.067] (**) sun4i-ts: always reports core events
[ 23.067] (**) Option “ScreenNumber” “0”
[ 23.067] (**) Option “Width” “800”
[ 23.067] (**) Option “Height” “480”
[ 23.067] (**) Option “Rotate” “NONE”
[ 23.102] ts_config failed
[ 23.103] (II) UnloadModule: “tslib”
[ 23.103] (EE) PreInit returned 2 for “˜Eî@Ð×í@à:í@Ð×í@[email protected][email protected]è;í@è;í@ [email protected] [email protected]¨[email protected]¨[email protected]°[email protected]°[email protected]¸[email protected]¸[email protected]À[email protected]À[email protected]È[email protected]È[email protected]Ð[email protected]Ð[email protected]Ø[email protected]Ø[email protected]à[email protected]à[email protected]è[email protected]è[email protected]ð[email protected]ð[email protected]ø[email protected]ø[email protected]
[ 23.103] xf86TslibUninit
[ 23.103] xf86TslibControlProc
[ 23.103]
[ 23.103] Backtrace:
[ 23.103]
[ 23.103] Segmentation fault at address (nil)
[ 23.103]
Fatal server error:
[ 23.103] Caught signal 11 (Segmentation fault). Server aborting
[ 23.103]

I tried to patch the tslib file myself and because that didn’t work, I downloaded ours from your dropbox. But the problem remains.

Any suggestion is welcome.

Don’t know what did the trick, but my touch finally works!!
At least, I can move the cursor but… why click events are not passed to X?
I mean, nothing happens if I tap, double tap, hold pressed or any other combination: just cursor movement.

I also confirm that USB keyboard does not work in X: Xorg.0.log reports that keyboard is an input device of class Sun4iTouchscreen and it will be handled through tslib driver…

Thanks for your help

Thank you
Linaro is one prebuild image on the olimex wiki based on lubuntu
“Linaro ALIP image
4gb SD card image
Linaro alip ( lubuntu 12.04 widh lxde desktop environment, minimal )
kernel 3.4.19
to setup networking you can edit /etc/network/interfaces
Password is linaro ”
I finally cursor move on it last night
But I don’t know why movements were strange and do not correspond to the movements of fingers, even after calibation

I returned on the image debian (Debian with GUI (X)) and I immediately got it to work.
thank you very much

I finally got the keyboard working: just edit 20-touchscreen.conf as follows:

Section “InputClass”
Identifier “Sun4iTouchscreen”
MatchProduct “sun4i-ts”
Option “Device” “/dev/input/event1”
Driver “tslib”
Option “ScreenNumber” “0”
Option “Rotate” “NONE”
Option “Width” “800”
Option “Height” “480”
Option “SendCoreEvents” “yes”
Option “Type” “touchscreen”

To have right click emulation, add a line containing
Option “EmulateRightButton” “1”

Hi at all,
I want suggest two improvements:

1) if you use /dev/input/eventX to indicate the touchscreen it can canghe the X number if u have an mouse or a keyboard inserted on usb.
I think is better use /dev/input/by-path/platform-sun4i-ts-event

2) I noticed that, when I touch the screen, the Xorg process occupies 90% of the processor resources. You can check this with the top command.
I think this happens because in xorg.conf.d/ the touchscreen in 10-evdev.conf is assigned to evdev driver and in 20-touchscreen.conf is assigned to tslib.
I solved this using only a 10-evdev.conf file like this:
# Catch-all evdev loader for udev-based systems
# We don’t simply match on any device since that also adds accelerometers
# and other devices that we don’t really want to use. The list below
# matches everything but joysticks.

Section “InputClass”
Identifier “evdev pointer catchall”
MatchIsPointer “on”
MatchDevicePath “/dev/input/event*”
Driver “evdev”

Section “InputClass”
Identifier “evdev keyboard catchall”
MatchIsKeyboard “on”
MatchDevicePath “/dev/input/event*”
Driver “evdev”

Section “InputClass”
Identifier “Sun4iTouchscreen”
Option “Device” “/dev/input/by-path/platform-sun4i-ts-event”
Driver “tslib”
Option “ScreenNumber” “0”
Option “Rotate” “NONE”
Option “Width” “800”
Option “Height” “480”
Option “SendCoreEvents” “yes”
Option “Type” “touchscreen”

#Section “InputClass”
# Identifier “evdev touchscreen catchall”
# MatchIsTouchscreen “on”
# MatchDevicePath “/dev/input/event*”
# Driver “evdev”

Excuse me for my bad english, I hope it’s useful

I have a strange thing happening with me
I installed the A13 Debian Image with X R4 and I set the touch screen
-If I log as olinuxino user and type “sudo su” and after “startx” all is ok touch work perfect
-If I log as root user and type “startx” all is ok touch work perfect
But :
-If I log as olinuxino user and type “sudo startx” the cursor moves but movements were strange and do not correspond to the movements of fingers

Do you know why it works perfectly as root but poorly with sudo ?


My name is Ricardo and I just bought the same board from Olimex.

And I’ve created a blog to post all step-by-step and problems that I find with my return to embedded computers and my new challenge as a Blog Writer on WordPress.

I hope we can share a lot of informations about this.

I’m planning to post until tomorrow my first issues with this board in

I apologize for my bad English in the posts, so if you find something bad please let me know.



first of all, thanks for the tutorial!

But i’m experiencing problems right now (and just at the begging). FYI, i’m a beginner in linux so i might ask something completely stupid 🙂

I’m trying to support the TS with the board. I set up the Linaro version on a 8 Gb SD card, everything is working great for the moment.

I’m actually following the TS tutorial but i can’t go further than the “patch -p1 < ../tslib.patch" line. when i hit "enter", nothing's happen.

Do you know what would be the problem?

Best Regards,


Alright, i found the problem. But now i have this message “patch: **** Only garbage was found in the patch input”

Any idea?

Alright, I found the c files, drag them into the right folder. But i’m wondering, from which step i have to start then? (That’s definitely the newbie question i wanted to avoid) 🙂

hi skaag…

can you please tell me how can i enable wifi with basic 2gb debian xfce4 image in sd card.
i want to start my 7′ lcd ts with a13 wifi.
but to add ts modules i need to have debian image in my sd card.
but the debian image from wiki is not able to start wifi , i have edited the /etc/network/interfaces filr to my wifi ssid and password. but still no wifi connection.
can you suggest me how can i start wifi on this image.
or can you suggets me which image i should use to enable my lcd ts.
please help…..

Hi Skaag,

Thanks for your great tutorial!

Using linaro and following your method, I was able to use touchscreen in landscape mode.

However if I try to rotate screen in portrait mode, using Option “Rotate” “CW” in xorg.conf and 20-touchscreen.conf, Xorg crashes everytime the screen is touched.

Any idea how to make the touchscreen work in portrait mode ?


Hi Skaag,
Have you ever solved this? I am trying to do the same and have already defined a Coordinate Transformation Matrix to rotate the touchscreen (and it does rotate), but Xorg still crashes. I am out of options, now.


thanks for the guide. it worked for me
is it possible to get a onscreen keyboard, and make the board work like a tablet ?

Thanks For your whole guide regarding Olinuxino A-13….
Can we synchronise debian wheezy-keyboard with applications running in debian wheezy…

Hi Skaag,

Thanks for your great tutorial!

However I found the following problem. I have two identical A13. In a problem occurs and another does not. This with the same SD card. Freezes the CPU (100%). I must conclude that this is a hardware problem?

Apr 24 22:17:22 localhost kernel: [ 3.088811] usb 2-1.1: device not accepting address 3, error -71
Apr 24 22:17:22 localhost kernel: [ 3.103356] hub 2-1:1.0: cannot disable port 1 (err = -71)
Apr 24 22:17:22 localhost kernel: [ 3.117183] hub 2-1:1.0: cannot reset port 1 (err = -71)
Apr 24 22:17:22 localhost kernel: [ 3.130805] hub 2-1:1.0: cannot reset port 1 (err = -71)
Apr 24 22:17:22 localhost kernel: [ 3.144431] hub 2-1:1.0: cannot reset port 1 (err = -71)
Apr 24 22:17:22 localhost kernel: [ 3.158059] hub 2-1:1.0: cannot reset port 1 (err = -71)
Apr 24 22:17:22 localhost kernel: [ 3.171680] hub 2-1:1.0: cannot reset port 1 (err = -71)
Apr 24 22:17:22 localhost kernel: [ 3.182908] hub 2-1:1.0: Cannot enable port 1. Maybe the USB cable is bad?
Apr 24 22:17:22 localhost kernel: [ 3.198437] hub 2-1:1.0: cannot disable port 1 (err = -71)
Apr 24 22:17:22 localhost kernel: [ 3.212181] hub 2-1:1.0: cannot reset port 1 (err = -71)
Apr 24 22:17:22 localhost kernel: [ 3.232183] hub 2-1:1.0: cannot reset port 1 (err = -71)
Apr 24 22:17:22 localhost kernel: [ 3.262181] hub 2-1:1.0: cannot reset port 1 (err = -71)
Apr 24 22:17:22 localhost kernel: [ 3.292184] hub 2-1:1.0: cannot reset port 1 (err = -71)
Apr 24 22:17:22 localhost kernel: [ 3.322181] hub 2-1:1.0: cannot reset port 1 (err = -71)
Apr 24 22:17:22 localhost kernel: [ 3.349775] hub 2-1:1.0: Cannot enable port 1. Maybe the USB cable is bad?
Apr 24 22:17:22 localhost kernel: [ 3.372354] hub 2-1:1.0: cannot disable port 1 (err = -71)
Apr 24 22:17:22 localhost kernel: [ 3.402184] hub 2-1:1.0: cannot reset port 1 (err = -71)
Apr 24 22:17:22 localhost kernel: [ 3.432180] hub 2-1:1.0: cannot reset port 1 (err = -71)
Apr 24 22:17:22 localhost kernel: [ 3.462180] hub 2-1:1.0: cannot reset port 1 (err = -71)
Apr 24 22:17:22 localhost kernel: [ 3.482760] [mmc-msg] mmc 0 detect change, present 1
Apr 24 22:17:22 localhost kernel: [ 3.496056] hub 2-1:1.0: cannot reset port 1 (err = -71)
Apr 24 22:17:22 localhost kernel: [ 3.522180] hub 2-1:1.0: cannot reset port 1 (err = -71)
Apr 24 22:17:22 localhost kernel: [ 3.549788] hub 2-1:1.0: Cannot enable port 1. Maybe the USB cable is bad?
Apr 24 22:17:22 localhost kernel: [ 3.572355] hub 2-1:1.0: cannot disable port 1 (err = -71)
Apr 24 22:17:22 localhost kernel: [ 3.598928] hub 2-1:1.0: unable to enumerate USB device on port 1
Apr 24 22:17:22 localhost kernel: [ 3.622353] hub 2-1:1.0: cannot disable port 1 (err = -71)
Apr 24 22:17:22 localhost kernel: [ 3.652443] hub 2-1:1.0: hub_port_status failed (err = -71)
Apr 24 22:17:22 localhost kernel: [ 3.677824] usb 2-1: USB disconnect, device number 2
Apr 24 22:17:22 localhost kernel: [ 3.696320] Console: switching to colour frame buffer device 100×30


What other components are connected to the faulty A13? Are they on the same power supply? With the same stuff connected to it? (same USB devices?).

In other words are you simply swapping between the two A13 boards, but absolutely everything else is exactly 100% the same components?

If the answer is yes, then it could be a hardware problem indeed.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.