SAM9N12-DM linux4sam 6.0 doesn't show input touchscreen

This forum is for users of Microchip MPUs and who are interested in using Linux OS.

Moderator: nferre

lucav
Posts: 4
Joined: Sun Mar 17, 2019 1:41 pm

SAM9N12-DM linux4sam 6.0 doesn't show input touchscreen

Sun Mar 17, 2019 1:58 pm

Hi everyone,
i'm not an expert in this field, so sorry if i'm wrong with some terms, and i need some help with my problem.
Using buildroot-at91, i succeeded to create a bootable SD card with AT91 bootstrap + U-boot + linux kernel 4.14.73 (linux4sam 6.0).
Also i succeeded to install Qt 4 and relative demos.

The problem is that when i start one of the Qt demos, the lcd screen show the Qt application but the touchscreen doesn't work (but the touch buttons K1, K2, K3, K4 yes).

During my investigations, i saw that the /dev/input/touchscreen0 (where i think should be the touchscreen input device because the factory image) doesn't exist.
Also i check the make configuration running from the buildroot-at91 folder:

Code: Select all

make linux-menuconfig
i don't see the "Touchscreen interface" option:
Image
that i think should be there if i check the old linux kernel options here: https://how-to.fandom.com/wiki/How_to_c ... vers/input.

Maybe the linux kernel 4.14 doesn't have this option? Or i'm mistaking somewhere?

Thanks
blue_z
Location: USA
Posts: 1956
Joined: Thu Apr 19, 2007 10:15 pm

Re: SAM9N12-DM linux4sam 6.0 doesn't show input touchscreen

Tue Mar 19, 2019 4:31 am

lucav wrote: Using buildroot-at91, i succeeded to create a bootable SD card with AT91 bootstrap + U-boot + linux kernel 4.14.73 (linux4sam 6.0).
Also i succeeded to install Qt 4 and relative demos.
By "SAM9N12-DM" does that mean you're using a SAM9N12-EK with the display module?
Presumably you have configured the Linux kernel with the generic at91_dt_defconfig, and booting with the standard Device Tree for the SAM9N12-EK, at91sam9n12ek.dts?

lucav wrote: The problem is that when i start one of the Qt demos, the lcd screen show the Qt application but the touchscreen doesn't work (but the touch buttons K1, K2, K3, K4 yes).
Those symptoms indicate that the drivers for the LCD display (i.e. the framebuffer and backlight) and the QTouch buttons (i.e. the QT1070 device) are properly built, configured (in the Device Tree), and functional.

Beware that Qt (and its applications) require its own level of configuration in order to use touchscreen input.
IOW there are simpler methods of testing hardware functionality.

lucav wrote: During my investigations, i saw that the /dev/input/touchscreen0 (where i think should be the touchscreen input device because the factory image) doesn't exist.
Typically /dev/input/touchscreen0 is not a device node, but rather a symbolic link to to a /dev/input/eventn node.
The simplest explanation is that the standard Atmel build has no support in the SAM9N12-EK Device Tree for the touchscreen.

lucav wrote: Also i check the make configuration running from the buildroot-at91 folder: ... i don't see the "Touchscreen interface" option:
...
that i think should be there if i check the old linux kernel options here: https://how-to.fandom.com/wiki/How_to_c ... vers/input.

Maybe the linux kernel 4.14 doesn't have this option?
You're looking for a (deprecated) "Touchscreen interface" configuration that was removed way back in 2007 (before 2.6.24).

lucav wrote: Or i'm mistaking somewhere?
Referencing documentation that is more than a decade old and for a kernel version that barely supported AT91SAM9 SoCs is a mistake.
Instead you probably should be studying your board's schematics to understand how the touchscreen is connected.

The generic Atmel kernel configuration should be adequate.
The root problem is that there probably is no discrete touchscreen controller, but rather the ADC of the SoC is used.
But the standard Device Tree for the SAM9N12-EK does not configure the ADC at all.

Regards
lucav
Posts: 4
Joined: Sun Mar 17, 2019 1:41 pm

Re: SAM9N12-DM linux4sam 6.0 doesn't show input touchscreen

Wed Mar 20, 2019 10:36 am

blue_z wrote:
The root problem is that there probably is no discrete touchscreen controller, but rather the ADC of the SoC is used.
But the standard Device Tree for the SAM9N12-EK does not configure the ADC at all.

Regards
Good morning blue_z,
thanks to your suggestions i have modified the device tree file and now the touchscreen works (i mean, now i can see the "touch" events).
But, as i said i'm not an expert, i need more suggestions to put me on the right way (and sorry again if i'm mistake in some terms).

Testing with evtest give me:

Code: Select all

# evtest
No device specified, trying to scan all of /dev/input/event*
Available devices:
/dev/input/event0:      AT42QT1070 QTouch Sensor
/dev/input/event1:      at91_adc
/dev/input/event2:      gpio_keys
Select the device event number [0-2]: 1
Input driver version is 1.0.1
Input device ID: bus 0x19 vendor 0x0 product 0x0 version 0x0
Input device name: "at91_adc"
Supported events:
  Event type 0 (EV_SYN)
  Event type 1 (EV_KEY)
    Event code 330 (BTN_TOUCH)
  Event type 3 (EV_ABS)
    Event code 0 (ABS_X)
      Value   2272
      Min        0
      Max     4095
    Event code 1 (ABS_Y)
      Value   1725
      Min        0
      Max     4095
    Event code 24 (ABS_PRESSURE)
      Value   5378
      Min        0
      Max   16777215
