Problems with touch controller of Capacitive Touch Display 7" Parallel under linux

Hi,

I have followed the instructions here:
https://www.toradex.com/community/questions/16791/touch-for-capacitive-touch-display-7inch-parallel.html

The touch interface is connected via the adapter:


And the pinmapping is:

Adapter   |  Iris
X1        |  X16
Pin 1    <-> Pin 5   (SDA)
Pin 2    <-> Pin 6   (SCL)
Pin 3    <-> Pin 7   (GND)
Pin 4    <-> Pin 38  (INT)
Pin 5    <-> Pin 39  (RST)

I have also tried connecting the 3.3V pin on the adapter but it makes no difference.

I apply the following patch:

diff --git a/arch/arm/boot/dts/imx7-colibri-eval-v3.dtsi b/arch/arm/boot/dts/imx7-colibri-eval-v3.dtsi
index 217ddf0..b180514 100644
--- a/arch/arm/boot/dts/imx7-colibri-eval-v3.dtsi
+++ b/arch/arm/boot/dts/imx7-colibri-eval-v3.dtsi
@@ -123,10 +123,11 @@
 	/* Atmel maxtouch controller */
 	atmel_mxt_ts: atmel_mxt_ts@4a {
 		compatible = "atmel,maxtouch";
+		pinctrl-0 = <&pinctrl_gpiotouch>;
 		reg = <0x4a>;
-		interrupt-parent = <&gpio2>;
-		interrupts = <15 IRQ_TYPE_EDGE_FALLING>;
-		status = "disabled";
+		interrupt-parent = <&gpio1>;
+		interrupts = <9 IRQ_TYPE_EDGE_FALLING>;
+		status = "okay";
 	};
 
 	touch: touchrevf0710a@10 {
@@ -272,11 +273,11 @@
 };
 
 &pwm2 {
-	status = "okay";
+	status = "disabled";
 };
 
 &pwm3 {
-	status = "okay";
+	status = "disabled";
 };
 
 &pwm4 {
@@ -334,7 +335,7 @@
 		pinctrl_gpiotouch: touchgpios {
 			fsl,pins = <
 				MX7D_PAD_GPIO1_IO09__GPIO1_IO9		0x74
-				MX7D_PAD_GPIO1_IO10__GPIO1_IO10		0x14
+				MX7D_PAD_GPIO1_IO10__GPIO1_IO10		0x74
 			>;
 		};
 	};

Now, the problem. The touch controller is identified and it will (most of the times) register the first touch or two, but then it just stops. I have rebuilt the driver with debug on and started the kernel with the debug argument, and the following is the output:

