We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
I have lock dead lock problem in PC windows xp service pack III (tested also in windows 7)
I already use hid generic single hid with success. Now I am trying to use LPC17xx composite Hid Hid generic + hid generic I use 2 interfaces Interface 0 for Hid 0 use endpoint 1 output 0x81 input (same endpoint) Interface 1 for Hid 1 use endpoint 0x84 input ----------------------------------------------------------- I use logical endpoint 4 because from table 185-fixed endpoint configuration in lpc17xx manual, that endpoint is one interrupt endpoint.
I already modify in Hid example NUM_INTERFACES 1 <---2 and modify in usb_core.c with 2 case the subbranches case HID_HID_DESCRIPTOR_TYPE case HID_HID_REPORT_DESCRIPTOR_TYPE ( see later in post) Enumeration seems successfull and endpoint 1 is working but when in PC I open second interfaces _mi01 from PC is possible to open stream but readfile lock in pc like that endpoint 4 is not working At the end of post output of usbview PC program has been modified from keil example and we already work successfully with single hid. \\?\hid#vid_17xx&pid_062a&mi_00#7&104386fe&....... \\?\hid#vid_17xx&pid_062a&mi_01#7&341ac4c0&.......
Descriptor used are:
#define HID_DESC_OFFSET 0x0012 #define HID2_DESC_OFFSET HID_DESC_OFFSET+HID_DESC_SIZE+USB_ENDPOINT_DESC_SIZE*2
#define HID_INPUT_REPORT_BYTES USB_PACKET_SIZE /* size of report in Bytes */ #define HID_OUTPUT_REPORT_BYTES USB_PACKET_SIZE /* size of report in Bytes */ #define USB_PACKET_SIZE 8 #define USB_MAX_PACKET0 8 ----------------------------------------------------------------- From Usbview Device Descriptor: bcdUSB: 0x0110 bDeviceClass: 0x00 bDeviceSubClass: 0x00 bDeviceProtocol: 0x00 bMaxPacketSize0: 0x08 (8) idVendor: 0x1722 idProduct: 0x062A bcdDevice: 0x0100 iManufacturer: 0x01 0x0409: "Elad " iProduct: 0x02 0x0409: "Composite TEST" iSerialNumber: 0x00 bNumConfigurations: 0x01
ConnectionStatus: DeviceConnected Current Config Value: 0x01 Device Bus Speed: Full Device Address: 0x01 Open Pipes: 3
Endpoint Descriptor: bEndpointAddress: 0x81 IN Transfer Type: Interrupt wMaxPacketSize: 0x0008 (8) bInterval: 0x20
Endpoint Descriptor: bEndpointAddress: 0x01 OUT Transfer Type: Interrupt wMaxPacketSize: 0x0008 (8) bInterval: 0x20
Endpoint Descriptor: bEndpointAddress: 0x84 IN Transfer Type: Interrupt wMaxPacketSize: 0x0008 (8) bInterval: 0x0A
Configuration Descriptor: wTotalLength: 0x0042 bNumInterfaces: 0x02 bConfigurationValue: 0x01 iConfiguration: 0x00 bmAttributes: 0xE0 (Bus Powered Self Powered Remote Wakeup) MaxPower: 0x32 (100 Ma)
Interface Descriptor: bInterfaceNumber: 0x00 bAlternateSetting: 0x00 bNumEndpoints: 0x02 bInterfaceClass: 0x03 (HID) bInterfaceSubClass: 0x00 bInterfaceProtocol: 0x00 iInterface: 0x00
HID Descriptor: bcdHID: 0x0111 bCountryCode: 0x00 bNumDescriptors: 0x01 bDescriptorType: 0x22 wDescriptorLength: 0x0019
Interface Descriptor: bInterfaceNumber: 0x01 bAlternateSetting: 0x00 bNumEndpoints: 0x01 bInterfaceClass: 0x03 (HID) bInterfaceSubClass: 0x00 bInterfaceProtocol: 0x00 iInterface: 0x00
Sound like you are working on this HID example, aren't you? C:\Keil\ARM\Boards\Keil\MCB1700\USBHID
> from PC is possible to open stream but readfile lock in pc like that endpoint 4 is not working
Maybe, your firmware doesn't put any packet to the EP4.
In this USBHID example, (1) the first packet is put to EP1 at USB_Configure_Event(), which is called at Set_Configuration request.
usbuser.c /* * USB Set Configuration Event Callback * Called automatically on USB Set Configuration Request */ #if USB_CONFIGURE_EVENT void USB_Configure_Event (void) { if (USB_Configuration) { /* Check if USB is configured */ GetInReport(); USB_WriteEP(HID_EP_IN, &InReport, sizeof(InReport)); // <--- (1) } } #endif
The second and latter packets for EP1 are provided (2) in USB_EndPoint1()
usbuser.c /* * USB Endpoint 1 Event Callback * Called automatically on USB Endpoint 1 Event * Parameter: event */ void USB_EndPoint1 (U32 event) { switch (event) { case USB_EVT_IN: GetInReport(); USB_WriteEP(HID_EP_IN, &InReport, sizeof(InReport)); // <--- (2) break; } }
If you would like to make EP4 work as EP1, you need to write similar code for EP4. To make USB_EndPoint4() work, this macro should be touched.
usbcfg_LPC17xx.h #define USB_EP_EVENT 0x0003 // <--- 0x0013
Tsuneo
Yes I made point 1 and 3 (2 already done before) and endpoint 4 was working. Thank you very much for your help. Grattoni Enore