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: Tslib installation



Tool/software: Linux

Hello All

My board is am335x-evm, SDK is sdk-02.00.00.11.

I try to porting tslib for touchscreen

I have one problem.

TI site : processors.wiki.ti.com/.../Tslib

1. download tslib

git clone github.com/.../tslib.git


2. compile

# apt-get install libtool
# ./autogen.sh
# ./configure --prefix=/usr/tslib --host=arm-linux-gnu
# make

I can't edit the file config.h (comment the line "#define malloc rpl_malloc" to avoid this option:"#define malloc rpl_malloc" -> "//#define malloc rpl_malloc")
There is no #define malloc rpl_malloc in config.h (I attached my config.h file)

# make install

# export TSLIB_FBDEVICE=/dev/fb0
# export TSLIB_TSDEVICE=/dev/input/touchscreen0
# export TSLIB_CONFFILE=/etc/ts.conf


3. tslib copy to target board (rootfs)

root@ubuntu:/usr/tslib# ls
bin  etc  include  lib  share
root@ubuntu:/usr/tslib# cp -R * /opt/work/trunk/BSP/AM335X/RootFileSystem/Rootfs/


4. run ts_calibrate

   # ./ts_calibrate
   ./ts_calibrate: line 1: syntax error: unexpected word (expecting ")") <= this error message

What is causing that syntax error?

Is there a problem with how to install tslib?

  • Hi,

    Touchscreen support is included in the Linux Processor SDK. See processors.wiki.ti.com/.../Processor_SDK_Linux_ADC

  • Thanks for fast reply.

    I am already using a 4 channel ADC.

    However, there is a problem if you modify the dts further to use the touchscreen.

    ====================================
    - Am335xx.dtsi
    ====================================

    tscadc: tscadc@44e0d000 {
     compatible = "ti,am3359-tscadc";
     reg = <0x44e0d000 0x1000>;
     interrupt-parent = <&intc>;
     interrupts = <16>;
     ti,hwmods = "adc_tsc";
     status = "disabled";

     tsc {
      compatible = "ti,am3359-tsc";
     };
     am335x_adc: adc {
      #io-channel-cells = <1>;
      compatible = "ti,am3359-adc";
     };
    };

    ====================================
    - 4 channel ADC dts : no problem
    ====================================
    &tscadc {
     status = "okay";
     clocks = <&adc_tsc_fck>;

     adc {
      ti,adc-channels = <0 1 2 3>;
      io-channels = <&am335x_adc 0>, <&am335x_adc 1>, <&am335x_adc 2>, <&am335x_adc 3>;
      io-channel-names = "AIN0", "AIN1", "AIN2", "AIN3";
     };
    };

    =================================================
    - 4 channel ADC + 4 wire touchscreen dts: problem
    =================================================
    &tscadc {
     status = "okay";
     clocks = <&adc_tsc_fck>;

     tsc {
      ti,wires = <4>;
      ti,x-plate-resistance = <200>;
      ti,coordinate-readouts = <5>;
      ti,wire-config = <0x00 0x11 0x22 0x33>;
      ti,charge-delay = <0x400>;
     };

     adc {
      ti,adc-channels = <0 1 2 3 4 5 6 7>;
      io-channels = <&am335x_adc 0>, <&am335x_adc 1>, <&am335x_adc 2>, <&am335x_adc 3>;
      io-channel-names = "AIN0", "AIN1", "AIN2", "AIN3";
     };
    };

    Segment error occurs in my driver that I used without problems.

    How can I use 4-wire touch ADC and general 4-channel ADC together?

    Thanks a lot for your help.

  • I finished with your help
    thank you very much