View previous topic :: View next topic |
Author |
Message |
James E. Hewson
Joined: 16 Jul 2010 Posts: 3
|
USB on Windows 98 SE |
Posted: Fri Jul 16, 2010 2:53 pm |
|
|
Hello,
I have created an embedded device that uses the PIC18F2550. The device includes the CCS USB stack and enumerates as a composite HID Keyboard and HID Compliant Device (both at the same time). Everything works great under Windows 2000, XP and 7.
However, under Windows 98 SE there is a problem. When I plug the USB cable into the device it enumerates correctly (using the native Windows 98 SE drivers) and the HID Keyboard and HID Compliant Device work as expected. But when I unplug the USB cable from the device, Windows 98 SE hangs (that is, msgsrv32.exe hangs) and I have to re-boot the PC.
I have seen the same behavior on four different Windows 98 SE PCs.
How do I resolve this issue and get my device working correctly under Windows 98 SE (and still have it work under Windows 2000, XP and 7)?
Thanks,
James. |
|
|
FvM
Joined: 27 Aug 2008 Posts: 2337 Location: Germany
|
|
Posted: Fri Jul 16, 2010 3:05 pm |
|
|
I don't think, that it's a device side problem. These things happen, when the USB cable is unplugged before the PC application connected to the USB device closes the connection and the application doesn't implement a suitable timeout. I remember, that a similar issue exists e.g. with Win98 Hyperterminal and virtual COM port. |
|
|
James E. Hewson
Joined: 16 Jul 2010 Posts: 3
|
|
Posted: Fri Jul 16, 2010 3:15 pm |
|
|
Thanks for the response.
Please keep in mind that there is no "PC application" in this situation. Since the embedded device is an HID Keyboard, the built-in Windows 98 drivers are handling everything.
Also, I have a commercial USB Keyboard that works correctly when plugged in or unplugged from the same Windows 98 PC. As it turns out, the commercial USB Keyboard also enumerates as both an HID Keyboard and an HID Compliant Device (just like my embedded device), so it's a pretty close approximation to what I am attempting to do--and it works!
Thanks,
James. |
|
|
James E. Hewson
Joined: 16 Jul 2010 Posts: 3
|
|
Posted: Fri Jul 23, 2010 5:17 pm |
|
|
Problem solved!
With the excellent help of Darren Rook (CCS), this problem has been solved. Here's the deal...
My code was completely ignoring any data that came back from the PC to the HID Keyboard (e.g., the LED status data). That is, I was never calling the usb_get_packet() function to clear the incoming buffer. Apparently Windows 2000/XP/7 are okay with that situation. However, Windows 98 is not okay with that situation. It appears that Windows 98 was sending data to the HID Keyboard and hanging up while waiting for the data to be properly read by the HID Keyboard. Since my HID Keyboard was not "properly" reading the data, Windows 98 was getting messed up.
Thanks to all for you helpful suggestions. |
|
|
|