Author Topic: HID. Several issues  (Read 848 times)

puppdn

  • Member
  • ***
  • Posts: 19
HID. Several issues
« on: March 15, 2017, 01:57:49 pm »
Hi Jan!
Well I need help again.
Now my device recognize by Windows 7 x64 but sometimes it's not.
1 of  5 attempt is succesful. Otherwise Windows cant't recognize device (In device manager - unknown device) or Windows recognize device, but device manger appears that: "This device cannot start." (error Code 10).

And second.
If device succesfull recognized I can read and write data. (Find device, get handle by createfile(), then readfile() and writefile())
After approximate 20+ successfull attempt to writefile()-readfile() client program is hang  OR whole OS Windows is hang. Mouse not move, ctrl+alt+del not working. Only RESET is helpful. USB host conroller goes crazy& Why&

« Last Edit: May 16, 2017, 03:50:03 am by puppdn »

bpaddock

  • Member
  • ***
  • Posts: 31
Re: HID. Severale issues
« Reply #1 on: March 16, 2017, 08:58:21 am »
Does your test machine have any hubs made by different manufactures?
Does the device behave differently on different hub?

I've personally run into having AVR sample code work fine on an Intel hub and be flaky on NEC hub both in the same PC.

Someone recently reported this on the NXP Kinetis forum:

"It is actually not OS related but it seems that the KL27Z has
issues with certain PC host hubs. Specifically, the KL27Z seems to
always work with Intel 8 C220 host hubs (across multiple OS's) and it
never works with the KL27Z on Intel 6 C200 host hubs. However, it
always to connects if I go through an unpowered USB hub, regardless of
the PC's host hub."

Jan, do you have an insight to these kind of problems?


Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 2625
    • Lakeview Research
Re: HID. Severale issues
« Reply #2 on: March 16, 2017, 10:46:45 am »
One reason why a device doesn't enumerate every time is timing issues with the control requests.

Assuming USB 2.0, the control endpoint MUST return ACK in the Setup stage, and must return data, ACK, NAK, or NYET as appropriate in the Data and Status stages that follow (or STALL for unsupported request).

A hardware-based protocol analyzer will show any errors. If you don't have a protocol analyzer, use whatever debugging tools you have to try to determine if the control endpoint is responding to every received token packet.

The same is true for IN and OUT endpoints.   

When this is the case, the fault is not with the host or hub, but with device firmware that is not complying with the spec.


puppdn

  • Member
  • ***
  • Posts: 19
Re: HID. Severale issues
« Reply #3 on: May 16, 2017, 03:48:34 am »
Solved. Stupid designer (it's me) wrote bad firmware for MCU, at particular ugly initialization of USb pins.

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 2625
    • Lakeview Research
Re: HID. Several issues
« Reply #4 on: May 16, 2017, 12:54:32 pm »
Glad you got it solved; thanks for reporting back!