lpcware

USB reset problem when having endpoint 0x88

Discussion created by lpcware Employee on Jun 15, 2016
Content originally posted in LPCWare by t.alex on Thu Feb 20 02:38:30 MST 2014
Hi,

On LPC4337, on I configure my usb device (custom class) with 1 interface and 5 endpoints as follows:



Quote:
ALIGNED(4) uint8_t USB_ConfigDescriptor[] = {
/* Configuration 1 */
USB_CONFIGURATION_DESC_SIZE,/* bLength */
USB_CONFIGURATION_DESCRIPTOR_TYPE,/* bDescriptorType */
WBVAL(/* wTotalLength */
USB_CONFIGURATION_DESC_SIZE   +
USB_INTERFACE_DESC_SIZE       +
USB_ENDPOINT_DESC_SIZE        +
USB_ENDPOINT_DESC_SIZE        +
USB_ENDPOINT_DESC_SIZE        +
USB_ENDPOINT_DESC_SIZE        +
USB_ENDPOINT_DESC_SIZE
),
0x01,/* bNumInterfaces */
0x01,/* bConfigurationValue */
0x00,/* iConfiguration */
USB_CONFIG_SELF_POWERED,/* bmAttributes */
USB_CONFIG_POWER_MA(100),/* bMaxPower */

/* Interface 0, Alternate Setting 0*/
USB_INTERFACE_DESC_SIZE,/* bLength */
USB_INTERFACE_DESCRIPTOR_TYPE,/* bDescriptorType */
USB_INTERFACE_NUM,/* bInterfaceNumber */
0x00,/* bAlternateSetting */
0x05,/* bNumEndpoints */
0,/* bInterfaceClass */
0,/* bInterfaceSubClass */
0,/* bInterfaceProtocol */
0x0,/* iInterface */

/* Endpoint 1 */
USB_ENDPOINT_DESC_SIZE,/* bLength */
USB_ENDPOINT_DESCRIPTOR_TYPE,/* bDescriptorType */
USB_CDC_OUT_EP,/* bEndpointAddress */
USB_ENDPOINT_TYPE_BULK,/* bmAttributes */
WBVAL(USB_FS_MAX_BULK_PACKET),/* wMaxPacketSize */
0x01,/* bInterval: ignore for Bulk transfer */


/* Endpoint 2 */
USB_ENDPOINT_DESC_SIZE,/* bLength */
USB_ENDPOINT_DESCRIPTOR_TYPE,/* bDescriptorType */
USB_CDC_IN_EP,/* bEndpointAddress */
USB_ENDPOINT_TYPE_BULK,/* bmAttributes */
WBVAL(USB_FS_MAX_BULK_PACKET),/* wMaxPacketSize */
0x01,/* bInterval: ignore for Bulk transfer */

/* Endpoint 4 */
USB_ENDPOINT_DESC_SIZE,/* bLength */
USB_ENDPOINT_DESCRIPTOR_TYPE,/* bDescriptorType */
0x84,/* bEndpointAddress */
USB_ENDPOINT_TYPE_BULK,/* bmAttributes */
WBVAL(USB_FS_MAX_BULK_PACKET),/* wMaxPacketSize */
0x01,/* bInterval: ignore for Bulk transfer */


/* Endpoint 6 */
USB_ENDPOINT_DESC_SIZE,/* bLength */
USB_ENDPOINT_DESCRIPTOR_TYPE,/* bDescriptorType */
0x86,/* bEndpointAddress */
USB_ENDPOINT_TYPE_BULK,/* bmAttributes */
WBVAL(USB_FS_MAX_BULK_PACKET),/* wMaxPacketSize */
0x01,/* bInterval: ignore for Bulk transfer */

/* Endpoint 8 */
USB_ENDPOINT_DESC_SIZE,/* bLength */
USB_ENDPOINT_DESCRIPTOR_TYPE,/* bDescriptorType */
0x88,/* bEndpointAddress */
USB_ENDPOINT_TYPE_BULK,/* bmAttributes */
WBVAL(USB_FS_MAX_BULK_PACKET),/* wMaxPacketSize */
0x01,/* bInterval: ignore for Bulk transfer */




/* Terminator */
0/* bLength */


};





I found out that with endpoint 0x88 defined, whenever host send a USB reset, the system will run into HardFault.

How would I overcome this?

thanks,

Outcomes