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.

  • Resolved

Linux/PROCESSOR-SDK-AM437X: Touchscreen doesn't work on GP EVM

Intellectual 870 points

Replies: 14

Views: 444

Part Number: PROCESSOR-SDK-AM437X

Tool/software: Linux

Hi,

I download SDK ti-processor-sdk-linux-am437x-evm-05.01.00.11-Linux-x86-Install.bin and update  old SDK  tl-processor-sdk-linux-am437-evm-01.00.00.03, in my am437x-gp-evm board,  then the Touch screen cann't work. I did following:

1)modifed the dts file, added follow lines (from the old dts file)in the dts file:

    spi2_pins: spi2_pins {           /*4 wire touch screen driver chip */
        pinctrl-single,pins = <
            AM4372_IOPAD(0xa60, INPUT_EN | MUX_MODE0)  /* mcspi2_sclk mode 0*/
            AM4372_IOPAD(0xa64, INPUT_EN | MUX_MODE0)  /* 268 mcspi2_d0 mode 0*/
            AM4372_IOPAD(0xa68, INPUT_EN | MUX_MODE0)  /* 264 mcspi2_d1 mode 0*/
            AM4372_IOPAD(0xa6c, PIN_OUTPUT_PULLUP | MUX_MODE0)  /* mcspi2_cs0 mode 0*/
        >;
    };

    ads7846_pins: ads7846_pins {
        pinctrl-single,pins = <
            AM4372_IOPAD(0xa5c, PIN_INPUT_PULLUP | MUX_MODE7)  /* spi4_cs0..gpio5_7 */
        >;
    };
    edt_ft5x06_pins: edt_ft5x06_pins {
        pinctrl-single,pins = <
            AM4372_IOPAD(0xa78, PIN_INPUT_PULLUP | MUX_MODE7)  /* H20:clkreq..gpio0_24 */
        >;
    };
&spi2 {
    status = "okay";
    pinctrl-names = "default";
    pinctrl-0 = <&spi2_pins>;

    ads7846@0 {
        pinctrl-names = "default";
        pinctrl-0 = <&ads7846_pins>;

        compatible = "ti,ads7846";
        vcc-supply = <&ads7846reg>;

        reg = <0>;            /* CS0 */
        spi-max-frequency = <1500000>;

        interrupt-parent = <&gpio5>;
        interrupts = <7 0>;        /* gpio5_7 */
        pendown-gpio = <&gpio5 7 0>;

        ti,x-min = /bits/ 16 <0x0>;
        ti,x-max = /bits/ 16 <0x0fff>;
        ti,y-min = /bits/ 16 <0x0>;
        ti,y-max = /bits/ 16 <0x0fff>;

        ti,x-plate-ohms = /bits/ 16 <180>;
        ti,pressure-max = /bits/ 16 <255>;

        ti,debounce-max = /bits/ 16 <10>;
        ti,debounce-tol = /bits/ 16 <30>;
        ti,debounce-rep = /bits/ 16 <1>;

        ti,settle-delay-usec = /bits/ 16 <150>;
        ti,keep-vref-on = <1>;

        linux,wakeup;
    };
};

2)configed kernel: Device Driver->Input device support->Touchscreens->    <M>ADS7846/TSC2046/AD7837 and AD(s)7843 based touchscreens

<*>EDT FocalTech FT5x06 I2C Touchscreen support 

<M> TI Touchscreen Interface

3)save the config and compile the kernel to get zImage and modules

4)put the modules to filesystem

When update the system and reboot, the Touchscreen cann't work yet. when lsmod, there is no ads7846 in the list.

I attachment my dts file here.

Bests Regards,

