AnsweredAssumed Answered

Modifying Custom HID Application

Question asked by slr.prt on Oct 5, 2013
Latest reply on May 29, 2015 by Clive One
Hi;

I am working on the Custom HID application which is in the St library and I use STM3210E-EVAL.  But this protocol transfer only 2 bytes (1 Byte Id + 1 Byte Data) so I modified the code and I transferred the 64 bytes from host (pc) to device (eval board) but I didn't send more than 2 bytes from device to host.Finally, I want to send 64 bytes from device to host. Can you help me?


These are my changings ;

at usb_prop.c
    ....
  SetEPTxCount(ENDP1, 2);     -->          SetEPTxCount(ENDP1, 64);
  SetEPRxCount(ENDP1, 2);     -->          SetEPRxCount(ENDP1, 64);
    ....

at usb_desc.c
const uint8_t CustomHID_ConfigDescriptor[CUSTOMHID_SIZ_CONFIG_DESC] =
  {
    ....
    ....
    0x02  changed to 0x40  /*vMaxpacketsize endpoint address IN*/
    ....
    ....
    0x02  changed to 0x40  /*vMaxpacketsize endpoint address OUT*/
    ....
    ....
}

const uint8_t CustomHID_ReportDescriptor[CUSTOMHID_SIZ_REPORT_DESC] =
  {
    ....
    ....
/* Led 1 */
    0x85, 0x01,            /*     REPORT_ID (1)       */
    0x09, 0x01,            /*     USAGE (LED 1)              */
    0x15, 0x00,            /*     LOGICAL_MINIMUM (0)        */
    0x25, 0x01,            /*     LOGICAL_MAXIMUM (1)        */
    0x75, 0x08,            /*     REPORT_SIZE (8)            */
    0x95, 0x01,  changed to 0x95, 0x40          /* REPORT_COUNT (1) */
    ...
    ...
    }

I also increased the SendBuffer size to 65.

Thanks...

Outcomes