From 4f889ecd9309c5ba619ba95c7c9f0f170f45628f Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Mon, 16 Sep 2019 19:33:06 -0400 Subject: [PATCH] stm32: Fix usbfs rx buffer sizing The usbfs receive buffers must also have space for the 2 byte crc at the end of a transmission. This fixes an error that could lead to lost messages from mcu to host (resulting in bytes_invalid increasing in stats) on the stm32f103. Signed-off-by: Kevin O'Connor --- src/stm32/usbfs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/stm32/usbfs.c b/src/stm32/usbfs.c index 2e0db507..de80b9ae 100644 --- a/src/stm32/usbfs.c +++ b/src/stm32/usbfs.c @@ -29,9 +29,9 @@ struct ep_desc { struct ep_mem { struct ep_desc ep0, ep_acm, ep_bulk_out, ep_bulk_in; uint32_t ep0_tx[USB_CDC_EP0_SIZE / 2]; - uint32_t ep0_rx[USB_CDC_EP0_SIZE / 2]; + uint32_t ep0_rx[USB_CDC_EP0_SIZE / 2 + 1]; uint32_t ep_acm_tx[USB_CDC_EP_ACM_SIZE / 2]; - uint32_t ep_bulk_out_rx[USB_CDC_EP_BULK_OUT_SIZE / 2]; + uint32_t ep_bulk_out_rx[USB_CDC_EP_BULK_OUT_SIZE / 2 + 1]; uint32_t ep_bulk_in_tx[USB_CDC_EP_BULK_IN_SIZE / 2]; };