7484.am437x-gp-evm.rar

  • Did you make modifications to your hardware? If you did not modify the hardware, why are you modifying the dts file of the updated software?

    Regards,
    Nick
  • In reply to Nick Saulnier:

    Hi Nick,

    I don't modifify hardware. the  new SDK( version 05.01.00.11) DTS file only support capactive touch screen which is I2C controlled, Our hardware is from old SDK which support resistence touch screen  which is controlled by spi2 conection(ADS7846). So I want to modified the DTS according to the old DTS to support the resistence touch screen.

    Bests Regards,

  • In reply to Nick Saulnier:

    Hi Nick,
    I have resolved this issue, There are errors in the DTS file. Thank you for your response!
  • Part Number: PROCESSOR-SDK-AM437X

    Tool/software: Linux

    Hi,

    Our am437x board support touchscreen with ads7846 module, now I update my system from SDK-01-00-00-03 to  SDK-05.01.00.11.  the new SDK's DTS file only support capactive touch, so I modified the DTS file and  configed kernel driver to support ads7846 module, add following  node in DTS file:

        spi2_pins: spi2_pins {           /*4 wire touch screen driver chip */
            pinctrl-single,pins = <
                AM4372_IOPAD(0xa60, INPUT_EN | MUX_MODE0)  /* mcspi2_sclk mode 0*/
                AM4372_IOPAD(0xa64, INPUT_EN | MUX_MODE0)  /* 268 mcspi2_d0 mode 0*/
                AM4372_IOPAD(0xa68, INPUT_EN | MUX_MODE0)  /* 264 mcspi2_d1 mode 0*/
                AM4372_IOPAD(0xa6c, PIN_OUTPUT_PULLUP | MUX_MODE0)  /* mcspi2_cs0 mode 0*/
            >;
        };

        ads7846_pins: ads7846_pins {
            pinctrl-single,pins = <
                AM4372_IOPAD(0xa5c, PIN_INPUT_PULLUP | MUX_MODE7)  /* spi4_cs0..gpio5_7 */
            >;
        };
        edt_ft5x06_pins: edt_ft5x06_pins {
            pinctrl-single,pins = <
                AM4372_IOPAD(0xa78, PIN_INPUT_PULLUP | MUX_MODE7)  /* H20:clkreq..gpio0_24 */
            >;
        };
    &spi2 {
        status = "okay";
        pinctrl-names = "default";
        pinctrl-0 = <&spi2_pins>;

        ads7846@0 {
            pinctrl-names = "default";
            pinctrl-0 = <&ads7846_pins>;

            compatible = "ti,ads7846";
            vcc-supply = <&ads7846reg>;

            reg = <0>;            /* CS0 */
            spi-max-frequency = <1500000>;

            interrupt-parent = <&gpio5>;
            interrupts = <7 0>;        /* gpio5_7 */
            pendown-gpio = <&gpio5 7 0>;

            ti,x-min = /bits/ 16 <0x0>;
            ti,x-max = /bits/ 16 <0x0fff>;
            ti,y-min = /bits/ 16 <0x0>;
            ti,y-max = /bits/ 16 <0x0fff>;

            ti,x-plate-ohms = /bits/ 16 <180>;
            ti,pressure-max = /bits/ 16 <255>;

            ti,debounce-max = /bits/ 16 <10>;
            ti,debounce-tol = /bits/ 16 <30>;
            ti,debounce-rep = /bits/ 16 <1>;

            ti,settle-delay-usec = /bits/ 16 <150>;
            ti,keep-vref-on = <1>;

            linux,wakeup;
        };
    };

    I update DTB , zImage and filesystem  files, when  system up, I can find in /dev:

    root@am437x-evm:/dev/input# ls
    by-path       event0        event1        touchscreen0

    the modules loaded:

    root@am437x-evm:/dev/input# lsmod
    Module                  Size  Used by
    xhci_plat_hcd          16384  0
    xhci_hcd              122880  1 xhci_plat_hcd
    usbcore               204800  2 xhci_plat_hcd,xhci_hcd
    pru_rproc              20480  0
    pruss_intc             16384  1 pru_rproc
    pruss                  16384  1 pru_rproc
    dwc3                   73728  0
    udc_core               28672  1 dwc3
    usb_common             16384  3 udc_core,usbcore,dwc3
    ti_am335x_adc          16384  0
    ti_am335x_tsc          16384  0
    snd_soc_simple_card    16384  0
    snd_soc_simple_card_utils    16384  1 snd_soc_simple_card
    bc_example             16384  0
    pm33xx                 16384  0
    pvrsrvkm              413696  1 bc_example
    omap_des               20480  0
    omap_aes_driver        24576  0
    des_generic            28672  1 omap_des
    omap_sham              28672  0
    crypto_engine          16384  2 omap_des,omap_aes_driver
    omap_crypto            16384  2 omap_des,omap_aes_driver
    pruss_soc_bus          16384  0
    ti_emif_sram           16384  1 pm33xx
    ads7846                20480  0
    dwc3_omap              16384  0
    snd_soc_tlv320aic3x    57344  1
    wkup_m3_ipc            16384  1 pm33xx
    wkup_m3_rproc          16384  1
    rtc_omap               20480  2
    ti_am335x_tscadc       16384  2 ti_am335x_adc,ti_am335x_tsc
    remoteproc             40960  3 pru_rproc,wkup_m3_rproc,wkup_m3_ipc
    omap_wdt               16384  0
    sch_fq_codel           20480  3
    cryptodev              45056  0

    but the TS is not responsed to input when ts-calibrate.

    I cat /dev/input/touchscreen0, there is no changing.

    I check the console log, there are something wrong:

    root@am437x-evm:/dev/input# dmesg | grep 7846  

    [    0.174812] of_get_named_gpiod_flags: can't parse 'gpio' property of node '/ads7846-reg[0]'
    [    3.655424] ads7846-reg: disabling
    [   11.568338] ads7846 spi1.0: not using DMA for McSPI (-19)
    [   11.568587] of_get_named_gpiod_flags: parsed 'pendown-gpio' property of node '/ocp@44000000/spi@481a2000/ads7846@0[0]' - status (0)
    [   11.580604] ads7846 spi1.0: touchscreen, irq 97
    [   11.591868] input: ADS7846 Touchscreen as /devices/platform/44000000.ocp/481a2000.spi/spi_master/spi1/spi1.0/input/input0
    root@am437x-evm:/dev/input#

    What is wrong? I attachment my dts file here.

    Best Regards,

    7455.am437x-gp-evm.rar

  • In reply to user5926475:

    Maybe it would be useful to see the difference in console output between SDK 1.0 and SDK 5.1 so we can see what a "good" boot looks like compared to a "bad" boot? (with the understanding that there are huge differences between those Linux versions). If possible, a full boot log is preferred.

    I do not have that touchscreen hardware on my side, so I will not be able to run tests.

    Regards,
    Nick
  • In reply to Nick Saulnier:

    Hi Nick,

    I attachment the 'bad' and 'good' boot console output here. I also attachment the old SDK' DTS file.

    Best Regards,

    am437x-gp-evm(SDK1.0).rar

    SDK1.0(good).logSDK5.1(bad).log

  • In reply to user5926475:

    Hello,

    I am not super familiar with SPI, so we are learning together here.

    1) Other than the device tree file you modified, are you using the default device tree files in SDK 5.1? (e.g., is file am4372.dtsi from SDK 5.1 and not sdk 1.0?) - this relates to a potential SPI issue brought up in this post: e2e.ti.com/.../2345031 and e2e.ti.com/.../701141

    2) Could you post the corrected DTS file?

    3) Are you observing the expected voltage on the SPI pins?

    Regards,
    Nick
  • In reply to Nick Saulnier:

    Hi Nick,

    1)My modified DTS file is from SDK5.1, only with SPI2 node from SDK1.0.

    2)I attachment the default DTS files in SDK5.1 here. As the touchscreen is changed in my custom board. there seem no correct DTS file.

    3)When inputing( touching screen), I can observe the wave ( the expected voltage) on the SPi pins with oscilloscope.

    Best Regards,

    0876.am437x-gp-evm.rar

  • In reply to user5926475:

    Ok, so the signal is arriving at the board.

    Have you have checked that the pinmuxing during runtime is as you expect?
    CTRL_CONF_SPI2_SCLK 0x44E10A60
    CTRL_CONF_SPI2_D0 0x44E10A64
    CTRL_CONF_SPI2_D1 0x44E10A68
    CTRL_CONF_SPI2_CS0 0x44E10A6C

    You mentioned in an earlier post that there was an issue in one of the device tree files that you posted, and you had corrected the device tree. I was curious to see what had changed.

    Regards,
    Nick
  • In reply to Nick Saulnier:

    Hi Nick,

    1)the 4 signals is appeared as my expected.

    2)I commented following lines in unused_pins node in the DTS file which is pinmuxed with spi2 in the DTS:

        /*        AM4372_IOPAD(0xa60, PIN_INPUT | PULL_DISABLE | MUX_MODE7) */
        /*        AM4372_IOPAD(0xa68, PIN_INPUT_PULLDOWN | MUX_MODE7) */
    then I can find ads7846.ko when lsmod.

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.