Cube0 - USB - CustomHID: Report Size
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2015-05-11 4:23 AM
Posted on May 11, 2015 at 13:23
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
Labels:
- Labels:
-
STM32Cube MCU Packages
-
USB
This discussion is locked. Please start a new topic to ask your question.
2 REPLIES 2
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2015-06-13 4:05 PM
Posted on June 14, 2015 at 01:05 The examples on stm32L152 uses a sendBuffer[2] buffer to transmit data. Try to locate this variable and increase the number of places in the table.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2015-11-05 2:10 AM
Posted on November 05, 2015 at 11:10
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