This article addresses the interfacing of our new 7-inch capacitive touchscreen display with Apalis family using the Ixora carrier board. We have chosen this carrier board as it supports 40-pin unified display interface along with 10-pin I2C touch interface.
We are demonstrating the setup with necessary steps for interfacing parallel capacitive touchscreen with Apalis iMX6Q and Apalis T30 as these modules provide support for parallel display interface.
Before proceeding there are few steps to check if the touch interface driver is loaded into the Linux kernel image. Starting from BSP 2.7b4, the touch interface driver is supported out-of-the-box, compiled as a module, and device-tree includes a device node for it that needs to be enabled. Therefore this guide can be performed with any interface setup, either the iMX6 or T30 modules.
Capacitive touchscreen is supported with Atmel I2C touchscreen driver, after login to the Linux CLI pass on the "lsmod" command as shown below, and you can find atmel_mxt_ts kernel module is loaded.
It is assumed iMX6 module is loaded with the Toradex Easy Installer else one can follow the steps HERE.
Use the Toradex Easy Installer flash instructions to flash a Linux image newer or at least from BSP 2.7b4, e.g. Apalis-iMX6_LXDE-Image_2.7b4-20171005.tar.bz2.
Insert the iMX6 SOM into Ixora carrier board and connect the capacitive display with 40-pin FFC cable to the unified display connector X15 and 10-pin FFC cable to the capacitive touch connector X24.
By default, the bootloader loads its device tree from imx6q-apalis-eval.dtb so we need to do changes in corresponding dtsi file Open the file imx6q-apalis-eval.dtsi and search for the node atmel_mxt_ts@4a. By default the atmel_mxt_ts@4a node is disabled state thus you have to change the status from disabled to okay as shown below:
status = "disabled" ;
status = "okay";
The kernel build system provides the dtbs target which compiles all device trees which are compatible to the current kernel configuration. ARCH and CROSS_COMPILE must be set and the kernel must be configured before device tree binaries can be compiled.
We need to compile the device-tree to get the imx6q-apalis-eval.dtb file
After compiling, a device tree blob file (*.dtb) is generated which needs to be loaded to our computer on module. Copy the compiled dtb file into the already prepared Linux kernel image SD-card, insert the card into the target carrier board and run below command: Note: to prepare the Linux kernel image supported SD card follow the Flashing Linux on iMX6 modules article.
run setupdate run update_fdt
Reboot the board and load the touch screen driver as shown below:
To check whether it is loaded or not use the lsmod command and make sure that the driver is loaded into the kernel.
Enter the bootloader (U-Boot) by pressing any key at the time of booting process. After entering boot mode run the following commands to configure the resolution required for capacitive touchscreen (800x480):
Apalis iMX6 # setenv vidargs video=mxcfb0:dev=lcd,FusionF07A,if=RGB24 Apalis iMX6 # saveenv Apalis iMX6 # boot
You can see, as Linux boots, that the TFT touch screen starts working.
It is assumed that the T30 module is loaded with a Toradex pre-built image for at least BSP 2.7b4, e.g. Apalis-T30_LXDE-Image_2.7b4-20171005.tar.bz2. Or else one can follow the instructions for creating an SD card and loading the image from the Flashing Linux on Tegra Modules article.
The configuration can be done either from U-Boot command-line (boot mode) or the Linux console interface:
Press any key to stop the board from booting, which will give you access to the U-Boot command-line interface. You should see the Apalis T30 # prompt. Set the vidargs environment variable as shown below:
Apalis T30 # setenv vidargs video=tegrafb0:pixclockpol:0,800x480-16@60 Apalis T30 # saveenv
You can check the new vidargs value by executing the command pri vidargs in terminal prompt. Either reset the board or run the boot command and you can see that the capacitive touchscreen starts to work.
Apalis T30 # pri vidargs Apalis T30 # boot
If you don’t have access to the U-Boot command-line, or prefer to make the changes from the Linux environment for any reason, you can do as follows. Power up the board and let the boot process execute. On the login prompt, enter with user root. No password is required. You will see the following command-line prompt then:
Set the U-Boot environment variable vidargs using the fw_setenv command:
root@apalis-t30:~# fw_setenv vidargs video=tegrafb0:pixclockpol:0,800x480-16@60
Now it is configured with the required resolution. It can be confirmed with the fbset command:
Reboot the system and your capacitive touchscreen starts working, the snapshot of the setup is presented below: