This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Report ID with different size

Hello,

I'm trying to make a report descriptor that contains many report IDs with different size, some with 1 byte and some with 2 bytes.
At first is that possible?

I supposed that it's possible, and changed the wMaxPacketSize to 3 bytes (the max of bytes to send + one byte for the report ID) , but when I send data from the host to my stm32 I only receive the first 2 bytes the report ID and the next byte.
Am I missing something? Is there something else that I have to change in the descriptor file?

Thanks,

Parents
  • Thank you for this software. I tried to send data as you told me at least with this software I'm getting an error message : "error : a device attached to the system is not functioning (1f)" I couldn't find any documentation about this software. Can you please help me what could be the problem.
    I've already configured wMaxPcketSize in the endpoint out descriptor to allow three bytes transfer.

    What else do I have to do?

    this is my hole descriptor file

     0x09, /* bLength: Configuration Descriptor size */
        USB_CONFIGURATION_DESCRIPTOR_TYPE, /* bDescriptorType: Configuration */
        CUSTOMHID_SIZ_CONFIG_DESC,
        /* wTotalLength: Bytes returned */
        0x00,
        0x01,         /* bNumInterfaces: 1 interface */
        0x01,         /* bConfigurationValue: Configuration value */
        0x00,         /* iConfiguration: Index of string descriptor describing
                                     the configuration*/
        0xC0,         /* bmAttributes: Self powered */
        0x32,         /* MaxPower 100 mA: this current is used for detecting Vbus */
    
        /************** Descriptor of Custom HID interface ****************/
        /* 09 */
        0x09,         /* bLength: Interface Descriptor size */
        USB_INTERFACE_DESCRIPTOR_TYPE,/* bDescriptorType: Interface descriptor type */
        0x00,         /* bInterfaceNumber: Number of Interface */
        0x00,         /* bAlternateSetting: Alternate setting */
        0x02,         /* bNumEndpoints */
        0x03,         /* bInterfaceClass: HID */
        0x00,         /* bInterfaceSubClass : 1=BOOT, 0=no boot */
        0x00,         /* nInterfaceProtocol : 0=none, 1=keyboard, 2=mouse */
        0,            /* iInterface: Index of string descriptor */
        /******************** Descriptor of Custom HID HID ********************/
        /* 18 */
        0x09,         /* bLength: HID Descriptor size */
        HID_DESCRIPTOR_TYPE, /* bDescriptorType: HID */
        0x10,         /* bcdHID: HID Class Spec release number */
        0x01,
        0x00,         /* bCountryCode: Hardware target country */
        0x01,         /* bNumDescriptors: Number of HID class descriptors to follow */
        0x22,         /* bDescriptorType */
        CUSTOMHID_SIZ_REPORT_DESC,/* wItemLength: Total length of Report descriptor */
        0x00,
        /******************** Descriptor of Custom HID endpoints ******************/
        /* 27 */
        0x07,          /* bLength: Endpoint Descriptor size */
        USB_ENDPOINT_DESCRIPTOR_TYPE, /* bDescriptorType: */
    
        0x81,          /* bEndpointAddress: Endpoint Address (IN) */
        0x03,          /* bmAttributes: Interrupt endpoint */
        0x02,          /* wMaxPacketSize: 2 Bytes max */
        0x00,
        0x20,          /* bInterval: Polling Interval (32 ms) */
        /* 34 */
    
        0x07,       /* bLength: Endpoint Descriptor size */
        USB_ENDPOINT_DESCRIPTOR_TYPE,       /* bDescriptorType: */
                            /*      Endpoint descriptor type */
        0x01,       /* bEndpointAddress: */
                            /*      Endpoint Address (OUT) */
        0x03,       /* bmAttributes: Interrupt endpoint */
        0x03,       /* wMaxPacketSize: 2 Bytes max  */
        0x00,
        0x20,       /* bInterval: Polling Interval (20 ms) */
    

Reply
  • Thank you for this software. I tried to send data as you told me at least with this software I'm getting an error message : "error : a device attached to the system is not functioning (1f)" I couldn't find any documentation about this software. Can you please help me what could be the problem.
    I've already configured wMaxPcketSize in the endpoint out descriptor to allow three bytes transfer.

    What else do I have to do?

    this is my hole descriptor file

     0x09, /* bLength: Configuration Descriptor size */
        USB_CONFIGURATION_DESCRIPTOR_TYPE, /* bDescriptorType: Configuration */
        CUSTOMHID_SIZ_CONFIG_DESC,
        /* wTotalLength: Bytes returned */
        0x00,
        0x01,         /* bNumInterfaces: 1 interface */
        0x01,         /* bConfigurationValue: Configuration value */
        0x00,         /* iConfiguration: Index of string descriptor describing
                                     the configuration*/
        0xC0,         /* bmAttributes: Self powered */
        0x32,         /* MaxPower 100 mA: this current is used for detecting Vbus */
    
        /************** Descriptor of Custom HID interface ****************/
        /* 09 */
        0x09,         /* bLength: Interface Descriptor size */
        USB_INTERFACE_DESCRIPTOR_TYPE,/* bDescriptorType: Interface descriptor type */
        0x00,         /* bInterfaceNumber: Number of Interface */
        0x00,         /* bAlternateSetting: Alternate setting */
        0x02,         /* bNumEndpoints */
        0x03,         /* bInterfaceClass: HID */
        0x00,         /* bInterfaceSubClass : 1=BOOT, 0=no boot */
        0x00,         /* nInterfaceProtocol : 0=none, 1=keyboard, 2=mouse */
        0,            /* iInterface: Index of string descriptor */
        /******************** Descriptor of Custom HID HID ********************/
        /* 18 */
        0x09,         /* bLength: HID Descriptor size */
        HID_DESCRIPTOR_TYPE, /* bDescriptorType: HID */
        0x10,         /* bcdHID: HID Class Spec release number */
        0x01,
        0x00,         /* bCountryCode: Hardware target country */
        0x01,         /* bNumDescriptors: Number of HID class descriptors to follow */
        0x22,         /* bDescriptorType */
        CUSTOMHID_SIZ_REPORT_DESC,/* wItemLength: Total length of Report descriptor */
        0x00,
        /******************** Descriptor of Custom HID endpoints ******************/
        /* 27 */
        0x07,          /* bLength: Endpoint Descriptor size */
        USB_ENDPOINT_DESCRIPTOR_TYPE, /* bDescriptorType: */
    
        0x81,          /* bEndpointAddress: Endpoint Address (IN) */
        0x03,          /* bmAttributes: Interrupt endpoint */
        0x02,          /* wMaxPacketSize: 2 Bytes max */
        0x00,
        0x20,          /* bInterval: Polling Interval (32 ms) */
        /* 34 */
    
        0x07,       /* bLength: Endpoint Descriptor size */
        USB_ENDPOINT_DESCRIPTOR_TYPE,       /* bDescriptorType: */
                            /*      Endpoint descriptor type */
        0x01,       /* bEndpointAddress: */
                            /*      Endpoint Address (OUT) */
        0x03,       /* bmAttributes: Interrupt endpoint */
        0x03,       /* wMaxPacketSize: 2 Bytes max  */
        0x00,
        0x20,       /* bInterval: Polling Interval (20 ms) */
    

Children