I’m working with the imx8qxp module and the iris v2 carrier board and I need support to enable the touchscreen driver ilitek,ili2511.
I have compiled the custom Torizon OS with an overlay that enables the ili2511 driver, then I found the device using “i2cdetect” command (resulting on the address 0x41), but I’m stacked because I don’t know if the touch input are working. Seems to be not in use.
I’m quite new with the Torizon OS and I would like to have a suggestion on the following points:
A way to understand if the touchscreen driver is detected and active
A way to read a touch input event.
If is possible, a device tree overlay to enable the touchscreen (just to compare)
Thank you for the suggestions, I was able to solve my issues. Was a device tree error about the compatible device.
Another question is there a way to autocalibrate the touchscreen or enable a calibration at startup because I noticed that after downloading the customized torizon OS the touchscreen is not working properly and works fine only after running the weston-touch-calibrator. What about that?
Regarding touch calibration, it should “work” every time after your calibration. weston-touch-calibrator will store the calibrated values in /etc/udev/rules.d directory in touchscreen.rules file. That’s why it is important to give the container access to that directory with the -v tag given in docker run command for weston-touch-calibrator. This is the the source code if you want to inspect: torizon-containers/debian-docker-images/weston-touch-calibrator at bookworm · torizon/torizon-containers (github.com)
How do you define “working properly”? Do you have to calibrate the touchscreen after each reboot and otherwise the touchscreen doesn’t give the correct location of the touch to the kernel?
Hey,
thank you for the reply. Yes exactly, the touchscreen results not calibrated after each reboot.
To fix it, at the moment, I have created a custom Torizon OS that replace the touchscreen.rules file with the one written by me contianing the calibration matrix like shown below:
I’m now working with yocto project. I was able to run the basic tdx-reference-multimedia-image and running the QT demo application on my 10" LVDS display.
To make the demo work on this display I had to do these steps:
enabled a ilitek210x driver using bitbake -c menuconfig virutal/kernel
copy my display overlay inside the /boot/overlays/
replace the /boot/overlay.txt content with the name of my overlay
rename the device tree “/boot/imx8qxp-iris-v2.dtb” to “/boot/imx8qxp-eval-v3.dtb” because by default the os system starts with the wrong device tree (imx8qxp-eval-v3.dtb) (I did a workaround)
Now I would like to automatize these operations and create a production image running the QT demo application:
I have created my meta-my-layer by following the toradex guide:
and now I’m stucked on the file called: layers/meta-my-layer/recipes-kernel/linux/linux-toradex%.bbappend
I’m not sure about the contents of “do_configure:append()” Do I have to add some command to copy also the defconfig file and the patch (the patch add only the new device tree overlays and update the makfile for the compilation)?
according to the article you gave before, you don’t need to add anything to the do_configure:append(). Maybe you miss this line “Create the directory recipes-kernel/linux/linux-toradex where you store the additional files which you include in SRC_URI.” So, any patch, device tree base, and new defconfig should be copied into that directory. Also, you might have missed this step
For example, you can see the in the machine configuration for Colibri iMX8X in the second step to “Enable Your Overlays in the Yocto Project” described in the link I provided above: colibri-imx8x.conf
Hi Andi,
Thanks again for your help, I was able to fix all the steps
There is only one thing left:
For the touchscreen I’m using a driver i2c device called ilitek2511 so I need to integrate inside the kernel the ili210x.ko driver, can suggest me a way to do it?
As you can see above in the “linux-toradex%.bbappend” file I added a defconfig file containing all target configurations exported with " bitbake -c menuconfig virtual/kernel" including the CONFIG_TOUCHSCREEN_ILI210X=m and CONFIG_TOUCHSCREEN_ILITEK=m.
Unfortunately, after flashing the module the touchscreen driver (ili210x.ko) is not working and is not present under the following path:
root@colibri-imx8x-14778755:/lib/modules/5.15.148-6.6.0-devel-6.6.0-devel+git.23a8e831749d/kernel/drivers/input/touchscreen# ls -la
total 240
drwxr-xr-x 3 root root 4096 Mar 9 2018 .
drwxr-xr-x 5 root root 4096 Mar 9 2018 ..
-rw-r--r-- 1 root root 7392 Mar 9 2018 ad7879-i2c.ko
-rw-r--r-- 1 root root 19072 Mar 9 2018 ad7879.ko
-rw-r--r-- 1 root root 59560 Mar 9 2018 atmel_mxt_ts.ko
-rw-r--r-- 1 root root 15216 Mar 9 2018 colibri-vf50-ts.ko
-rw-r--r-- 1 root root 38688 Mar 9 2018 edt-ft5x06.ko
-rw-r--r-- 1 root root 17256 Mar 9 2018 exc3000.ko
-rw-r--r-- 1 root root 38224 Mar 9 2018 goodix.ko
-rw-r--r-- 1 root root 22456 Mar 9 2018 ilitek_ts_i2c.ko
drwxr-xr-x 2 root root 4096 Mar 9 2018 synaptics_dsx
At this time, I think I miss some configuration to integrate it, do you have any idea?
In the meantime, I will search the information on the developer.toradex and community pages.
yeah it’s strange. I see that you have ilitek_ts_i2c.ko there but not ili210x.ko. Are you sure the configuration is applied properly? I think you should find it in the config.gz file. Try to run zcat /proc/config.g on your module and see if you can find CONFIG_TOUCHSCREEN_ILI210X=m
and CONFIG_TOUCHSCREEN_ILITEK=m.
I expect that the driver should be available if you enable it properly using the new defconfig. Maybe you can try to rename your bbappend to “linux-toradex_%.bbappend” with the underscore too?
Also, you can check if the bbappend is properly applied by running this command in your yocto build directory: bitbake-layers show-appends linux-toradex
Hope this helps and share your findings if you found the issue too.
This make the driver enabled and recognized by the system on the final image.
The only issue that I have not yet been able to fix is that the calibration matrix is not present inside the /etc/udev/rules.d/touchscreen.rules and the touchscreen is not calibrated. Do you have any suggestion?
you can create a udev-extraconf_%.bbappend in your layer (like what we do here) for the openembedded-core/meta/recipes-core/udev/udev-extraconf_1.1.bb recipe that you can find in layers directory.
You can install your touchscreen calibration file in the correct location in that append’s do_install function. Hope this suggestion helps you and let me know how it goes and share what you did as always to help all
Hi Andi, sorry for the late response. Okay, this way worked, thank you!
I need your point of view on the udev extra configuration.
I am currently working with three different displays with different sizes (5, 7, and 10 inches). Each one of these has a different touch driver, but only the 10" needs calibration to work properly. I want to create a generic meta layer for the three displays. Therefore, to apply the calibration only on the large one, I have created the following file containing the calibration rule when the ili251x (10" touchscreen) driver is detected:
touch=$(cat /sys/class/i2c-dev/i2c-1/device/1-0041/name)
if [[ "${touch}" == "ili251x" ]]; then
SUBSYSTEM=="input", KERNEL=="event[0-9]*", ENV{ID_INPUT_TOUCHSCREEN}=="1", ENV{LIBINPUT_CALIBRATION_MATRIX}="4.081606 0.108260 -0.021712 0.029122 6.689587 -0.001553"
fi
At this point, I noticed that when I’m connecting the 7 or 5-inch display, the touchscreen stops working because inside the udev rules, the system keeps the calibration data of the 10"… so I’m stuck on this problem for a few days and I have no idea how to fix it.
This will probably be the last question because I have finished the work.
thank you for letting me know that it works fine now I also thought of the same thing of applying that configuration outside of Yocto workflow (probably you could have done it by implementing logic in the do_install function of your udev-extraconf recipe based on the display’s overlay applied).
Can you share your solution with the systemd service to apply your different config?
Thanks a lot and happy to hear that you are good to go!