From d63e870e82ecbd73af2d14e6794d2985cb9bd0ad Mon Sep 17 00:00:00 2001 From: Vegard Storheil Eriksen Date: Thu, 30 Apr 2020 22:04:41 +0200 Subject: [PATCH] cdcacm: Fix UART interface OUT endpoint MPS in descriptor. 3e3e450 reduced the buffer size for the UART interface OUT endpoint to 32B, but left wMaxPacketSize at 64B. This effectively configures the hardware to receive packets up to 32B in size while telling the host it can send larger packets. On reception of a larger packet, the usb core treats it as an error, drops the packet and replies with a STALL handshake. This commit fixes the issue by updating the descriptor to match the buffer configuration. Fixes #538 --- src/platforms/common/cdcacm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/platforms/common/cdcacm.c b/src/platforms/common/cdcacm.c index 8f5f779..a063d31 100644 --- a/src/platforms/common/cdcacm.c +++ b/src/platforms/common/cdcacm.c @@ -188,7 +188,7 @@ static const struct usb_endpoint_descriptor uart_data_endp[] = {{ .bDescriptorType = USB_DT_ENDPOINT, .bEndpointAddress = 0x03, .bmAttributes = USB_ENDPOINT_ATTR_BULK, - .wMaxPacketSize = CDCACM_PACKET_SIZE, + .wMaxPacketSize = CDCACM_PACKET_SIZE / 2, .bInterval = 1, }, { .bLength = USB_DT_ENDPOINT_SIZE,