Capacitive touchscreen doesn't work with iMX8

Hi,

I’m developing two projects, one with a Colibri iMX6DL 512MB V1.1B and the other with a Colibri IMX8QXP 2GB WB V1.0D, both on the same custom carrier board with an RGB to LVDS parallel display interface and a Goodix GT928 capacitive touchscreen.
In both cases I use TorizonCore 5.7.2+build.20

Touchsceen works fine with iMX6 but can’t make it work with iMX8.

I downloaded the Goodix touch driver from touchscreen « input « drivers - linux-toradex.git - Linux kernel for Apalis, Colibri and Verdin modules

System information:

torizon@colibri-imx8x-07252168:~$ uname -a
Linux colibri-imx8x-07252168 5.4.193-5.7.0+git.f78299297185 #1-TorizonCore SMP PREEMPT Mon Jul 11 14:42:03 UTC 2022 aarch64 aarch64 aarch64 GNU/Linux

My tcbuild.yaml file:

input:
  easy-installer:
    local: input_image/

customization:
  device-tree:
    include-dirs:
        - device-trees/include/
    custom: device-trees/dts-arm64/imx8qxp-colibri-condor-2.dts
    overlays:
      add:
        - device-trees/overlays/colibri-imx8x_display-lcdif_overlay.dts
        - device-trees/overlays/display-g104xce-l01_overlay.dts
        - device-trees/overlays/colibri-imx8_goodix-gt928-ts_overlay.dts
        - device-trees/overlays/colibri-imx8_flexcan1_overlay.dts

  splash-screen: splash.png

  kernel:
	modules:
     - source-dir: goodix/

output:
  easy-installer:
    local: custom_image/

I’ve added the following lines in the device-tree (similar to the iMX6):

/* Colibri I2C */
&i2c1 {
	status = "okay";

	...

	goodix_ts: gt928@5d {
		compatible = "goodix,gt928";
		reg = <0x5d>;
		interrupt-parent = <&lsio_gpio3>;
		interrupts = <24 IRQ_TYPE_EDGE_FALLING>;			/* SODIMM 106 */
		reset-gpios = <&lsio_gpio3 23 GPIO_ACTIVE_HIGH>;	/* SODIMM 104 */
		touchscreen-inverted-x;
		touchscreen-inverted-y;
		status = "disabled";
	};
};

colibri-imx8_goodix-gt928-ts_overlay.dts overlay:

// Capacitive Goodix GT928 touchscreen for the 10.4 inch display.

/dts-v1/;
/plugin/;

/ {
	compatible = "toradex,colibri-imx8x";
};

&goodix_ts {
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_cap_ts>;
	status = "okay";
};

An excerpt from dmesg:

[    7.793895] Goodix-TS 17-005d: 17-005d supply AVDD28 not found, using dummy regulator
[    7.793995] Goodix-TS 17-005d: 17-005d supply VDDIO not found, using dummy regulator
[    7.794248] Goodix-TS 17-005d: i2c test failed attempt 1: -5
[    7.874701] Goodix-TS 17-005d: i2c test failed attempt 2: -5
[    7.912760] Goodix-TS 17-005d: I2C communication failure: -5
[    7.918624] Goodix-TS: probe of 17-005d failed with error -5

Any help would be appreciated

Greetings @mllona,

I don’t know the exact reason your touchscreen isn’t working on the i.MX8X but I have some hunches that you could maybe check.

First of all the link you provided here: touchscreen « input « drivers - linux-toradex.git - Linux kernel for Apalis, Colibri and Verdin modules

It points to the toradex_5.15-2.1.x-imx branch, which isn’t what TorizonCore 5.7.2 is based off of. The branch you want is toradex_5.4-2.3.x-imx, now I don’t think this is the main issue, though you should still probably correct it at some point.

