AnsweredAssumed Answered

Cube0 - USB - CustomHID: Report Size

Question asked by mfussi on May 11, 2015
Latest reply on Nov 5, 2015 by mfussi

I got a question concerning the Cube USB library used on the L0 series. I am trying to implement the CustomHID class provided in the USB library. I am developing on the STM32L053 discovery board.

I used the usbd_conf.c and usbd_desc.c from the usbHID demonstration from the STM32L053 Discovery package, the USB core files and the CustomHID class files.

As far as I can see the customHID example implements a report with 2 byte input and 2 byte output. For my application I need to transfer more than 2 bytes at once. Therefore I used a report definition with an output/input of 16 byte and also increased the buffer sizes in the customhid.h file. After that my application becomes unstable and even crashes. With an input/output buffer of 2 or 4 byte it is working perfectly.

#define CUSTOM_HID_EPIN_ADDR                 0x81
#define CUSTOM_HID_EPIN_SIZE                 0x10
#define CUSTOM_HID_EPOUT_ADDR                0x01
#define CUSTOM_HID_EPOUT_SIZE                0x10

Am I missing some other changes in the template application? Maybe another buffer in the lower layers which becomes to small?

HAL_PCDEx_PMAConfig(pdev->pData , 0x00 , PCD_SNG_BUF, 0x18);
HAL_PCDEx_PMAConfig(pdev->pData , 0x80 , PCD_SNG_BUF, 0x58);
HAL_PCDEx_PMAConfig(pdev->pData , 0x81 , PCD_SNG_BUF, 0x100);

Do I have to changes these addresses to make more space in the buffer?

Best Regards