Hi,
I wanted to build USB host application which enumerates all class of device.I need to read the endpoint 0 configuration descriptor and other endpoints for receiving and sending data without knowing the class of device.I tried this but not detecting the enumerated device.Below are the setup i'm using:
I have attached my code sample.So,please kindly help me since i'm working on USB for the first time in MQX.
Original Attachment has been moved to: usb_host_activity.h.txt.zip
Original Attachment has been moved to: usb_host_activity.c.txt.zip
Hi,
I checked at your code and you have in the DriverInfoTable the next:
static usb_host_driver_info_t DriverInfoTable[] =
{
{
{0x00,0x00}, /* Vendor ID per USB-IF */
{0x00,0x00}, /* Product ID per manufacturer */
0, /* Class code */
0, /* Sub-Class code */
0, /* Protocol */
0, /* Reserved */
usb_host_device_event /* Application call back function */
},
/* USB 1.1 hub */
{
{0x00,0x00}, /* Vendor ID per USB-IF */
{0x00,0x00}, /* Product ID per manufacturer */
USB_CLASS_HUB, /* Class code */
USB_SUBCLASS_HUB_NONE, /* Sub-Class code */
USB_PROTOCOL_HUB_ALL, /* Protocol */
0, /* Reserved */
#if USBCFG_HOST_HUB
usb_host_hub_device_event /* Application call back function */
#endif
},
{
{0x00,0x00}, /* All-zero entry terminates */
{0x00,0x00}, /* driver info list. */
0,
0,
0,
0,
NULL
}
};
This table shoud contain the devices supported and handled by the application. Therefore you should place all the class and type of devices you need to support. The host stack should generate the attached callback when a device matches one of these entries.
If the attach event does not generate, that means that your entries are not correct in the DriverInfoTable. Again, should place all the class and type of devices you need to support.
Regards,
Alejandro
Thanks Alejandro,
Below DriverInfoTable[] is now able to detect all class of device.Because, 0xFF base class tells that it is device or interface which is explained in USB class codes in www.usb.org.
static USB_HOST_DRIVER_INFO DriverInfoTable[] =
{
{
{0x00,0x00}, /* Vendor ID per USB-IF */
{0x00,0x00}, /* Product ID per manufacturer */
0xFF, /* Class code ALL CLASS */
0xFF, /* Sub-Class code ALL SUBCLASS */
0xFF, /* Protocol ALL PROTOCOL */
0, /* Reserved */
usb_host_event /* Application call back function */
},
/* USB 1.1 hub */
{
{0x00,0x00}, /* Vendor ID per USB-IF */
{0x00,0x00}, /* Product ID per manufacturer */
USB_CLASS_HUB, /* Class code */
USB_SUBCLASS_HUB_NONE, /* Sub-Class code */
USB_PROTOCOL_HUB_ALL, /* Protocol */
0, /* Reserved */
usb_host_hub_device_event /* Application call back function */
},
{
{0x00,0x00}, /* All-zero entry terminates */
{0x00,0x00}, /* driver info list. */
0,
0,
0,
0,
NULL
}
};
Hi Manju,
You are right. Nevertheless I suggest you to use as many different structures as you need. If you use it in that way the usb_host_event callback requires to handle all the different event for the different devices. And it would be harder to implement it.
Hi Alejandro,
I need class driver for USB wireless HWA(Host Wire adapter) class for MQX.I want to read descriptor from Dlink USB wifi adapter connected to TWRVF65GS10 tower board.I'm not able to get the Rpipe descriptor for USB Wifi adapter using _usb_host_ch9_get_descriptor(). Please help me.
Dear Alejandro,
Thank you very much.
Anyone please help me on this post