Now next I noticed you are using SODIMM 104 as the reset gpio in your setup. By default SODIMM 104 is being configured as a GPIO here: imx8x-colibri.dtsi « freescale « dts « boot « arm64 « arch - linux-toradex.git - Linux kernel for Apalis, Colibri and Verdin modules

Could you check your device tree setup to make sure you cleared this conflict. I assume you’re setting the pins in this pinctrl_cap_ts node that you created.

Now all that said, the main thing is that I notice in the dmesg logs the driver is complaining about not being able to communicate/probe the touchscreen over i2c. Now this could be for a multitude of reasons, but perhaps you can check the i2c connection/signals and make sure everything is hooked up correctly to be sure.

Again I’m not exactly sure what the issue is without having the hardware myself but this is just what I noticed on first impression.

Best Regards,
Jeremias

Hi @jeremias.tx,

Thanks for your answer.

I replaced the driver with the one in the branch toradex_5.4-2.3.x-imx.

“Now next I noticed you are using SODIMM 104 as the reset gpio in your setup. By default SODIMM 104 is being configured as a GPIO here: imx8x-colibri.dtsi « freescale « dts « boot « arm64 « arch - linux-toradex.git - Linux kernel for Apalis, Colibri and Verdin modules

In my device-tree I had the following lines added to avoid conflict:

&pinctrl_hog1 {
	fsl,pins = <
		IMX8QXP_CSI_D07_CI_PI_D09			0x61		/* SODIMM  65 */
		/*IMX8QXP_QSPI0A_DATA2_LSIO_GPIO3_IO11		0x20		 SODIMM  69 */
		IMX8QXP_SAI0_TXC_LSIO_GPIO0_IO26		0x20		/* SODIMM  79 */
		IMX8QXP_CSI_D02_CI_PI_D04			0x61		/* SODIMM  79 */
		IMX8QXP_ENET0_RGMII_RXC_LSIO_GPIO5_IO03		0x06000020	/* SODIMM  85 */
		IMX8QXP_CSI_D06_CI_PI_D08			0x61		/* SODIMM  85 */
		IMX8QXP_SAI0_RXD_LSIO_GPIO0_IO27		0x20		/* SODIMM  97 */
		IMX8QXP_CSI_D03_CI_PI_D05			0x61		/* SODIMM  97 */
		IMX8QXP_SAI0_TXFS_LSIO_GPIO0_IO28		0x20		/* SODIMM 101 */
		IMX8QXP_CSI_D00_CI_PI_D02			0x61		/* SODIMM 101 */
		IMX8QXP_SAI0_TXD_LSIO_GPIO0_IO25		0x20		/* SODIMM 103 */
		IMX8QXP_CSI_D01_CI_PI_D03			0x61		/* SODIMM 103 */
		IMX8QXP_QSPI0B_DATA1_LSIO_GPIO3_IO19		0x20		/* SODIMM 105 */
		/*IMX8QXP_USB_SS3_TC2_LSIO_GPIO4_IO05		0x20		 SODIMM 127 */
		IMX8QXP_USB_SS3_TC3_LSIO_GPIO4_IO06		0x20		/* SODIMM 131 */
		IMX8QXP_USB_SS3_TC1_LSIO_GPIO4_IO04		0x20		/* SODIMM 133 */
		IMX8QXP_CSI_PCLK_LSIO_GPIO3_IO00		0x20		/* SODIMM  96 */
		IMX8QXP_QSPI0B_DATA3_LSIO_GPIO3_IO21		0x20		/* SODIMM  98 */
		IMX8QXP_SAI1_RXFS_LSIO_GPIO0_IO31		0x20		/* SODIMM 100 */
		IMX8QXP_QSPI0B_DQS_LSIO_GPIO3_IO22		0x20		/* SODIMM 102 */
		/*IMX8QXP_QSPI0B_SS0_B_LSIO_GPIO3_IO23		0x20		 SODIMM 104 */
	>;
};

“I assume you’re setting the pins in this pinctrl_cap_ts node that you created”

