Kinetis K60 MQX USB Host: Device enumeration problem

cancel
Showing results for 
Search instead for 
Did you mean: 

Kinetis K60 MQX USB Host: Device enumeration problem

953 Views
lukasgasser
Contributor II

We have a custom board with a Kinetis MK60DN512VLQ10 running an MQX 4.0.0 application.

Our application uses the USB HostMSC feature with the MFS library. We tested several different USB mass storage devices successfully.

Now we have a series of 8GB devices which SOMETIMES do not enumerate.

When the enumeration fails, the following sequence happens: We get a bus timeout in the setup phase of the first control transfer (get device descriptor). The USB Host driver (MQX KHCI low lever driver) retries and emits the token 15 times (NAK_COUNT) and gets bus-timeout (PID 0x00) repeatedly. When the device is unplugged and plugged in again, then it is sometimes enumerated and sometimes not. Once the device is enumerated, the MSC class driver and the MFS driver work with no problems!

Has anyone seen this before or has any ideas where to search for the solution?

Labels (1)
0 Kudos
2 Replies

114 Views
Carlos_Musich
NXP Employee
NXP Employee

Hi Lukas,

USB stack works with all the mass storage devices that meet MSD class specifications, if a device is not compliant with these specs it is possible that USB stack is not able to read it. There are some specific cases where USB stack implements a workaround to support some devices that are not compliant with USB MSD class, unfortuantely there is not an universal work around. I recommend to work with devices which are compliant with the spec.

Best regards,

Carlos

0 Kudos

114 Views
lukasgasser
Contributor II

Hi Carlos,

thanks for your reply. I share your opinion of using compliant devices only. Unfortunately, the mentioned USB Key appears to be compliant with the USB chapter 9 tests (verified with USB-IF Command verifier tool). Is there another compliance-check that verifies the basic USB device capabilities?

Although it is not fully compliant with the MSD class specs (according to the verifier tool), this should not yet be a problem in this case. The MFS driver does not even get informed when inserting the key, no MSD transactions take place. The timeout occurs on the very first token (Setup token of the "get device descriptor" control transfer) that's triggered by the "usb_dev_list_attach_device()" function, right after detecting the USB device speed.

Sequence: Key insert --> Interrupt(ISTAT.ATTACH) --> KHCI Attach call --> GetDeviceDescriptor --> Setup Token --> Bus Timeout

The GetDeviceDescriptor transfer is repeated 15 times.

In the USB-IF Command verifier tool, there is an enumeration test, which does 150 enumerations of the device. This test succeeds with the mentioned device... The enumeration of the device seems to be no problem on windows. One difference from windows USB to MQX USB is, that the windows stack sends as first transfer a get device descriptor with 64Bytes requested data, MQX requests 8Bytes. According to the spec. this makes no difference because the device must return the requested amount of data or - if the requested size is larger than the available data - the size of the requested descriptor.

This is what I know so far, maybe this information helps to get closer to where the problem lies...

Best regards,

Lukas

0 Kudos