So I did found a nice 7″ Display for my Windows 10 IoT Raspberry Pi (see my precedent post for the full story).
Ok, the display works. However, how about the touch functionality?
Here is the connection schema:
When attached to the USB port, the system fails to recognize the device. Too bad! I thought it was a sort of mouse that just send a clicked event with the screen coordinate of the touch.
I decided to replace the Raspberry card with my Surface Pro 1 to have better control and check the touch to USB controller functionality.
I looked for a device driver and found that, as expected, the driver for XP/Win7/Win8/Win8.1 suggested by Sain Smart product page worked also with Windows 10 on my PC.
So long so good, but what about our Raspberry Pi 2? I can’t install an x86 driver on it, because it surely wouldn’t work on an ARM architecture!
I decided to investigate on the issue, and I started learning about drivers from scratch. Here is the learning path I’ve followed:
- WinHEC Shenzhen 2015 keynote by Don Box: Developing for the Windows 10 Device Platform
-
Getting started with Windows drivers (this is the order I suggest):
- What is a driver?
- Concepts for all driver developers (really important, read all the sub content parts)
- Do you need to write a driver?
- Choosing a driver model
-
Universal Serial Bus (on MSDN):
-
Concepts for all USB developers:
-
-
The USB specifications (on USB Implementers Forum web site):
- USB Core Specification
- HID Information
- Device Class Definition for HID 1.11 (a pdf document)
The short story is that Windows 10 introduce a new driver model, called Universal Driver, and there are many ways to avoid building a new driver from scratch. Moreover, a simple HID device should be automatically managed by the PnP (Plug ‘n play) system using one of the predefined USB drivers already made by Microsoft and available also in the Raspberry Pi version of Windows 10 IoT.
To have a better understanding of why the PnP system was not able to handle the device I followed the instructions to install WDK 10 on my Surface Pro 1 machine. Is worth noting that the WDK installation process install also the Windows Debugger Tools.
Finally, I uninstalled the touch device driver previously installed, launched the USB View utility (part of the Windows Debugger Tools) and connected the “touch to usb” device:
As you can see, the device is in the list (at Port 2) and the information exchange completed. Note that:
- The PnP system couldn’t load a driver so we don’t have an open connection after the initial data exchange (no open pipes!);
- The Device Class is 0x00 (and this is ok for a HID device, see below);
- The idVendor and the idProduct are defined (we’ll use this info for our “USBTest” Universal Windows App, more on this on next post);
- The Interface Class is 0xFF (and this is the problem, because it should be 0x03);
From the USB Core Specification documentation, we know that the class code information identify a device’s functionality and that PnP use that code to load a device driver based on that functionality. On some device (and HID devices follow this rule) the device’s functionality is identified by the interface code, and in this case the device class has to be 0x00.
From the Device Class Definition for HID 1.11 documentation, we know that these devices always have a class code of 0x00 and an interface code of 0x03. In addition, HID devices have a limited use of the subclass code. For a non-bootable device, the subclass is always 0x00.
So the main problem of the “touch to USB” device is that it declares an interface class of 0xFF that is not the expected value and the PnP system do not recognize it as a HID device and cannot find a default driver for it.
On next post, we will develop a simple Universal Windows App to try to connect with the “touch to Usb” device using the Windows 10 core API (Windows.Devices.Usb namespace). This will not solve our problem but will help us better understand how to deal with that, testing some assumption about the device. I want to check if I’ll be able to get touch events and the associated coordinates.
While waiting for the next episode, you can dig on the suggested documentation.
Happy coding!
Sanlie
Jul 3, 2015
Hi Nic, do you have any progress on this thing? I have same situation and wish you came up with some clues to make touch-to-usb work on win iot..
Lancelot
Jul 6, 2015
Loving this series, cant wait to read the next installment.
sgtKK
Jul 10, 2015
Thanks for the information!
We have the exact same setup and issues, have you had any success trying to read the device data using the Windows.Devices.Usb namespace ?
Eric Renken
Jul 11, 2015
I was wondering if you got a driver to work with this device and how you got it installed on the Raspberry Pi 2. For some prototyping I really would like to get this to work.
John
Jul 18, 2015
This was good. When will part 2 be here? Im really hoping to get touch working with win10 for pi 2
John
Jul 20, 2015
This was good. I am having the exact same problem with getting my touch screen(sainsmart 7″) to work with windows 10 arm on my pi 2. Please keep trying to get a driver working!
Justin
Aug 27, 2015
I’m in the same boat with my touch screen on Windows 10 IoT. Looking forward to part 2!
John
Sep 6, 2015
After a couple hours of googling I landed on your site Nicolò, awesome overview – any chance that there is a driver that is ready for Windows IoT?
Marcus
Sep 7, 2015
You can also buy another touch controller.
AR1100 works nicely. Done this myself cause I needed this touch to work as soon as possible.
Can be bought at adafruit for 10$.
It has to be configured on a windows pc, but as soon its calibratet and such, it works nicely with Windows IoT on RPi2
Stefan
Sep 21, 2015
Hi Nicolò,
are there any news for the second part?
I would be delighted.
Best regards
Stefan
Mark Rowe
Oct 14, 2015
Thank you very much for this post. I have tackled all sorts of business problems and engineering problems. But not having any drivers to work with, with most of my Pi parts has been frustrating!
I was looking for exactly a post like this to help me on my way to starting to fix the Drivers and possibly start posting for a community effort.
Thank you, this saved me time and energy!
Shawn Wilsher
Nov 18, 2015
https://github.com/derekhe/waveshare-7inch-touchscreen-driver is an “open source” user-space driver for linux. The readme file has some information that might be interesting as well.
Elia Giusti
Sep 5, 2018
Dear Nicolò,
do you have any extra documentation about writing a Universal driver for touchscreen monitor?
I need to write one for a project, to interface a Dell 24″ touch monitor to Rpi 2 w/ win 10 IoT, but every time i plugged in the monitor’s usb rpi crashed.
Let me know if you can help me.
Best regards,
Have a nice day,
Elia.
Copyright © 2013 Nicolò Carandini - This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License