diff options
author | Gregory Nutt <gnutt@nuttx.org> | 2013-12-25 18:34:15 -0600 |
---|---|---|
committer | Gregory Nutt <gnutt@nuttx.org> | 2013-12-25 18:34:15 -0600 |
commit | 757f9512ad3cbb76eea91ad3525073d8184ab781 (patch) | |
tree | 8f404013d43576b8dbd5f2c52cdddb971ba28aeb | |
parent | 508541b6ffd1e5de99d7ae82d62cc1a8c7f98452 (diff) | |
download | nuttx-757f9512ad3cbb76eea91ad3525073d8184ab781.tar.gz nuttx-757f9512ad3cbb76eea91ad3525073d8184ab781.tar.bz2 nuttx-757f9512ad3cbb76eea91ad3525073d8184ab781.zip |
F103VC, F105, and F107: Fix configuration and building of USB. configs/viewtools-stm32f107: Fix build for F103 and F107: F103 has USB device; F107 has OTGFS
-rw-r--r-- | nuttx/ChangeLog | 7 | ||||
-rw-r--r-- | nuttx/arch/arm/src/stm32/Kconfig | 18 | ||||
-rw-r--r-- | nuttx/arch/arm/src/stm32/chip/stm32f103vc_pinmap.h | 11 | ||||
-rw-r--r-- | nuttx/arch/arm/src/stm32/chip/stm32f105vb_pinmap.h | 14 | ||||
-rw-r--r-- | nuttx/arch/arm/src/stm32/chip/stm32f107vc_pinmap.h | 12 | ||||
-rw-r--r-- | nuttx/arch/arm/src/stm32/chip/stm32l15xxx_pinmap.h | 2 | ||||
-rw-r--r-- | nuttx/configs/viewtool-stm32f107/README.txt | 10 | ||||
-rw-r--r-- | nuttx/configs/viewtool-stm32f107/src/Makefile | 6 | ||||
-rw-r--r-- | nuttx/configs/viewtool-stm32f107/src/stm32_usbdev.c | 13 | ||||
-rw-r--r-- | nuttx/configs/viewtool-stm32f107/src/viewtool_stm32f107.h | 10 |
10 files changed, 56 insertions, 47 deletions
diff --git a/nuttx/ChangeLog b/nuttx/ChangeLog index 454c28dd1..c88a22f46 100644 --- a/nuttx/ChangeLog +++ b/nuttx/ChangeLog @@ -6307,3 +6307,10 @@ and stm32_usbmsc.c: Lay out basic framework for USB and SD card support. Code is incomplete and has been neither built nor tested (2013-12-25). + * nuttx/arch/arm/src/stm32/Kconfig, chip/stm32f103vc_pinmap.h, + stm32f105vb_pinmap.h, and stm32f107vc_pinmap.h: Fix configuration and + pin definition that would prevent building USB for the connectivity and + performance lines (2013-12-25). + * stm32l15xxx_pinmap.h: Fix a typo in USB pin definitions (2013-12-25). + * configs/viewtools-stm32f107: Fix building of USB for F103 and F107. + F103 has device only; F107 has OTG FS (2013-12-25). diff --git a/nuttx/arch/arm/src/stm32/Kconfig b/nuttx/arch/arm/src/stm32/Kconfig index 8a236a99d..7945671f8 100644 --- a/nuttx/arch/arm/src/stm32/Kconfig +++ b/nuttx/arch/arm/src/stm32/Kconfig @@ -548,6 +548,7 @@ endchoice config STM32_STM32L15XX bool default n + select STM32_HAVE_USBDEV config STM32_ENERGYLITE bool @@ -564,10 +565,12 @@ config STM32_VALUELINE config STM32_CONNECTIVITYLINE bool default n + select STM32_HAVE_OTGFS config STM32_PERFORMANCELINE bool default n + select STM32_HAVE_USBDEV config STM32_HIGHDENSITY bool @@ -584,14 +587,17 @@ config STM32_LOWDENSITY config STM32_STM32F20XX bool default n + select STM32_HAVE_OTGFS config STM32_STM32F30XX bool default n + select STM32_HAVE_USBDEV config STM32_STM32F40XX bool default n + select STM32_HAVE_OTGFS # This is really 427/437, but we treat the two the same. config STM32_STM32F427 @@ -611,6 +617,14 @@ config STM32_DFU menu "STM32 Peripheral Support" +config STM32_HAVE_USBDEV + bool + default n + +config STM32_HAVE_OTGFS + bool + default n + config STM32_ADC1 bool "ADC1" default n @@ -755,7 +769,7 @@ config STM32_LTDC config STM32_OTGFS bool "OTG FS" default n - depends on STM32_STM32F20XX || STM32_STM32F40XX + depends on STM32_HAVE_OTGFS config STM32_OTGHS bool "OTG HS" @@ -980,7 +994,7 @@ config STM32_UART8 config STM32_USB bool "USB Device" default n - depends on (STM32_STM32F10XX && !STM32_VALUELINE) || STM32_STM32L15XX || STM32_STM32F30XX + depends on STM32_HAVE_USBDEV select USBDEV config STM32_LCD diff --git a/nuttx/arch/arm/src/stm32/chip/stm32f103vc_pinmap.h b/nuttx/arch/arm/src/stm32/chip/stm32f103vc_pinmap.h index 52a513215..4e770321a 100644 --- a/nuttx/arch/arm/src/stm32/chip/stm32f103vc_pinmap.h +++ b/nuttx/arch/arm/src/stm32/chip/stm32f103vc_pinmap.h @@ -155,17 +155,10 @@ #define GPIO_I2S3_SD (GPIO_ALT|GPIO_CNF_AFPP|GPIO_MODE_50MHz|GPIO_PORTB|GPIO_PIN5) #define GPIO_I2S3_WS (GPIO_ALT|GPIO_CNF_AFPP|GPIO_MODE_50MHz|GPIO_PORTA|GPIO_PIN15) -#if 0 /* Needs further investigation */ #define GPIO_MCO (GPIO_ALT|GPIO_CNF_AFPP|GPIO_MODE_50MHz|GPIO_PORTA|GPIO_PIN8) -#endif -#if 0 /* Needs further investigation */ -#define GPIO_OTG_FSDM (GPIO_ALT|GPIO_CNF_AFPP|GPIO_MODE_50MHz|GPIO_PORTA|GPIO_PIN11) -#define GPIO_OTG_FSDP (GPIO_ALT|GPIO_CNF_AFPP|GPIO_MODE_50MHz|GPIO_PORTA|GPIO_PIN12) -#define GPIO_OTG_FSID (GPIO_ALT|GPIO_CNF_AFPP|GPIO_MODE_50MHz|GPIO_PORTA|GPIO_PIN10) -#define GPIO_OTG_FSSOF (GPIO_ALT|GPIO_CNF_AFPP|GPIO_MODE_50MHz|GPIO_PORTA|GPIO_PIN8) -#define GPIO_OTG_FSVBUS (GPIO_ALT|GPIO_CNF_AFPP|GPIO_MODE_50MHz|GPIO_PORTA|GPIO_PIN9) -#endif +#define GPIO_USB_DM (GPIO_ALT|GPIO_CNF_AFPP|GPIO_MODE_50MHz|GPIO_PORTA|GPIO_PIN11) +#define GPIO_USB_DP (GPIO_ALT|GPIO_CNF_AFPP|GPIO_MODE_50MHz|GPIO_PORTA|GPIO_PIN12) #if defined(CONFIG_STM32_SPI1_REMAP) # define GPIO_SPI1_NSS (GPIO_INPUT|GPIO_CNF_INFLOAT|GPIO_MODE_INPUT|GPIO_PORTA|GPIO_PIN15) diff --git a/nuttx/arch/arm/src/stm32/chip/stm32f105vb_pinmap.h b/nuttx/arch/arm/src/stm32/chip/stm32f105vb_pinmap.h index 054a7337d..710780061 100644 --- a/nuttx/arch/arm/src/stm32/chip/stm32f105vb_pinmap.h +++ b/nuttx/arch/arm/src/stm32/chip/stm32f105vb_pinmap.h @@ -148,17 +148,13 @@ #define GPIO_I2S3_SD (GPIO_ALT|GPIO_CNF_AFPP|GPIO_MODE_50MHz|GPIO_PORTB|GPIO_PIN5) #define GPIO_I2S3_WS (GPIO_ALT|GPIO_CNF_AFPP|GPIO_MODE_50MHz|GPIO_PORTA|GPIO_PIN15) -#if 0 /* Needs further investigation */ #define GPIO_MCO (GPIO_ALT|GPIO_CNF_AFPP|GPIO_MODE_50MHz|GPIO_PORTA|GPIO_PIN8) -#endif -#if 0 /* Needs further investigation */ -#define GPIO_OTG_FSDM (GPIO_ALT|GPIO_CNF_AFPP|GPIO_MODE_50MHz|GPIO_PORTA|GPIO_PIN11) -#define GPIO_OTG_FSDP (GPIO_ALT|GPIO_CNF_AFPP|GPIO_MODE_50MHz|GPIO_PORTA|GPIO_PIN12) -#define GPIO_OTG_FSID (GPIO_ALT|GPIO_CNF_AFPP|GPIO_MODE_50MHz|GPIO_PORTA|GPIO_PIN10) -#define GPIO_OTG_FSSOF (GPIO_ALT|GPIO_CNF_AFPP|GPIO_MODE_50MHz|GPIO_PORTA|GPIO_PIN8) -#define GPIO_OTG_FSVBUS (GPIO_ALT|GPIO_CNF_AFPP|GPIO_MODE_50MHz|GPIO_PORTA|GPIO_PIN9) -#endif +#define GPIO_OTGFS_DM (GPIO_ALT|GPIO_CNF_AFPP|GPIO_MODE_50MHz|GPIO_PORTA|GPIO_PIN11) +#define GPIO_OTGFS_DP (GPIO_ALT|GPIO_CNF_AFPP|GPIO_MODE_50MHz|GPIO_PORTA|GPIO_PIN12) +#define GPIO_OTGFS_ID (GPIO_ALT|GPIO_CNF_AFPP|GPIO_MODE_50MHz|GPIO_PORTA|GPIO_PIN10) +#define GPIO_OTGFS_SOF (GPIO_ALT|GPIO_CNF_AFPP|GPIO_MODE_50MHz|GPIO_PORTA|GPIO_PIN8) +#define GPIO_OTGFS_VBUS (GPIO_ALT|GPIO_CNF_AFPP|GPIO_MODE_50MHz|GPIO_PORTA|GPIO_PIN9) #if defined(CONFIG_STM32_SPI1_REMAP) # define GPIO_SPI1_NSS (GPIO_INPUT|GPIO_CNF_INFLOAT|GPIO_MODE_INPUT|GPIO_PORTA|GPIO_PIN15) diff --git a/nuttx/arch/arm/src/stm32/chip/stm32f107vc_pinmap.h b/nuttx/arch/arm/src/stm32/chip/stm32f107vc_pinmap.h index 541163c56..450cc6b06 100644 --- a/nuttx/arch/arm/src/stm32/chip/stm32f107vc_pinmap.h +++ b/nuttx/arch/arm/src/stm32/chip/stm32f107vc_pinmap.h @@ -156,13 +156,11 @@ #define GPIO_MCO (GPIO_ALT|GPIO_CNF_AFPP|GPIO_MODE_50MHz|GPIO_PORTA|GPIO_PIN8) -#if 0 /* Needs further investigation */ -#define GPIO_OTG_FSDM (GPIO_ALT|GPIO_CNF_AFPP|GPIO_MODE_50MHz|GPIO_PORTA|GPIO_PIN11) -#define GPIO_OTG_FSDP (GPIO_ALT|GPIO_CNF_AFPP|GPIO_MODE_50MHz|GPIO_PORTA|GPIO_PIN12) -#define GPIO_OTG_FSID (GPIO_ALT|GPIO_CNF_AFPP|GPIO_MODE_50MHz|GPIO_PORTA|GPIO_PIN10) -#define GPIO_OTG_FSSOF (GPIO_ALT|GPIO_CNF_AFPP|GPIO_MODE_50MHz|GPIO_PORTA|GPIO_PIN8) -#define GPIO_OTG_FSVBUS (GPIO_ALT|GPIO_CNF_AFPP|GPIO_MODE_50MHz|GPIO_PORTA|GPIO_PIN9) -#endif +#define GPIO_OTGFS_DM (GPIO_ALT|GPIO_CNF_AFPP|GPIO_MODE_50MHz|GPIO_PORTA|GPIO_PIN11) +#define GPIO_OTGFS_DP (GPIO_ALT|GPIO_CNF_AFPP|GPIO_MODE_50MHz|GPIO_PORTA|GPIO_PIN12) +#define GPIO_OTGFS_ID (GPIO_ALT|GPIO_CNF_AFPP|GPIO_MODE_50MHz|GPIO_PORTA|GPIO_PIN10) +#define GPIO_OTGFS_SOF (GPIO_ALT|GPIO_CNF_AFPP|GPIO_MODE_50MHz|GPIO_PORTA|GPIO_PIN8) +#define GPIO_OTGFS_VBUS (GPIO_ALT|GPIO_CNF_AFPP|GPIO_MODE_50MHz|GPIO_PORTA|GPIO_PIN9) #if defined(CONFIG_STM32_SPI1_REMAP) # define GPIO_SPI1_NSS (GPIO_INPUT|GPIO_CNF_INFLOAT|GPIO_MODE_INPUT|GPIO_PORTA|GPIO_PIN15) diff --git a/nuttx/arch/arm/src/stm32/chip/stm32l15xxx_pinmap.h b/nuttx/arch/arm/src/stm32/chip/stm32l15xxx_pinmap.h index d30d9961c..f0547c9ef 100644 --- a/nuttx/arch/arm/src/stm32/chip/stm32l15xxx_pinmap.h +++ b/nuttx/arch/arm/src/stm32/chip/stm32l15xxx_pinmap.h @@ -534,7 +534,7 @@ /* USB */ #define GPIO_USB_DM (GPIO_ALT | GPIO_AF10 | GPIO_SPEED_40MHz | GPIO_PUSHPULL | GPIO_PORTA | GPIO_PIN11) -#define GPIO_USG_DP (GPIO_ALT | GPIO_AF10 | GPIO_SPEED_40MHz | GPIO_PUSHPULL | GPIO_PORTA | GPIO_PIN12) +#define GPIO_USB_DP (GPIO_ALT | GPIO_AF10 | GPIO_SPEED_40MHz | GPIO_PUSHPULL | GPIO_PORTA | GPIO_PIN12) /* Wakeup inputs */ diff --git a/nuttx/configs/viewtool-stm32f107/README.txt b/nuttx/configs/viewtool-stm32f107/README.txt index 174b4f7e3..88ad6263a 100644 --- a/nuttx/configs/viewtool-stm32f107/README.txt +++ b/nuttx/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/nuttx/configs/viewtool-stm32f107/src/Makefile b/nuttx/configs/viewtool-stm32f107/src/Makefile index 953a245b4..3bcd40627 100644 --- a/nuttx/configs/viewtool-stm32f107/src/Makefile +++ b/nuttx/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/nuttx/configs/viewtool-stm32f107/src/stm32_usbdev.c b/nuttx/configs/viewtool-stm32f107/src/stm32_usbdev.c index f8ef15bb3..f508f3f77 100644 --- a/nuttx/configs/viewtool-stm32f107/src/stm32_usbdev.c +++ b/nuttx/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/nuttx/configs/viewtool-stm32f107/src/viewtool_stm32f107.h b/nuttx/configs/viewtool-stm32f107/src/viewtool_stm32f107.h index 8ac5580ec..602c75a1f 100644 --- a/nuttx/configs/viewtool-stm32f107/src/viewtool_stm32f107.h +++ b/nuttx/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 */ /************************************************************************************ |