How to use touchscreen edt-ft5x06 on iMX6ULL - LXDE 2.8b7?

Hello everyone.

I am trying to use a 7" capacitive touch screen which uses the FT5316. I check online that this touch driver works with edt-ft5x06 driver that is already included in Toradex Kernel (toradex_4.9-2.3.x-imx).

I did the following step:

  1. Download the Linux Kernel Source. Branch toradex_4.9-2.3.x-imx referent to BSP version 2.8b5 and later.
$ mkdir -p ~/workdir
$ cd ~/workdir
$ git clone -b toradex_4.9-2.3.x-imx git://git.toradex.com/linux-toradex.git
  1. Set the Kernel configuration.
make colibri-imx6ull_defconfig
  1. Enable the edt-ft5x06 driver on Kernel.
make nconfig

and select the symbol TOUCHSCREEN_EDT_FT5X06 as a module.

  1. Compile the Kernel modules. See log below
charlesdias@charlesdias:~/DeviceTree/workdir/linux-toradex$ make -j$(nproc) modules
  CHK     include/config/kernel.release
  CHK     include/generated/uapi/linux/version.h
  CHK     include/generated/utsrelease.h
  CHK     scripts/mod/devicetable-offsets.h
  CHK     include/generated/timeconst.h
  CHK     include/generated/bounds.h
  CHK     include/generated/asm-offsets.h
  CALL    scripts/checksyscalls.sh
  Building modules, stage 2.
  MODPOST 83 modules
