diff --git a/src/platforms/common/usbuart.h b/src/platforms/common/usbuart.h index 133197b5..a8fcaa39 100644 --- a/src/platforms/common/usbuart.h +++ b/src/platforms/common/usbuart.h @@ -28,11 +28,14 @@ void debug_uart_run(void); #define TX_LED_ACT (1 << 0) #define RX_LED_ACT (1 << 1) -#if defined(STM32F0) || defined(STM32F1) || defined(STM32F3) || defined(STM32F4) -/* F072 with st_usbfs_v2_usb_drive drops characters at the 64 byte boundary!*/ -#if !defined(USART_DMA_BUF_SIZE) -# define USART_DMA_BUF_SIZE 128 +/* XXX: Does the st_usbfs_v2_usb_driver work on F3 with 128 byte buffers? */ +#if defined(STM32F1) || defined(STM32F3) || defined(STM32F4) +#define USART_DMA_BUF_SIZE 128 +#elif defined(STM32F0) +/* The st_usbfs_v2_usb_driver only works with up to 64-byte buffers on the F0 parts */ +#define USART_DMA_BUF_SIZE 64 #endif + #define RX_FIFO_SIZE (USART_DMA_BUF_SIZE) #define TX_BUF_SIZE (USART_DMA_BUF_SIZE) diff --git a/src/platforms/f072/platform.h b/src/platforms/f072/platform.h index e3a0b699..fcad340f 100644 --- a/src/platforms/f072/platform.h +++ b/src/platforms/f072/platform.h @@ -90,8 +90,6 @@ #define SWDIO_MODE_DRIVE() \ gpio_mode_setup(SWDIO_PORT, GPIO_MODE_OUTPUT, GPIO_PUPD_NONE, SWDIO_PIN); -/* FIXME: Does st_usbfs_v2_usb_driver work on F3 with 128 Bytes buffer*/ -#define USART_DMA_BUF_SIZE 64 #define USB_DRIVER st_usbfs_v2_usb_driver #define USB_IRQ NVIC_USB_IRQ #define USB_ISR(x) usb_isr(x)