root@colibri-imx7-emmc:~# modprobe -s atmel_mxt_ts
[   44.888903] atmel_mxt_ts 3-004a: T37 Start:256 Size:130 Instances:1 Report IDs:0-0
[   44.896533] atmel_mxt_ts 3-004a: T44 Start:386 Size:1 Instances:1 Report IDs:0-0
[   44.903964] atmel_mxt_ts 3-004a: T5 Start:387 Size:11 Instances:1 Report IDs:0-0
[   44.911422] atmel_mxt_ts 3-004a: T6 Start:398 Size:7 Instances:1 Report IDs:1-1
[   44.918743] atmel_mxt_ts 3-004a: T68 Start:405 Size:73 Instances:1 Report IDs:2-2
[   44.926255] atmel_mxt_ts 3-004a: T38 Start:478 Size:64 Instances:1 Report IDs:0-0
[   44.933774] atmel_mxt_ts 3-004a: T71 Start:542 Size:200 Instances:1 Report IDs:0-0
[   44.941373] atmel_mxt_ts 3-004a: T110 Start:742 Size:52 Instances:6 Report IDs:0-0
[   44.948951] atmel_mxt_ts 3-004a: T7 Start:1054 Size:5 Instances:1 Report IDs:0-0
[   44.956380] atmel_mxt_ts 3-004a: T8 Start:1059 Size:15 Instances:1 Report IDs:0-0
[   44.963899] atmel_mxt_ts 3-004a: T15 Start:1074 Size:11 Instances:1 Report IDs:3-3
[   44.971503] atmel_mxt_ts 3-004a: T18 Start:1085 Size:2 Instances:1 Report IDs:0-0
[   44.979002] atmel_mxt_ts 3-004a: T19 Start:1087 Size:6 Instances:1 Report IDs:4-4
[   44.986516] atmel_mxt_ts 3-004a: T25 Start:1093 Size:39 Instances:1 Report IDs:5-5
[   44.994123] atmel_mxt_ts 3-004a: T40 Start:1132 Size:5 Instances:1 Report IDs:0-0
[   45.001646] atmel_mxt_ts 3-004a: T42 Start:1137 Size:13 Instances:1 Report IDs:0-0
[   45.009232] atmel_mxt_ts 3-004a: T43 Start:1150 Size:15 Instances:1 Report IDs:6-6
[   45.016850] atmel_mxt_ts 3-004a: T46 Start:1165 Size:12 Instances:1 Report IDs:7-7
[   45.024451] atmel_mxt_ts 3-004a: T47 Start:1177 Size:28 Instances:1 Report IDs:0-0
[   45.032055] atmel_mxt_ts 3-004a: T56 Start:1205 Size:45 Instances:1 Report IDs:8-8
[   45.039642] atmel_mxt_ts 3-004a: T61 Start:1250 Size:5 Instances:6 Report IDs:9-14
[   45.047243] atmel_mxt_ts 3-004a: T65 Start:1280 Size:23 Instances:3 Report IDs:15-17
[   45.055021] atmel_mxt_ts 3-004a: T70 Start:1349 Size:10 Instances:20 Report IDs:18-37
[   45.062880] atmel_mxt_ts 3-004a: T72 Start:1549 Size:85 Instances:1 Report IDs:38-38
[   45.070631] atmel_mxt_ts 3-004a: T77 Start:1634 Size:2 Instances:1 Report IDs:0-0
[   45.078154] atmel_mxt_ts 3-004a: T78 Start:1636 Size:12 Instances:1 Report IDs:0-0
[   45.085755] atmel_mxt_ts 3-004a: T79 Start:1648 Size:4 Instances:3 Report IDs:0-0
[   45.093273] atmel_mxt_ts 3-004a: T80 Start:1660 Size:11 Instances:1 Report IDs:39-39
[   45.101053] atmel_mxt_ts 3-004a: T92 Start:1671 Size:130 Instances:1 Report IDs:40-40
[   45.108891] atmel_mxt_ts 3-004a: T93 Start:1801 Size:28 Instances:1 Report IDs:41-41
[   45.116667] atmel_mxt_ts 3-004a: T95 Start:1829 Size:5 Instances:1 Report IDs:0-0
[   45.124186] atmel_mxt_ts 3-004a: T96 Start:1834 Size:8 Instances:1 Report IDs:0-0
[   45.131702] atmel_mxt_ts 3-004a: T97 Start:1842 Size:10 Instances:4 Report IDs:42-45
[   45.139460] atmel_mxt_ts 3-004a: T98 Start:1882 Size:5 Instances:1 Report IDs:0-0
[   45.146979] atmel_mxt_ts 3-004a: T100 Start:1887 Size:54 Instances:1 Report IDs:46-63
[   45.154851] atmel_mxt_ts 3-004a: T104 Start:1941 Size:11 Instances:1 Report IDs:0-0
[   45.162536] atmel_mxt_ts 3-004a: T108 Start:1952 Size:75 Instances:1 Report IDs:64-64
[   45.170374] atmel_mxt_ts 3-004a: T109 Start:2027 Size:9 Instances:1 Report IDs:65-65
[   45.178155] atmel_mxt_ts 3-004a: T111 Start:2036 Size:18 Instances:2 Report IDs:0-0
[   45.185844] atmel_mxt_ts 3-004a: T112 Start:2072 Size:5 Instances:1 Report IDs:66-66
[   45.193637] atmel_mxt_ts 3-004a: T113 Start:2077 Size:3 Instances:1 Report IDs:0-0
[   45.311480] atmel_mxt_ts 3-004a: T6 Config Checksum: 0x654801
[   45.317255] atmel_mxt_ts 3-004a: T6 Status 0x80 RESET
[   45.332713] atmel_mxt_ts 3-004a: message: 26 38 02 00 02 01 16 00 00 00
[   45.349674] atmel_mxt_ts 3-004a: message: 40 18 02 00 04 00 01 00 00 00
[   45.366634] atmel_mxt_ts 3-004a: message: 41 05 00 00 00 00 00 00 00 00
[   45.383539] atmel_mxt_ts 3-004a: T6 Status 0x10 CAL
[   45.420326] atmel_mxt_ts 3-004a: T6 Status 0x00 OK
[   45.505874] atmel_mxt_ts 3-004a: message: 40 10 02 00 03 00 00 00 00 00
[   45.566151] atmel_mxt_ts 3-004a: message: 26 10 02 00 02 01 16 00 00 00
[   45.756526] atmel_mxt_ts 3-004a: message: 40 10 02 00 03 00 00 00 00 00
[   45.768723] atmel_mxt_ts 3-004a: __mxt_read_reg: i2c transfer failed (-5)
[   45.775563] atmel_mxt_ts 3-004a: Failed to read T44 and T5 (-5)
[   45.802931] atmel_mxt_ts 3-004a: message: 40 10 02 00 02 00 00 00 00 00
[   45.810312] atmel_mxt_ts 3-004a: Direct firmware load for maxtouch.cfg failed with error -2
[   45.818737] atmel_mxt_ts 3-004a: Falling back to user helper
[   45.836749] atmel_mxt_ts 3-004a: message: 26 10 02 00 02 01 16 00 00 00
[   45.853784] atmel_mxt_ts 3-004a: message: 40 10 02 00 03 00 01 00 00 00
[   45.868048] atmel_mxt_ts 3-004a: T100 aux mappings vect:0 ampl:0 area:0
[   45.874765] atmel_mxt_ts 3-004a: T100 Touchscreen size X799Y479
[   45.881058] input: Atmel maXTouch Touchscreen as /devices/platform/soc/30800000.aips-bus/30a50000.i2c/i2c-3/3-004a/input/input2
[   45.894299] atmel_mxt_ts 3-004a: Family: 164 Variant: 11 Firmware V1.2.AA Objects: 41
[   45.925860] atmel_mxt_ts 3-004a: message: 40 10 02 00 02 00 01 00 00 00
[   45.955268] atmel_mxt_ts 3-004a: T6 Status 0x08 CFGERR
[   46.005358] atmel_mxt_ts 3-004a: T6 Status 0x10 CAL
[   46.031096] atmel_mxt_ts 3-004a: T6 Status 0x00 OK
[   46.077080] atmel_mxt_ts 3-004a: message: 40 10 02 00 03 00 03 00 00 00
[   46.104818] atmel_mxt_ts 3-004a: message: 26 10 02 00 02 02 16 00 00 00
[   46.138057] atmel_mxt_ts 3-004a: message: 40 10 02 00 06 00 02 00 00 00
[   46.261029] atmel_mxt_ts 3-004a: message: 40 10 02 00 06 00 01 01 00 00
[   46.322792] atmel_mxt_ts 3-004a: message: 40 10 02 00 07 00 02 01 00 00
[   46.363830] atmel_mxt_ts 3-004a: message: 26 10 02 00 02 02 16 00 00 00
[   46.391835] atmel_mxt_ts 3-004a: message: 40 10 02 00 06 00 02 01 00 00
[   46.445941] atmel_mxt_ts 3-004a: message: 40 10 02 00 05 00 01 00 00 00
[   46.506573] atmel_mxt_ts 3-004a: message: 40 10 02 00 06 00 01 00 00 00
[   46.568495] atmel_mxt_ts 3-004a: message: 40 10 02 00 06 00 01 00 00 00
[   46.629330] atmel_mxt_ts 3-004a: message: 40 10 02 00 05 00 02 00 00 00
[   46.691290] atmel_mxt_ts 3-004a: message: 40 10 02 00 06 00 01 00 00 00
[   46.813828] atmel_mxt_ts 3-004a: message: 40 10 02 00 07 00 01 00 00 00
[   46.874322] atmel_mxt_ts 3-004a: message: 40 10 02 00 06 00 01 00 00 00
[   46.902233] atmel_mxt_ts 3-004a: message: 26 10 02 00 02 02 16 00 00 00
[   46.998276] atmel_mxt_ts 3-004a: message: 40 10 02 00 06 00 01 00 00 00
[   47.060306] atmel_mxt_ts 3-004a: message: 40 10 02 00 06 00 01 00 00 00
[   47.121391] atmel_mxt_ts 3-004a: message: 40 10 02 00 07 00 02 01 00 00
[   47.150791] atmel_mxt_ts 3-004a: message: 26 10 02 00 02 01 16 00 00 00
[   47.183944] atmel_mxt_ts 3-004a: message: 40 10 02 00 06 00 01 00 00 00
[   47.245505] atmel_mxt_ts 3-004a: message: 40 10 02 00 05 00 01 00 00 00
[   47.308019] atmel_mxt_ts 3-004a: message: 40 10 02 00 06 00 00 00 00 00
[   47.414466] atmel_mxt_ts 3-004a: message: 26 10 02 00 02 02 16 00 00 00
[   47.441950] atmel_mxt_ts 3-004a: message: 40 10 02 00 06 00 00 00 00 00
[   47.492990] atmel_mxt_ts 3-004a: message: 40 10 02 00 06 00 01 00 00 00
[   47.555149] atmel_mxt_ts 3-004a: message: 40 10 02 00 05 00 01 00 00 00
[   47.616574] atmel_mxt_ts 3-004a: message: 40 10 02 00 07 00 02 00 00 00
[   47.679125] atmel_mxt_ts 3-004a: message: 26 10 02 00 02 02 16 00 00 00
[   47.698052] atmel_mxt_ts 3-004a: message: 40 10 02 00 07 00 03 01 00 00
[   47.740501] atmel_mxt_ts 3-004a: message: 40 10 02 00 05 00 01 00 00 00
[   47.802408] atmel_mxt_ts 3-004a: message: 40 10 02 00 05 00 01 00 00 00
[   47.864055] atmel_mxt_ts 3-004a: message: 40 10 02 00 05 00 01 00 00 00
[   47.926542] atmel_mxt_ts 3-004a: message: 40 10 02 00 05 00 01 00 00 00
[   47.987964] atmel_mxt_ts 3-004a: message: 40 10 02 00 06 00 01 00 00 00
[   48.173949] atmel_mxt_ts 3-004a: message: 40 10 02 00 06 00 02 00 00 00
[   48.206425] atmel_mxt_ts 3-004a: message: 26 10 02 00 02 02 16 00 00 00
[   48.297625] atmel_mxt_ts 3-004a: message: 40 10 02 00 05 00 02 00 00 00
[   48.358945] atmel_mxt_ts 3-004a: message: 40 10 02 00 06 00 01 00 00 00
[   48.421199] atmel_mxt_ts 3-004a: message: 40 10 02 00 06 00 02 00 00 00
[   48.470859] atmel_mxt_ts 3-004a: message: 26 10 02 00 02 02 16 00 00 00
[   48.498893] atmel_mxt_ts 3-004a: message: 40 10 02 00 05 00 01 00 00 00
[   48.545066] atmel_mxt_ts 3-004a: message: 40 10 02 00 06 00 01 00 00 00
[   48.606231] atmel_mxt_ts 3-004a: message: 40 10 02 00 06 00 01 00 00 00
[   48.668929] atmel_mxt_ts 3-004a: message: 40 10 02 00 06 00 01 00 00 00
[   48.730290] atmel_mxt_ts 3-004a: message: 40 10 02 00 06 00 01 00 00 00
[   48.749221] atmel_mxt_ts 3-004a: message: 26 10 02 00 02 02 16 00 00 00
[   48.853560] atmel_mxt_ts 3-004a: message: 40 10 02 00 06 00 02 00 00 00
[   48.916501] atmel_mxt_ts 3-004a: message: 40 10 02 00 06 00 00 00 00 00
[   49.039752] atmel_mxt_ts 3-004a: message: 40 10 02 00 06 00 01 00 00 00
[   49.101105] atmel_mxt_ts 3-004a: message: 40 10 02 00 06 00 00 00 00 00
[   49.163626] atmel_mxt_ts 3-004a: message: 40 10 02 00 05 00 02 00 00 00
[   49.224972] atmel_mxt_ts 3-004a: message: 40 10 02 00 05 00 00 00 00 00
[   49.262495] atmel_mxt_ts 3-004a: message: 26 10 02 00 02 02 16 00 00 00
[   49.411180] atmel_mxt_ts 3-004a: message: 40 10 02 00 06 00 01 00 00 00
[   49.526026] atmel_mxt_ts 3-004a: message: 26 10 02 00 02 02 16 00 00 00
[   49.553943] atmel_mxt_ts 3-004a: message: 40 10 02 00 06 00 02 01 00 00
[   49.596087] atmel_mxt_ts 3-004a: message: 40 10 02 00 06 00 02 00 00 00
[   49.658575] atmel_mxt_ts 3-004a: message: 40 10 02 00 05 00 02 00 00 00
[   49.719889] atmel_mxt_ts 3-004a: message: 40 10 02 00 05 00 00 00 00 00
[   49.789116] atmel_mxt_ts 3-004a: message: 27 80 00 00 00 00 00 00 00 00
[   49.816894] atmel_mxt_ts 3-004a: message: 26 12 02 00 02 02 16 00 00 00
[   49.838629] atmel_mxt_ts 3-004a: message: 27 81 00 00 00 00 00 00 00 00
[   49.889708] atmel_mxt_ts 3-004a: [0] type:1 x:613 y:226 a:00 p:01 v:00
[   49.917779] atmel_mxt_ts 3-004a: message: 40 12 02 00 05 00 00 00 00 00
[   49.938546] atmel_mxt_ts 3-004a: message: 27 00 00 00 00 00 00 00 00 00
[   49.989408] atmel_mxt_ts 3-004a: [0] release
[   50.014601] atmel_mxt_ts 3-004a: message: 40 10 02 00 05 00 01 00 00 00
[   50.042225] atmel_mxt_ts 3-004a: message: 40 10 02 00 05 00 00 00 00 00
[   50.102958] atmel_mxt_ts 3-004a: message: 40 10 02 00 06 00 01 00 00 00
[   50.131051] atmel_mxt_ts 3-004a: message: 26 10 02 00 02 02 16 00 00 00
[   50.165416] atmel_mxt_ts 3-004a: message: 40 10 02 00 06 00 02 00 00 00
[   50.351445] atmel_mxt_ts 3-004a: message: 40 10 02 00 06 00 02 00 00 00
[   50.379105] atmel_mxt_ts 3-004a: message: 26 10 02 00 02 01 16 00 00 00
[   50.476136] atmel_mxt_ts 3-004a: message: 40 10 02 00 06 00 01 00 00 00
[   50.537652] atmel_mxt_ts 3-004a: message: 40 10 02 00 07 00 01 00 00 00
[   50.599801] atmel_mxt_ts 3-004a: message: 40 10 02 00 06 00 01 00 00 00
[   50.638229] atmel_mxt_ts 3-004a: message: 26 10 02 00 02 02 16 00 00 00
[   50.665841] atmel_mxt_ts 3-004a: message: 40 10 02 00 06 00 01 00 00 00
[   50.788687] atmel_mxt_ts 3-004a: message: 40 10 02 00 05 00 01 00 00 00
[   50.859001] atmel_mxt_ts 3-004a: message: 40 10 02 00 06 00 01 00 00 00
[   50.928254] atmel_mxt_ts 3-004a: message: 26 12 02 00 02 02 16 00 00 00
[   50.955875] atmel_mxt_ts 3-004a: message: 40 10 02 00 07 00 01 00 00 00
[   51.001809] atmel_mxt_ts 3-004a: message: 40 10 02 00 06 00 01 00 00 00
[   51.069977] atmel_mxt_ts 3-004a: message: 40 10 02 00 06 00 00 00 00 00
[   51.132432] atmel_mxt_ts 3-004a: message: 40 10 02 00 05 00 01 00 00 00
[   51.160503] atmel_mxt_ts 3-004a: message: 27 80 00 00 00 00 00 00 00 00
[   51.216316] atmel_mxt_ts 3-004a: [0] type:1 x:561 y:238 a:00 p:01 v:00
[   51.233181] atmel_mxt_ts 3-004a: message: 27 81 00 00 00 00 00 00 00 00

Things I have tried:

  • Lowering the i2c frequency from 100kHz to 10kHz => only made it worse
  • Increasing the pull-up on the INT & RST pins to 47k (from 100k) => No change in behaviour
  • Adding debug traces to the driver (atmel_mxt_ts.c), but I can only see that it stops getting interrupts suddenly

Can you give me some pointers on how to proceed with debugging this?

Best regards
Pedro

Please try re-flashing touch controller configuration.

Unpack files from the archive ( mxt-app and config ) and copy them to the board.
Run

./mxt-app -d i2c-dev:3-004a --load LTCTP070-3-GG_mXT1066T2_tdx_20170911.xcfg

Well that solved it, thanks! Just had to change the command line to:

./mxt-app -d i2c-dev:3-004a --load LTCTP070-3-GG_mXT1066T2_tdx_20170911.xcfg

Why is there no info regarding this anywhere?

BR
Pedro

I think I’ve lost --load somewhere during copy and paste, sorry for that. I’ve edited my post to include the full command. We’re still working on the wiki pages for our new capacitive touch displays and will include this and other troubleshooting information based on customer feedback.