Setup data more than 64byte in FX2

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
frank
Level 2
Level 2
10 replies posted 10 sign-ins 5 replies posted

Hi,

    The example code for HID at FX2

    The loading of the HID and report descriptors is handled in the DR_GetDescriptor() function

case GD_REPORT://Report Descriptor

switch (SETUPDAT[4]){

case GD_IF0:

HID1length = pHID1ReportDscrEnd -pHID1ReportDscr;

AUTOPTR1H = MSB(pHID1ReportDscr);

AUTOPTR1L = LSB(pHID1ReportDscr);

for(i=0;i<HID1length;i++)

     EP0BUF[i]=XAUTODAT1;

     EP0BCL = HID1length;

break;

case GD_IF1:HID2

    length = pHID2ReportDscrEnd -pHID2ReportDscr;

    AUTOPTR1H = MSB(pHID2ReportDscr);

    AUTOPTR1L = LSB(pHID2ReportDscr);

    for(i=0;i<HID2length;i++)

        EP0BUF[i]=XAUTODAT1;

        EP0BCL = HID2length;

    break;

    default:

       EZUSB_STALL_EP0();

}

If the HID dexcription length more than 64byte, how to do here?

0 Likes
1 Solution
MallikaK_22
Moderator
Moderator
Moderator
50 likes received 750 replies posted 250 solutions authored

Hi,

The HID descriptor length is restricted from the USB data communication rate. For full speed, it has to be 64 bytes. This is because interrupt endpoints cannot go beyond over 64 bytes in Full-speed.

Please refer to Appendix E: https://www.usb.org/sites/default/files/hid1_11.pdf 

Regards,

Mallika

 

 

View solution in original post

0 Likes
3 Replies
MallikaK_22
Moderator
Moderator
Moderator
50 likes received 750 replies posted 250 solutions authored

Hi,

The HID descriptor length is restricted from the USB data communication rate. For full speed, it has to be 64 bytes. This is because interrupt endpoints cannot go beyond over 64 bytes in Full-speed.

Please refer to Appendix E: https://www.usb.org/sites/default/files/hid1_11.pdf 

Regards,

Mallika

 

 

0 Likes

Hi,

  So you mean the description just under 64 byte, it can't split data to send.

   For the Keyboard's description or some complex device the device's descriptor maybe more than 64byte at full speed, how do they work?

0 Likes
MallikaK_22
Moderator
Moderator
Moderator
50 likes received 750 replies posted 250 solutions authored

Hi,

In that case, the report should split into 64 bytes packets over the IN/OUT endpoint ( chunks of 64 bytes).

Please check the example descriptors in Appendix E: https://www.usb.org/sites/default/files/hid1_11.pdf 

 

0 Likes