USB host question

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

USB host question

1,752 次查看
elinaiman
Contributor I

I imported the "frdmk64f_host_hid_generic_freertos" example. When I connect a barcode reader I get the error

"enumeration failed". Can someone help to solve this. 

I noticed that the sysmpu driver is loaded. Do I have to disable the MPU to get this to work?

Thanks

标签 (1)
标记 (2)
0 项奖励
7 回复数

1,630 次查看
elinaiman
Contributor I

Yes, I have J21 shorted.

0 项奖励

1,630 次查看
Alexis_A
NXP TechSupport
NXP TechSupport

Hello Eli,

There are different reasons why this state can be called without being enumerated, one of these is if the descriptor length is to wide, the buffer set by default is 100 and if it's wider this state will be called. Another is if the device is detached in the enumeration process.

Is any of these two present? 

Best Regards,

Alexis Andalon

0 项奖励

1,630 次查看
elinaiman
Contributor I

Alexis, thanks for the TreeViewer.

In the k64f, the software never gets to "case kUSB_HostHidRunSetIdleDone:"

It goes through "case kUSB_HostHidRunIdle:" 7 times and then the enumeration failed error shows up.

0 项奖励

1,630 次查看
Alexis_A
NXP TechSupport
NXP TechSupport

Hello Eli,

If you're using the FRDM-K64, are you shorting the jumper J21? In case you're using the host functionality this jumper is needed.

Best Regards,

Alexis Andalon

0 项奖励

1,630 次查看
elinaiman
Contributor I

When I connect the barcode reader to my PC it enumerates and works fine. Using the Device Manager, it says that it is an HID device.

How do I find out if the descriptor has additional information that the host (in the K64F) can't handle. It would be nice if the host can give some clues as to why the enumeration failed.

0 项奖励

1,630 次查看
Alexis_A
NXP TechSupport
NXP TechSupport

Hello Eli,

What you could do is to check in the section where the descriptor is received and compare it with the one received by the PC.

In the following section you can check where the descriptor is received:

void USB_HostHidGenericTask(void *param)
{
 ...

        case kUSB_HostHidRunSetIdleDone: /* 3. hid get report descriptor */
            /* get report descriptor's length */
            hidDescriptor = NULL;
            descriptor    = (uint8_t *)((usb_host_interface_t *)genericInstance->interfaceHandle)->interfaceExtension;
            endPosition   = (uint32_t)descriptor +
 ...
}

The following app can help you to check the descriptor received by the PC.

Download USB Device Tree Viewer 3.4.0 

Best Regards,

Alexis Andalon

0 项奖励

1,630 次查看
Alexis_A
NXP TechSupport
NXP TechSupport

Hello Eli,

I don't think the reason for the bad enumeration is the SYSMPU. Are you sure the class that the barcode is using is the HID class and there isn't any need for the Host to implement extra steps?

The enumeration process should fail if in the descriptor there's additional information that the host can't process.

Best Regards,

Alexis Andalon

0 项奖励