USB HID input reports(response to host) corrupted with String descriptor responses

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

USB HID input reports(response to host) corrupted with String descriptor responses

2,839 Views
rahulshah
Contributor I

Hi,

We are using the LPC55S28 controller and port USB-HID driver from 2.8.0 SDK "dev_hid_generic_bm" example code. We are using USB0 at Full speed.

In that we are seeing issue during communication with host. In wireshark logs we can see that HID endpoint response (input reports) contain string descriptor responses and due to that  response packets having malformed data.

Here i have attached wireshark logs.
In logs packet number #210861 contain 1050 bytes of input request from host. On that request device need to send 4 responses of 287 bytes. Packet number #210871, #210889, #210905, #210921 is the responses and that packet and responses are proper.

Same way device receives another request in #210933 packet. In between process of responses another string descriptor request received. Because of that HID response (packet number #210945, size 189 bytes instead of 287 bytes) is malformed and contains string descriptor response.

Is there any issue in driver code, by which control and data endpoint responses merged and make it corrupted?

Regards,
Rahul Shah

Labels (2)
0 Kudos
Reply
6 Replies

2,746 Views
rahulshah
Contributor I

Hi Alice,

I have compared SDK-29.1 with SDK-2.8.0 and integrate USB related difference in our code. Still facing the same issue.

Regards,

Rahul Shah

0 Kudos
Reply

2,675 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

 

Hello Rahul Shah,

I download the project on run it on my side, it seems there is no issue:

Alice_Yang_0-1620379922745.png

And frankly speaking, I know little about wireshark.

I think you can refer to readme to run this demo, check whether  there is function issue on your side,

I attached it for you.

 

BR

Alice

 

0 Kudos
Reply

2,798 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello rahulshah,

Sorry I haven't wireshark, so can't open your attachment.

Dose the packets  your said all from the same device? From the information wireshark support, can you

find which endpoint responds.

And how about the demo "dev_hid_generic_bm" under SDK v2.9 ? Dose it can work well on you side?

 

BR

Alice

0 Kudos
Reply

2,740 Views
rahulshah
Contributor I

Hi Alice,

Adding to that , i have add debugs and printed the endpoint number, Length & Buffer address in "USB_DeviceLpc3511IpEndpointPrime" function before adding to the command status list "epCommandStatusList", and all are proper. Buffer adresses are as below:

for string descriptor response  : buffer address : <s_SetupAndEpReservedData + 64>

for data response send : buffer address : <s_SetupAndEpReservedData+192> / <s_SetupAndEpReservedData+256>

So actually filling of data in command/status list is proper. But somehow after that it may modified in USB driver and shown as corrupted (size and content not as per what we have send) when sending.

Regards,

Rahul Shah

0 Kudos
Reply

2,700 Views
rahulshah
Contributor I

Hi ,

Adding more information, In our software we have configured CPU system clock to 12MHz.

Regards,

Rahul Shah

0 Kudos
Reply

2,790 Views
rahulshah
Contributor I

Hi Alice,

Thanks for reply.

Yes packets are from same device. Endpoint 0x81-IN responds. 

I have attached image , in that highlighted 127 length packet is malformed packet. It should be of 287 bytes. And in that I have highlighted data (starting from idx:0x53, i.e 123456Z123456) which is actually our customize string descriptor value.

So the string descriptor value merged with input reports and packet corrupted. 

Adding to that our host application sending "STRING descriptor request" at every 100ms. During issue i can see that input report response is in progress and in between string descriptor request received.

We have ported USB driver from SDK-2.8.0. Is there any major difference between 2.8.0 & 2.9.0?

 

Regards,

Rahul Shah

0 Kudos
Reply