Hi,
I'm on the board MCB1700. I took the example of Keil (C:\Keil\ARM\Boards\Keil\MCB1700\RL\USB\RTX_HID) I modify the code following the instructions in this forum : http://www.keil.com/forum/17770/ It works well with 64 bytes, but when I change to 300 bytes, It does not work. The device is not well recognized.
This is what I changed.
usbdesc.c /* Endpoint, HID Interrupt In */ USB_ENDPOINT_DESC_SIZE, /* bLength */ USB_ENDPOINT_DESCRIPTOR_TYPE, /* bDescriptorType */ USB_ENDPOINT_IN(1), /* bEndpointAddress */ USB_ENDPOINT_TYPE_INTERRUPT, /* bmAttributes */ WBVAL(0x012c), /* wMaxPacketSize */<----- 300 bytes 0x01, /* 1ms */ /* bInterval */ /* Endpoint, HID Interrupt Out */ // rajout EP OUT USB_ENDPOINT_DESC_SIZE, /* bLength */ USB_ENDPOINT_DESCRIPTOR_TYPE, /* bDescriptorType */ USB_ENDPOINT_OUT(1), /* bEndpointAddress */ USB_ENDPOINT_TYPE_INTERRUPT, /* bmAttributes */ WBVAL(0x012c), /* wMaxPacketSize */<----- 300 bytes 0x01, /* 1ms */ /* bInterval */
hid.h #define HID_ReportCountS(x) 0x96,(x&0xFF),((x>>8)&0xFF) //add to the table HID_ReportDescriptor[]
hiduser.h /* HID report size (count) */ #define HID_INPUT_REPORT_BYTES 300 /* size of report in Bytes */ #define HID_OUTPUT_REPORT_BYTES 300 /* size of report in Bytes */ #define HID_FEATURE_REPORT_BYTES 300 /* size of report in Bytes */
Here is the configuration on the PC side using the software USB View.
Device Descriptor: bcdUSB: 0x0200 bDeviceClass: 0x00 bDeviceSubClass: 0x00 bDeviceProtocol: 0x00 bMaxPacketSize0: 0x40 (64) idVendor: 0xC251 idProduct: 0x2201 bcdDevice: 0x0100 iManufacturer: 0x01 0x0409: "Keil Software" iProduct: 0x02 0x0409: "Keil MCB1700 HID" iSerialNumber: 0x03 0x0409: "0001A0000000" bNumConfigurations: 0x01 ConnectionStatus: DeviceConnected Current Config Value: 0x00 Device Bus Speed: Full Device Address: 0x02 Open Pipes: 0 Configuration Descriptor: wTotalLength: 0x0029 bNumInterfaces: 0x01 bConfigurationValue: 0x01 iConfiguration: 0x00 bmAttributes: 0x80 (Bus Powered ) MaxPower: 0x32 (100 Ma) Interface Descriptor: bInterfaceNumber: 0x00 bAlternateSetting: 0x00 bNumEndpoints: 0x02 bInterfaceClass: 0x03 (HID) bInterfaceSubClass: 0x00 bInterfaceProtocol: 0x00 iInterface: 0x04 0x0409: "HID" HID Descriptor: bcdHID: 0x0100 bCountryCode: 0x00 bNumDescriptors: 0x01 bDescriptorType: 0x22 wDescriptorLength: 0x0024 Endpoint Descriptor: bEndpointAddress: 0x81 IN Transfer Type: Interrupt wMaxPacketSize: 0x012C (300) bInterval: 0x01 Endpoint Descriptor: bEndpointAddress: 0x01 OUT Transfer Type: Interrupt wMaxPacketSize: 0x012C (300) bInterval: 0x01
And with the software USBlyser, i don't see the "Interface 0 HID Report Descriptor". (I have an exclamation-mark on the USB) I searched the forum but I found nothing for my problem. if someone has an idea? thank you.
hi tsuneo,
thank for you help.
If I fixed my reports a 64 and I send several packets, there is no real difference ?