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,
Thank you for your replay. I found that I have to allocate space for the received data in a function called SetEPTxCount(Endpoint,wCount) I'm actually using the USB-FS library provided by ST. If I change wCount to 3 every think works fine. I actually made a little note for any one want to modify the custom HID code provided by the library.
//changing the report descriptor
//To change the report descriptor use the HID tool then save your file as a header file then copy past the generated data in the report descriptor
//you need to refresh CUSTOMHID_SIZ_REPORT_DESC which is the size of the total report descriptor (usb_desc.h)
--> this define variable is used both in the configuration descriptor as the "wDescriptorLength " and the report descriptor as its own size
//you need to refresh the wMaxPacket size in the corresponding endpoint descriptor
--> this values defines the maximum packet to send or receive
//go to usb_prop.c and change the wCount parameter in SetEPRxCount(Endpoint, wCount) (for out data) SetEPTxCount(Endpoint,wCount) (for in data)
-->even the maximum packet is defined by the endpoint descriptor you need to allocate space for it.
//The report ID is automatically take the first byte
-->A report ID must not be equal to 0x00