Properties:
Testing ... (interrupt to exit)
Event: time 1167610266.552198, type 3 (EV_ABS), code 0 (ABS_X), value 1886
Event: time 1167610266.552198, type 3 (EV_ABS), code 1 (ABS_Y), value 1798
Event: time 1167610266.552198, type 3 (EV_ABS), code 24 (ABS_PRESSURE), value 6217
Event: time 1167610266.552198, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 1
Event: time 1167610266.552198, -------------- SYN_REPORT ------------
Event: time 1167610266.568045, type 3 (EV_ABS), code 0 (ABS_X), value 1954
Event: time 1167610266.568045, type 3 (EV_ABS), code 1 (ABS_Y), value 1774
Event: time 1167610266.568045, type 3 (EV_ABS), code 24 (ABS_PRESSURE), value 4504
Event: time 1167610266.568045, -------------- SYN_REPORT ------------
Event: time 1167610266.583876, type 3 (EV_ABS), code 0 (ABS_X), value 1958
Event: time 1167610266.583876, type 3 (EV_ABS), code 1 (ABS_Y), value 1782
Event: time 1167610266.583876, type 3 (EV_ABS), code 24 (ABS_PRESSURE), value 4313
Event: time 1167610266.583876, -------------- SYN_REPORT ------------
Event: time 1167610266.599712, type 3 (EV_ABS), code 0 (ABS_X), value 1937
Event: time 1167610266.599712, type 3 (EV_ABS), code 1 (ABS_Y), value 1766
Event: time 1167610266.599712, type 3 (EV_ABS), code 24 (ABS_PRESSURE), value 5986
Event: time 1167610266.599712, -------------- SYN_REPORT ------------
Event: time 1167610266.613271, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 0
Event: time 1167610266.613271, -------------- SYN_REPORT ------------
Now i have two questions:

1) When i start one of the Qt demos, i have noticed that the "touch" position is wrong. Do i need to calibrate the touchscreen? if yes, do i have to use tslib functions to calibrate?

2) What about the other ADC's pins (see the manual page below)? I mean, i would like to use one or two of those pin to measure some signals. Do i need to add the pin that i want to use in the device tree?

Image

Best regards
blue_z
Location: USA
Posts: 1956
Joined: Thu Apr 19, 2007 10:15 pm

Re: SAM9N12-DM linux4sam 6.0 doesn't show input touchscreen

Wed Mar 20, 2019 9:39 pm

lucav wrote: Now i have two questions:
But you have chosen to not respond to my questions regarding clarification of exactly what hardware you have and what configurations you are using.

If you "installed Qt 4" (which is now an obsolete package), then to what "demo" programs are you referring?
Current versions of the Atmel demos require Qt5.

lucav wrote: 1) When i start one of the Qt demos, i have noticed that the "touch" position is wrong. Do i need to calibrate the touchscreen? if yes, do i have to use tslib functions to calibrate?
Yes, you could, but it depends on the Qt environment.
lucav wrote: 2) What about the other ADC's pins (see the manual page below)? I mean, i would like to use one or two of those pin to measure some signals. Do i need to add the pin that i want to use in the device tree?
That depends on how you configured the ADC using the Device Tree.
The hardware is capable (but with limitations on triggering) according to the datasheet, but you'll have to experiment to see how well the software side performs.

Regards
lucav
Posts: 4
Joined: Sun Mar 17, 2019 1:41 pm

Re: SAM9N12-DM linux4sam 6.0 doesn't show input touchscreen

Wed Mar 20, 2019 11:08 pm

blue_z wrote: But you have chosen to not respond to my questions regarding clarification of exactly what hardware you have and what configurations you are using.
SAM9N12-EK with the display module
blue_z wrote: If you "installed Qt 4" (which is now an obsolete package), then to what "demo" programs are you referring?
Current versions of the Atmel demos require Qt5.
The demos compiled and installed thanks to the Qt (4) option using the "menuconfig". I know that Qt4 is an obsolete package, i will try to install Qt5 (my priority now is to configure the ADC pins).

Regards
blue_z
Location: USA
Posts: 1956
Joined: Thu Apr 19, 2007 10:15 pm

Re: SAM9N12-DM linux4sam 6.0 doesn't show input touchscreen

Wed Mar 27, 2019 1:33 am

lucav wrote: The demos compiled and installed thanks to the Qt (4) option using the "menuconfig".
The Buildroot package description refer to those as "examples".

I didn't mean that you couldn't use Qt4. The problem of using one obsolete package is that you encounter incompatibilities with other packages/libraries.
One solution is to use an older version of Buildroot that has the older compatible packages for Qt4.

You might find that the Atmel display module and touchscreen function better with Qt4 and tslib than Qt5.
When the Atmel demos upgraded to Qt5 and DRM, support for Atmel display modules and touchscreens of older EK boards was abandoned (and the focus shifted to Xplained boards and PDA displays).

Regards
lucav
Posts: 4
Joined: Sun Mar 17, 2019 1:41 pm

Re: SAM9N12-DM linux4sam 6.0 doesn't show input touchscreen

Wed Mar 27, 2019 9:47 am

blue_z wrote:
Wed Mar 27, 2019 1:33 am
lucav wrote: The demos compiled and installed thanks to the Qt (4) option using the "menuconfig".
The Buildroot package description refer to those as "examples".
No, i mean this option:
Image


However, i chose Qt4 because i don't have problem to install Qt4 instead i had compile errors when i tried to install Qt5 (but is off-topic here).

Regards

Return to “LINUX”

Who is online

Users browsing this forum: No registered users and 2 guests