This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Linux/AM4378: How to build tslib

Part Number: AM4378


Tool/software: Linux

I am trying to build tslib so that I can run ts_calibrate and ts_test, as is described here. I downloaded the tslib repository from Github, but I can't figure out how to build it. I tried following this guide, but it seems to be out of date. From what I have seen online, it seems like i need to run ./autogen.sh, but when I run that I get the following error: 

libtoolize: $pkgltdldir is not a directory: `/home/bootcamp/ti-sdk-am335x-evm-05.06.00.00/linux-devkit/share/libtool'
autoreconf: libtoolize failed with exit status: 1

I also tried using cmake, but I don't know how to configure cmake to cross compile for my target. Any help is appreciated.

  • Hello Tanner,

    Could you confirm what version of Linux you are using?
  • Hello Tanner,

    Not sure where you are getting autogen.sh from. Within your Processor Linux SDK 4.3 (Linux 4.9.69), you can see where libtool is hiding with

    find -name "libtool"

    Regards,
    Nick
  • autogen.sh is in the tslib git repository. In TI's tslib wiki it says to run ./configure --prefix=(Abosolute path on NFS) --host=arm-linux-gnu but this command fails because there is not configure script. So what I found online is that autogen.sh is supposed to create the configure file.
  • Hello Tanner,

    That wiki page was created 10 years ago and hasn't really been touched since, so I cannot comment on how accurate it is. Host points to the cross compile toolchain, prefix points to where you want the compiled tslib code to be stored. Whoever created that wiki was using NFS boot, but it would be different if your filesystem was stored on an SD card or something like that.

    Your autogen output makes it look like the autogen code was created for an SDK from many years ago: ti-sdk-am335x-evm-05.06.00.00 was followed by SDKs 6.0x, 7.0x, 8.0x, then Processor SDK 1.0x, 2.0x, 3.0x, 4.0x, 5.0x. So obviously that path wouldn't work because it doesn't exist on your machine. Go in your Linux Processor SDK, use my last post to find the new location for libtool, and make the appropriate changes.

    Regards,
    Nick
  • So is there a wiki that is less than 10 years old that would explain how to build and install tslib or am I on my own?
  • Hello Tanner,

    I've built the tslib in Yocto earlier and have the packages attached in this post. Please, check whether they will work for you.

    Best regards,
    Kemal

  • So do I need to just download and install the three packages you have listed in that post?

    root@am437x-evm:~# opkg install tslib-conf_1.1-r0.arago1_armv7ahf-neon.ipk
    root@am437x-evm:~# opkg install libts-1.0-0_1.1-r0.arago1_armv7ahf-neon.ipk
    root@am437x-evm:~# opkg install tslib-calibrate_1.1-r0.arago1_armv7ahf-neon.ipk

    I tried running the above commands but the second one fails with the following output:

    libts-1.0-0: unsatisfied recommendation for pointercal
    Collected errors:
    * calculate_dependencies_for: Cannot satisfy the following dependencies for libts-1.0-0:
    * libc6 (>= 2.25) *
    * opkg_solver_install: Cannot install package libts-1.0-0.
  • Which exact version of the Processor SDK is running on your board?
  • Try these packages for version 4.3.0.5.

  • Is this version of the tslib-conf different from the previous one? When I try to install it it says "opkg_prepare_file_for_install: Refusing to load file 'tslib-conf_1.1-r0.arago1_armv7ahf-neon.ipk' as it matches the installed version of tslib-conf (1.1-r0.arago1)."

    And then when I try to run ts_conf I get the error "-sh: /bin/ts_conf: cannot execute binary file". Is it necessary to run ts_conf for the calibration to work? I can run ts_calibrate and I go through all of the calibration points, but then when I try to run my main program, the touches seem to be slightly off.
  • Tanner Hunsucker73 said:
    Is this version of the tslib-conf different from the previous one?


    Yes, this is the version for 4.3.0.5.


    Tanner Hunsucker73 said:
    When I try to install it it says "opkg_prepare_file_for_install: Refusing to load file 'tslib-conf_1.1-r0.arago1_armv7ahf-neon.ipk' as it matches the installed version of tslib-conf (1.1-r0.arago1)."

    Use --force-reinstall option to fix this.


    Tanner Hunsucker73 said:
    And then when I try to run ts_conf I get the error "-sh: /bin/ts_conf: cannot execute binary file". Is it necessary to run ts_conf for the calibration to work? I can run ts_calibrate and I go through all of the calibration points, but then when I try to run my main program, the touches seem to be slightly off.

    What kind of application you are running on your board? Is it Qt based? If so, is the -plugin-mouse-tslib option enabled in the Qt framework. Do you have the configuration required for execution exported export QWS_MOUSE_PROTO=Tslib:/dev/input/touchscreen0, export TSLIB_CONFFILE=/etc/ts.conf?

  • Here's how to rebuild tslib from source:

    • cd <sdk-root-dir>
    • git clone git://github.com/libts/tslib.git
    • source linux-devkit/environment-setup
    • cd tslib/
    • ./autogen.sh
    • ./configure $CONFIGURE_FLAGS
    • make

    Note that the environment-setup file that you source will setup the path to the toolchain and also define the CONFIGURE_FLAGS variable that later gets used to call ./configure.

    Are you planning to use Weston window system in your end product?  If not, the better way to do this might be to rebuild the SDK file system without Wayland/Weston:

    http://software-dl.ti.com/processor-sdk-linux/esd/docs/latest/linux/Overview_Building_the_SDK.html#common-variations-no-sgx-x11-etc

    You will get a lot of "goodies" this way such as having the calibration auto-launched when no calibration data exists.

  • Thanks for that Brad. Should I start from scratch and do it this way? If so, how do I uninstall those packages that I installed previously?

    I will not be using a Weston window system in the end product - we are using something called Altia, which apparently uses DRM. They actually are supposed to have some sort of calibration tool but it hasn't been working. I actually made this post before I knew that they had this tool, but since it hasn't been working and I am just waiting for them to get back to me, I was just trying to see if I would have any luck using tslib.
  • Personally I think it would be better if you built them through Yocto. Then you would get an opkg output similar to what Kemal built (though without dependency issues, etc.). If you build it manually along the lines I showed, then you would need to manually copy the associated binaries to the target.