Project

General

Profile

USB touch screen support for AM572x development board

Added by Sandeep Sivadas over 1 year ago

Hi,

We are using a Capacitive HDMI TFT Module (Make: Newhaven) with AM572x development board. On booting the linux with SD card provided with the Development kit, the USB touch is not working.
We can connect mouse device with the USB port in Development board and access the TFT display.
Is there touch support in the default display setting provided with the bootable Linux SD card.
How can we enable USB touch for our TFT Display module?

Details of TFT display we are using is
P/N : NHD-5.0-HDMI-N-RTXL-CTU
https://newhavendisplay.com/5-0-inch-premium-capacitive-hdmi-tft-module/

Thanks and regards
Sandeep S


Replies (6)

RE: USB touch screen support for AM572x development board - Added by Jonathan Cormier over 1 year ago

Newhaven doesn't provide a lot of details on this USB touch interface other than it's a "USB-HID device". Which I would normally expect to fall under the same standard driver used by the USB mouse. But since the mouse worked and this didn't we need to dig deeper.

Can you capture the USB PID/VID of the touchscreen? This will often be printed out by the kernel when a usb device is plugged in. With this, I can search through the kernel source to see if there are any drivers which support this device.

Or can be gotten from the "lsusb" command

root@mitysom-am57x:~# lsusb
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 002: ID 0451:8142 Texas Instruments, Inc. TUSB8041 4-Port Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

And would also be useful to have the output from "lsusb -v"

There are over 100 hid drivers in the kernel so there are good chances we just need to find and enable to correct one.

RE: USB touch screen support for AM572x development board - Added by Sandeep Sivadas over 1 year ago

Hi Jonathan,

Thank you for your support.

When i connected the Newhaven Display's USB with the AM572x Development kit, got the following printout messages

[ 3267.951725] usb 1-1.2: new full-speed USB device number 5 using xhci-hcd
[ 3268.083379] usb 1-1.2: New USB device found, idVendor=0461, idProduct=0022, bcdDevice= 1.00
[ 3268.091857] usb 1-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[ 3268.099267] usb 1-1.2: Product: Newhaven Display
[ 3268.104064] usb 1-1.2: Manufacturer: NHD
[ 3268.161296] input: NHD Newhaven Display as /devices/platform/44000000.ocp/488c0000.omap_dwc3_2/488d0000.usb/xhci-hcd.1.auto/usb1/1-1/1-1.2/1-1.2:1.0/0003:0461:0022.0003/input/input2
[ 3268.177894] hid-generic 0003:0461:0022.0003: input: USB HID v1.00 Device [NHD Newhaven Display ] on usb-xhci-hcd.1.auto-1.2/input0

Then tried the lsusb command and got the output as shown below

root@mitysom-am57x:~# lsusb
Bus 001 Device 003: ID 0461:0022 Primax Electronics, Ltd
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 002: ID 0451:8142 Texas Instruments, Inc. TUSB8041 4-Port Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Then tried the lsusb -v command and the output obtained is attached as text file. Kindly look in to it.

With regards
Sandeep S

lsusb -v.txt (10.7 KB) lsusb -v.txt lsusb -v printout

RE: USB touch screen support for AM572x development board - Added by Jonathan Cormier over 1 year ago

hid-generic 0003:0461:0022.0003: input: USB HID v1.00 Device

Okay good news, looks like the HID driver is getting loaded.

You should be able to use the "evtest" command to test the input device to make sure touch events are working.

Also, Looks like weston may need some kind of configuring to get it to work with a touchscreen. Some links I found with a quick google search.

https://community.nxp.com/t5/i-MX-Processors/Want-to-enable-the-touchscreen-support-on-weston/td-p/1469966
https://askubuntu.com/questions/1414431/weston-is-not-receiving-touch-input-regarding-touch-input-as-mouse-input

Useful tools from the links:

evtest
weston-touch-calibrator
weston-simple-touch

I don't have a USB touchscreen to play with so not sure how to help you. I would recommend reaching out to Newhaven as they may have experience with wayland/weston and know how to configure it. Please update us if you figure out any magic sauce.

RE: USB touch screen support for AM572x development board - Added by Sandeep Sivadas over 1 year ago

Hi Jonathan,

We tried the evtest and weston commands. But the matrix GUI application is not responding to USB touch.
Then we stop the matrix GUI application and opened the wayland terminal, here the USB touch is working.
We tried weston-flower command and got the output successfully, USB touch is also working fine.

is the Matrix GUI application is touch enabled?

We are now trying out the Qt application as per the wiki tutorial. If you have any applications specifically for touch screen application.please share the same.

Thanks and regards
Sandeep S

RE: USB touch screen support for AM572x development board - Added by Jonathan Cormier over 1 year ago

Sandeep Sivadas wrote in RE: USB touch screen support for AM572x development board:

Hi Jonathan,

We tried the evtest and weston commands. But the matrix GUI application is not responding to USB touch.
Then we stop the matrix GUI application and opened the wayland terminal, here the USB touch is working.
We tried weston-flower command and got the output successfully, USB touch is also working fine.

Okay, that is good news. At least some things are working with the touch screen.

is the Matrix GUI application is touch enabled?

So after some quick googling, I'm seeing a lot of results describing issues between touch support, weston, and qt applications. Some seem to indicate this should have been fixed but I'm not sure.
https://github.com/eichenberger/qt-widgets-touch-translation
https://wiki.qt.io/WestonTouchScreenIssues

My recommendation would be to launch the qt application without weston running. You probably don't want/need a desktop manager like weston for your product so you'll likely want to do this eventually anyways. Hopefully without weston the touch events will work correctly.
Note: When you get past the checkout phase, it will be a good idea to create a custom yocto filesystem without weston installed so you don't have to go in and manually stop it. This will also give you a chance to slim down your filesystem to only the tools you need.

  • Prevent weston and matrix-gui from starting at boot
    root@mitysom-am57x:~# systemctl disable weston matrix-gui-2.0
    weston.service is not a native service, redirecting to systemd-sysv-install.
    Executing: /lib/systemd/systemd-sysv-install disable weston
    update-rc.d: /etc/init.d/weston exists during rc.d purge (continuing)
     Removing any system startup links for weston ...
      /etc/rc0.d/K20weston
      /etc/rc1.d/K20weston
      /etc/rc2.d/S09weston
      /etc/rc5.d/S09weston
      /etc/rc6.d/K20weston
    Synchronizing state of matrix-gui-2.0.service with SysV service script with /lib/systemd/systemd-sysv-install.
    Executing: /lib/systemd/systemd-sysv-install disable matrix-gui-2.0
    update-rc.d: /etc/init.d/matrix-gui-2.0 exists during rc.d purge (continuing)
     Removing any system startup links for matrix-gui-2.0 ...
    Removed /etc/systemd/system/multi-user.target.wants/matrix-gui-2.0.service.
    root@mitysom-am57x:~# systemctl stop weston matrix-gui-2.0         
    
  • Launch qt application without weston
    root@mitysom-am57x:~# ./HelloWorld -platform eglfs
    
  • Similarly the matrix gui can be launched
    root@mitysom-am57x:~# /usr/bin/matrix_browser http://localhost:80/ -platform eglfs
    

Note that since we aren't relying on weston to handle input events, this page may be useful. https://doc.qt.io/qt-5/inputs-linux-device.html#touch Though hopefully the defaults will just work.

RE: USB touch screen support for AM572x development board - Added by Jonathan Cormier over 1 year ago

Note you can update the command line args for the HelloWorld example to work without weston as well.

    (1-6/6)
    Go to top
    Add picture from clipboard (Maximum size: 1 GB)