I also had the following settings in the device-tree:

&iomuxc {
	colibri-imx8qxp {
		pinctrl_cap_ts: captsgrp {
			fsl,pins = <
				IMX8QXP_QSPI0B_SS0_B_LSIO_GPIO3_IO23	0x21 /* SODIMM 104 - Capacitive touchscreen reset line: output w/pull-up*/
				IMX8QXP_QSPI0B_SS1_B_LSIO_GPIO3_IO24	0x4000061 /* SODIMM 106 - Capacitive touchscreen interrupt line: open drain input no-pull (external)*/
			>;
		};
	};
};

But it’s still not working. Maybe the reset and interrupt pins are misconfigured.
I also tried other pin settings but always with the same result

“but perhaps you can check the i2c connection/signals and make sure everything is hooked up correctly to be sure”

Already checked. The iMX6 works ok with the same touch and the same carrier board. The RTC uses the same i2c and works fine with the iMX8.

Regards

I found a thread on another forum that had a similar error to yours: RESOLVED: a64-pine64+ goodix touchscreen (i2c) fails to load on reboot - Pine A64 - Armbian Community Forums

Have you tried manually unloading and reloading the kernel module? Perhaps it’s not loading correctly on boot?

I also found this thread: AVDD28/VDDIO error while intergrating GT911 touch controller with Verdin iMX8M Mini

Maybe the device is using the other i2c address in this case?

Beyond this it’s hard to say without working with the hardware myself.

Best Regards,
Jeremias

Hi Jeremias,

Problem solved.
In fact, the problem was that the device was using the other i2c address (0x14).

I think the problem was that the status of the INT pin during the power-on initialization phase is different than what I use on the iMX6, so the host selected the other address.

Thanks for your help

Regards

Good to hear, glad I was able to help!

@mllona

I also face same issue for GT928, can you please let me know
exact changes done in device tree / overlay

Thank you

Hi @Shreejit,

The issue in this thread was that the other i2c address (0x14) was being used instead of the assumed (0x5d). Perhaps you have a similar issue? The overlays used here are at the start of the thread, minus the i2c address change.

Best Regards,
Jeremias

Hi @jeremias.tx ,

Thank you,
I tried the same device tree and overlay with address 0x14, but still I get same error
torizon@colibri-imx8x-07202984:~$ dmesg | grep Goodix
[ 8.458093] Goodix-TS 17-0014: 17-0014 supply AVDD28 not found, using dummy regulator
[ 8.458184] Goodix-TS 17-0014: 17-0014 supply VDDIO not found, using dummy regulator
[ 8.458478] Goodix-TS 17-0014: i2c test failed attempt 1: -5
[ 8.531415] Goodix-TS 17-0014: i2c test failed attempt 2: -5
[ 8.571260] Goodix-TS 17-0014: I2C communication failure: -5
[ 8.583267] Goodix-TS: probe of 17-0014 failed with error -5

and
torizon@colibri-imx8x-07202984:~$ i2cdetect -y 17
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: – – – – – – – – – – – – –
10: – – – – – – – – – – – – – – – –
20: – – – – – – – – – – – – – – – –
30: – – – – – – – – – – – – – – – –
40: – – – – – – – – – – – – – – – –
50: – – – – – – – – – – – – – – – –
60: – – – – – – – – 68 – – – – – – –
70: – – – – – – – –

Seeing the output of i2cdetect it seems there’s no device detected at either i2c address that this device uses. Perhaps there’s an issue with the hardware or i2c connections?

Best Regards,
Jeremias

@jeremias.tx
Thank you I checked the H/W, for some reason touch IC has gone bad,
I will try with another touch display

Thank you I checked the H/W, for some reason touch IC has gone bad,

That makes sense based on the observations here. Glad you were able to narrow things down.

Best Regards,
Jeremias

Thank you, touch works :slightly_smiling_face:

Glad I was able to help!

1 Like