File usb_misc.h contains the following:
#define MAX_EXPECTED_CONTROL_OUT_SIZE (76 + USB_SETUP_PKT_SIZE)
#if USBCFG_DEV_KHCI || USBCFG_DEV_EHCI
typedef struct usb_dev_data
{
uint8_t control_out[96];/* control_out must be 32 byte align,
** 96 = (((MAX_EXPECTED_CONTROL_OUT_SIZE-1)/32) + 1) * 32
*/
} usb_dev_data_t;
The problem is that, if MAX_EXPECTED_CONTROL_OUT_SIZE is increased, array control_out must also be resized.
This is easy enough to fix. The modified code should be:
#define MAX_EXPECTED_CONTROL_OUT_SIZE (76 + USB_SETUP_PKT_SIZE)
/* Round up to 32 byte block size
#define ROUNDED_UP_CONTROL_OUT_SIZE ((MAX_EXPECTED_CONTROL_OUT_SIZE+31)/32)
#if USBCFG_DEV_KHCI || USBCFG_DEV_EHCI
typedef struct usb_dev_data
{
uint8_t control_out[ROUNDED_UP_CONTROL_OUT_SIZE];/* control_out must be 32 byte align,
} usb_dev_data_t;
#endif
Hi John,
I have reported this to our USB stack team, and they appreciate your suggestion which will be incorporated into next release.
Have a great day,
Kan
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Thank you for the suggestion, we will forward it to our development team!