charlesdias@charlesdias:~/DeviceTree/workdir/linux-toradex$ mkdir modules
charlesdias@charlesdias:~/DeviceTree/workdir/linux-toradex$ export INSTALL_MOD_PATH=modules
charlesdias@charlesdias:~/DeviceTree/workdir/linux-toradex$ make modules_install
  INSTALL crypto/echainiv.ko
  INSTALL crypto/tcrypt.ko
  INSTALL drivers/bluetooth/btmrvl.ko
  INSTALL drivers/bluetooth/btmrvl_sdio.ko
  INSTALL drivers/bluetooth/btsdio.ko
  INSTALL drivers/bluetooth/hci_uart.ko
  INSTALL drivers/crypto/caam/sm_test.ko
  INSTALL drivers/hid/hid-multitouch.ko
  INSTALL drivers/input/serio/serport.ko
  INSTALL drivers/input/touchscreen/atmel_mxt_ts.ko
  INSTALL drivers/input/touchscreen/edt-ft5x06.ko
  INSTALL drivers/input/touchscreen/fusion_F0710A.ko
  INSTALL drivers/media/usb/uvc/uvcvideo.ko
  INSTALL drivers/media/v4l2-core/videobuf2-core.ko
  INSTALL drivers/media/v4l2-core/videobuf2-memops.ko
  INSTALL drivers/media/v4l2-core/videobuf2-v4l2.ko
  INSTALL drivers/media/v4l2-core/videobuf2-vmalloc.ko
  INSTALL drivers/net/can/can-dev.ko
  INSTALL drivers/net/can/flexcan.ko
  INSTALL drivers/net/can/spi/mcp251x.ko
  INSTALL drivers/net/ppp/ppp_async.ko
  INSTALL drivers/net/ppp/ppp_deflate.ko
  INSTALL drivers/net/ppp/ppp_generic.ko
  INSTALL drivers/net/ppp/ppp_mppe.ko
  INSTALL drivers/net/ppp/pppox.ko
  INSTALL drivers/net/ppp/pptp.ko
  INSTALL drivers/net/slip/slhc.ko
  INSTALL drivers/net/usb/asix.ko
  INSTALL drivers/net/usb/ax88179_178a.ko
  INSTALL drivers/net/usb/cdc_ether.ko
  INSTALL drivers/net/usb/usbnet.ko
  INSTALL drivers/usb/class/cdc-acm.ko
  INSTALL drivers/usb/class/cdc-wdm.ko
  INSTALL drivers/usb/gadget/function/u_ether.ko
  INSTALL drivers/usb/gadget/function/u_serial.ko
  INSTALL drivers/usb/gadget/function/usb_f_acm.ko
  INSTALL drivers/usb/gadget/function/usb_f_ecm.ko
  INSTALL drivers/usb/gadget/function/usb_f_ecm_subset.ko
  INSTALL drivers/usb/gadget/function/usb_f_eem.ko
  INSTALL drivers/usb/gadget/function/usb_f_fs.ko
  INSTALL drivers/usb/gadget/function/usb_f_mass_storage.ko
  INSTALL drivers/usb/gadget/function/usb_f_ncm.ko
  INSTALL drivers/usb/gadget/function/usb_f_obex.ko
  INSTALL drivers/usb/gadget/function/usb_f_rndis.ko
  INSTALL drivers/usb/gadget/function/usb_f_serial.ko
  INSTALL drivers/usb/gadget/function/usb_f_ss_lb.ko
  INSTALL drivers/usb/gadget/legacy/g_ether.ko
  INSTALL drivers/usb/gadget/legacy/g_mass_storage.ko
  INSTALL drivers/usb/gadget/legacy/g_ncm.ko
  INSTALL drivers/usb/gadget/legacy/g_serial.ko
  INSTALL drivers/usb/gadget/legacy/g_zero.ko
  INSTALL drivers/usb/gadget/legacy/gadgetfs.ko
  INSTALL drivers/usb/gadget/libcomposite.ko
  INSTALL drivers/usb/serial/option.ko
  INSTALL drivers/usb/serial/usb_wwan.ko
  INSTALL fs/configfs/configfs.ko
  INSTALL fs/nfs/flexfilelayout/nfs_layout_flexfiles.ko
  INSTALL lib/crc7.ko
  INSTALL lib/libcrc32c.ko
  INSTALL net/bluetooth/bluetooth.ko
  INSTALL net/bluetooth/bnep/bnep.ko
  INSTALL net/bluetooth/hidp/hidp.ko
  INSTALL net/bluetooth/rfcomm/rfcomm.ko
  INSTALL net/can/can-bcm.ko
  INSTALL net/can/can-gw.ko
  INSTALL net/can/can-raw.ko
  INSTALL net/can/can.ko
  INSTALL net/ipv4/gre.ko
  INSTALL net/ipv4/ip_tunnel.ko
  INSTALL net/ipv4/tunnel4.ko
  INSTALL net/ipv4/udp_tunnel.ko
  INSTALL net/ipv6/ip6_udp_tunnel.ko
  INSTALL net/ipv6/sit.ko
  INSTALL net/l2tp/l2tp_core.ko
  INSTALL net/l2tp/l2tp_ppp.ko
  INSTALL net/netfilter/xt_l2tp.ko
  INSTALL net/sunrpc/auth_gss/rpcsec_gss_krb5.ko
  INSTALL sound/core/snd-hwdep.ko
  INSTALL sound/core/snd-pcm.ko
  INSTALL sound/core/snd-rawmidi.ko
  INSTALL sound/core/snd-timer.ko
  INSTALL sound/usb/snd-usb-audio.ko
  INSTALL sound/usb/snd-usbmidi-lib.ko
  DEPMOD  4.9.220-00008-gd7e4d5790281-dirty
  1. Compile the Kernel
charlesdias@charlesdias:~/DeviceTree/workdir/linux-toradex$ make -j$(nproc) zImage 2>&1 | tee build.log
  CHK     include/config/kernel.release
  CHK     include/generated/uapi/linux/version.h
  CHK     scripts/mod/devicetable-offsets.h
  CHK     include/generated/utsrelease.h
  CHK     include/generated/timeconst.h
  CHK     include/generated/bounds.h
  CHK     include/generated/asm-offsets.h
  CALL    scripts/checksyscalls.sh
  CHK     include/generated/compile.h
  CHK     kernel/config_data.h
  Kernel: arch/arm/boot/Image is ready
  Kernel: arch/arm/boot/zImage is ready

