diff --git a/configs/viewtool-stm32f107/README.txt b/configs/viewtool-stm32f107/README.txt index 174b4f7e3f..88ad6263a7 100644 --- a/configs/viewtool-stm32f107/README.txt +++ b/configs/viewtool-stm32f107/README.txt @@ -137,9 +137,9 @@ USB Interface Pin Signal --- --------- ----------- ------------------------------------ 1 USB_VBUS VDD_USB (No sensing available) - 2 OTG_DM PA11 GPIO_OTG_FSDM - 3 OTG_DP PA12 GPIO_OTG_FSDP - 4 OTG_ID PA10 GPIO_OTG_FSID + 2 OTG_DM PA11 GPIO_OTGFS_DM (F107) GPIO_USB_DM (F103) + 3 OTG_DP PA12 GPIO_OTGFS_DP (F107) GPIO_USB_DP (F103) + 4 OTG_ID PA10 GPIO_OTGFS_ID (F107) 5 Shield N/A N/A 6 Shield N/A N/A 7 Shield N/A N/A @@ -148,8 +148,8 @@ USB Interface PE11 USB_EN GPIO controlled soft pull-up NOTES: - 1. GPIO_OTG_FSVBUS should not be configured. No VBUS sensing - 2. GPIO_OTG_FSSOF is not used + 1. GPIO_OTGFS_VBUS (F107) should not be configured. No VBUS sensing + 2. GPIO_OTGFS_SOF (F107) is not used Configuration ------------- diff --git a/configs/viewtool-stm32f107/src/Makefile b/configs/viewtool-stm32f107/src/Makefile index 953a245b4e..3bcd40627a 100644 --- a/configs/viewtool-stm32f107/src/Makefile +++ b/configs/viewtool-stm32f107/src/Makefile @@ -54,8 +54,12 @@ ifeq ($(CONFIG_MMCSD),y) CSRCS += stm32_mmcsd.c endif -ifeq ($(CONFIG_STM32_OTGFS),y) +ifeq ($(CONFIG_STM32_OTGFS),y) # F107 CSRCS += stm32_usbdev.c +else +ifeq ($(CONFIG_STM32_USB),y) # F103 +CSRCS += stm32_usbdev.c +endif endif ifeq ($(CONFIG_NSH_ARCHINIT),y) diff --git a/configs/viewtool-stm32f107/src/stm32_usbdev.c b/configs/viewtool-stm32f107/src/stm32_usbdev.c index f8ef15bb39..f508f3f77a 100644 --- a/configs/viewtool-stm32f107/src/stm32_usbdev.c +++ b/configs/viewtool-stm32f107/src/stm32_usbdev.c @@ -48,7 +48,7 @@ #include "stm32_otgfs.h" #include "viewtool_stm32f107.h" -#ifdef CONFIG_STM32_OTGFS +#if defined(CONFIG_STM32_OTGFS) || defined(CONFIG_STM32_USB) /************************************************************************************ * Pre-processor Definitions @@ -57,7 +57,7 @@ #ifdef CONFIG_USBDEV # define HAVE_USB 1 #else -# warning CONFIG_STM32_OTGFS is enabled but CONFIG_USBDEV is not +# warning CONFIG_STM32_OTGFS (F107) or CONFIG_STM32_USB (F103) is enabled but CONFIG_USBDEV is not # undef HAVE_USB #endif @@ -87,15 +87,12 @@ void stm32_usbdev_initialize(void) /* The OTG FS has an internal soft pull-up. No GPIO configuration is required */ #warning REVISIT: The Viewtool board does, indeed, have a soft connect GPIO - /* Configure the OTG FS VBUS sensing GPIO, Power On, and Overcurrent GPIOs */ - -#ifdef CONFIG_STM32_OTGFS + /* Configure the OTG FS VBUS sensing GPIO and power enable GPIO */ #warning REVISIT: GPIO setup -#endif } /************************************************************************************ - * Name: stm32_usbsuspend + * Name: stm32_usbsuspend * * Description: * Board logic must provide the stm32_usbsuspend logic if the USBDEV driver is @@ -110,4 +107,4 @@ void stm32_usbsuspend(FAR struct usbdev_s *dev, bool resume) ulldbg("resume: %d\n", resume); } -#endif /* CONFIG_STM32_OTGFS */ +#endif /* CONFIG_STM32_OTGFS || CONFIG_STM32_USB*/ diff --git a/configs/viewtool-stm32f107/src/viewtool_stm32f107.h b/configs/viewtool-stm32f107/src/viewtool_stm32f107.h index 8ac5580ecd..602c75a1f3 100644 --- a/configs/viewtool-stm32f107/src/viewtool_stm32f107.h +++ b/configs/viewtool-stm32f107/src/viewtool_stm32f107.h @@ -129,9 +129,9 @@ * Pin Signal * --- --------- ----------- ------------------------------------ * 1 USB_VBUS VDD_USB (No sensing available) - * 2 OTG_DM PA11 GPIO_OTG_FSDM - * 3 OTG_DP PA12 GPIO_OTG_FSDP - * 4 OTG_ID PA10 GPIO_OTG_FSID + * 2 OTG_DM PA11 GPIO_OTGFS_DM (F107) GPIO_USB_DM (F103) + * 3 OTG_DP PA12 GPIO_OTGFS_DP (F107) GPIO_USB_DP (F103) + * 4 OTG_ID PA10 GPIO_OTGFS_ID (F107) * 5 Shield N/A N/A * 6 Shield N/A N/A * 7 Shield N/A N/A @@ -140,8 +140,8 @@ * PE11 USB_EN GPIO controlled soft pull-up * * NOTES: - * 1. GPIO_OTG_FSVBUS should not be configured. No VBUS sensing - * 2. GPIO_OTG_FSSOF is not used + * 1. GPIO_OTGFS_VBUS (F107) should not be configured. No VBUS sensing + * 2. GPIO_OTGFS_SOF (F107) is not used */ /************************************************************************************