From 7fccec68d4021fd4a57fe47fcbc0b21e237e24be Mon Sep 17 00:00:00 2001 From: Fabien Poussin Date: Sat, 13 Feb 2021 20:16:40 +0100 Subject: [PATCH] fixes for usb host --- os/hal/ports/STM32/LLD/USBHv1/hal_usbh_lld.c | 5 +++++ testhal/STM32/STM32H7xx/USB_HOST/mcuconf_community.h | 7 ++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/os/hal/ports/STM32/LLD/USBHv1/hal_usbh_lld.c b/os/hal/ports/STM32/LLD/USBHv1/hal_usbh_lld.c index 6c8f9853..8071ac5c 100644 --- a/os/hal/ports/STM32/LLD/USBHv1/hal_usbh_lld.c +++ b/os/hal/ports/STM32/LLD/USBHv1/hal_usbh_lld.c @@ -52,6 +52,8 @@ #define rccResetOTG1() rccResetUSB1_OTG_FS() #define OTG1 OTG_FS #define OTG1_CHANNELS_NUMBER STM32_OTG_FS_CHANNELS_NUMBER +#ifdef STM32_OTG1_USE_ULPI +#error "OTG1 has no ULPI on this platform" #endif #if (STM32_OTG_FS_RXFIFO_SIZE + STM32_OTG_FS_PTXFIFO_SIZE + STM32_OTG_FS_NPTXFIFO_SIZE) > (STM32_OTG_FS_FIFO_MEM_SIZE * 4) #error "Not enough memory in OTG_FS implementation" @@ -88,6 +90,9 @@ #define rccResetOTG2() rccResetUSB2_OTG_FS() #define OTG2 OTG_FS #define OTG2_CHANNELS_NUMBER STM32_OTG_FS_CHANNELS_NUMBER +#ifdef STM32_OTG2_USE_ULPI +#error "OTG2 has no ULPI on this platform" +#endif #else #define rccEnableOTG2(lp) rccEnableUSB2_OTG_HS(lp) #define rccDisableOTG2() rccDisableUSB2_OTG_HS() diff --git a/testhal/STM32/STM32H7xx/USB_HOST/mcuconf_community.h b/testhal/STM32/STM32H7xx/USB_HOST/mcuconf_community.h index 49911d75..2a583326 100644 --- a/testhal/STM32/STM32H7xx/USB_HOST/mcuconf_community.h +++ b/testhal/STM32/STM32H7xx/USB_HOST/mcuconf_community.h @@ -92,13 +92,14 @@ #define STM32_OTG_FS_CHANNELS_NUMBER 8 #define STM32_OTG_HS_CHANNELS_NUMBER 12 -#define STM32_USBH_USE_OTG1 FALSE +#define STM32_USBH_USE_OTG1 TRUE +#define STM32_OTG1_USE_ULPI TRUE #define STM32_OTG_FS_RXFIFO_SIZE 1024 #define STM32_OTG_FS_PTXFIFO_SIZE 128 #define STM32_OTG_FS_NPTXFIFO_SIZE 128 -#define STM32_USBH_USE_OTG2 TRUE -#define STM32_OTG2_USE_ULPI TRUE +#define STM32_USBH_USE_OTG2 FALSE +#define STM32_OTG2_USE_ULPI FALSE #define STM32_OTG_HS_RXFIFO_SIZE 2048 #define STM32_OTG_HS_PTXFIFO_SIZE 1024 #define STM32_OTG_HS_NPTXFIFO_SIZE 1024