My questions are:

  1. How can I update the Kernel image and add the new module to iMX6ULL;
  2. And how create the DTS file for this touch? I started the DST file, please, check below.
/dts-v1/;

#include "imx6ull-colibri-nonwifi.dtsi"
#include "imx6ull-colibri-aster.dtsi"

/ {
   model = "Colibri iMX6ULL 512MB Display Control Board V0.1";
   compatible = "toradex,colibri_imx6ull-aster", "fsl,imx6ull";
};

&i2c1 {
   pinctrl-0 = <&pinctrl_i2c1>;

   polytouch: edt-ft5316@38 {
      compatible = "edt,edt-ft5x06";
      reg = <0x38>;
      pinctrl-names = "default";
      interrupt-parent = <&gpio5>;
      interrupts = <4 IRQ_TYPE_EDGE_FALLING>;  	   /* SODIMM 107 - GPIO5.IO[4]  */
      reset-gpios = <&gpio1 10 GPIO_ACTIVE_LOW>;   /* SODIMM 106 - GPIO1.IO[10] */
      status = "okay";
   };
};

Thanks so much!

System and Hardware:

  • Angstrom v2017.12 - Kernel
  • Colibri-iMX6ULL_LXDE-Image 2.8b7. 20200610
  • Linux colibri-imx6ull 4.9.220-2.8.7+g57229263ff65 #1 SMP Wed Jun 10 17:07:44 UTC 2020 armv7l GNU/Linux
  • Colibri iMX6ULL 512MB IT V1.1A
  • Custom board based on Aster V1.1B
  • Display ER-TFT070A2-4 with Capacitive Touch Panel (IC FT5316)

Hi @CharlesDias,

From what I can see, it’s everything fine with your Kernel changes and compilation. Regarding your questions:

Please, check this guide: Build From Source Code Documentation Overview | Toradex Developer Center. Let me know if you need extra help with that part.

Apparently you followed correctly the documentation of this driver here: https://git.toradex.cn/cgit/linux-toradex.git/tree/Documentation/devicetree/bindings/input/touchscreen/edt-ft5x06.txt?h=toradex_4.9-2.3.x-imx. Did you check it already? Do you see any errors or something that could be related to the device tree?

Best Regards,
Hiago.

Hi @hfranco.tx.

I’ll check the procedures as recommended.

About the device tree, I just created it and compiled it. After update the kernel, I’ll update the device tree on iMX6ULL. I’ll let you know as soon as possible.

Thanks for your help.

1 Like

Hi @hfranco.tx.

It was necessary a small change. I had to inform the size of the touchscreen inside the DTS file. See below:

/dts-v1/;

#include "imx6ull-colibri-nonwifi.dtsi"
#include "imx6ull-colibri-aster.dtsi"

/ {
   model = "Colibri iMX6ULL 512MB Display Control Board V0.1";
   compatible = "toradex,colibri_imx6ull-aster", "fsl,imx6ull";
};

&i2c1 {
   pinctrl-0 = <&pinctrl_i2c1>;

   polytouch: edt-ft5316@38 {
      compatible = "edt,edt-ft5x06";
      reg = <0x38>;
      pinctrl-names = "default";
      interrupt-parent = <&gpio5>;
      interrupts = <4 IRQ_TYPE_EDGE_FALLING>;  	   /* SODIMM 107 - GPIO5.IO[4]  */
      reset-gpios = <&gpio1 10 GPIO_ACTIVE_LOW>;   /* SODIMM 106 - GPIO1.IO[10] */
      touchscreen-size-x = <800>;
      touchscreen-size-y = <480>;
      status = "okay";
   };
};

The touchscreen works fine! Thank you for your help.

1 Like

Hi @CharlesDias,

I’m glad you solved it!

Feel free to ask any further questions you might have.

Best Regards,
Hiago.