2015-05-11 04:23 AM
Hi,
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.<
usbd_customhid.h
>
#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?
<
usbd_conf.c
>
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
Markus
#usb #cube0 #customhid
2015-06-13 04:05 PM
2015-11-05 02:10 AM
Found a solution to my problem, more information:
https://my.st.com/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/Flat.aspx?RootFolder=/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/STM32L0%20USB%20CUSTOMHID%20Bidirectional¤tviews=20 Best Regards Markus