summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGregory Nutt <gnutt@nuttx.org>2014-05-05 17:59:07 -0600
committerGregory Nutt <gnutt@nuttx.org>2014-05-05 17:59:07 -0600
commitfdf3afe510e05c44e81ab7d0bacf41cd982415df (patch)
treee1c8c84020189ebc02ce07da53968cef7f64054a
parentaf24bfcaf370f42bd6e1273575f9e74a0ec0fcd1 (diff)
downloadnuttx-fdf3afe510e05c44e81ab7d0bacf41cd982415df.tar.gz
nuttx-fdf3afe510e05c44e81ab7d0bacf41cd982415df.tar.bz2
nuttx-fdf3afe510e05c44e81ab7d0bacf41cd982415df.zip
STM32: Add some complication to STM32 Kconfig so the correct USART and TIM options are presented for the F401RE. There are still invalid peripheral options being presented
-rw-r--r--nuttx/arch/arm/src/stm32/Kconfig286
-rw-r--r--nuttx/configs/nucleo-f401re/README.txt84
2 files changed, 329 insertions, 41 deletions
diff --git a/nuttx/arch/arm/src/stm32/Kconfig b/nuttx/arch/arm/src/stm32/Kconfig
index de7d47b10..6fd470569 100644
--- a/nuttx/arch/arm/src/stm32/Kconfig
+++ b/nuttx/arch/arm/src/stm32/Kconfig
@@ -565,10 +565,25 @@ config STM32_STM32L15XX
bool
default n
select STM32_HAVE_USBDEV
+ select STM32_HAVE_USART3
+ select STM32_HAVE_TIM6
+ select STM32_HAVE_TIM7
+ select STM32_HAVE_TIM9
+ select STM32_HAVE_TIM10
+ select STM32_HAVE_TIM11
config STM32_ENERGYLITE
bool
default n
+ select STM32_HAVE_USART3
+ select STM32_HAVE_USART4
+ select STM32_HAVE_USART5
+ select STM32_HAVE_TIM1
+ select STM32_HAVE_TIM5
+ select STM32_HAVE_TIM6
+ select STM32_HAVE_TIM7
+ select STM32_HAVE_TIM8
+ select STM32_HAVE_TIM10
config STM32_STM32F10XX
bool
@@ -577,29 +592,82 @@ config STM32_STM32F10XX
config STM32_VALUELINE
bool
default n
+ select STM32_HAVE_USART3
+ select STM32_HAVE_USART4
+ select STM32_HAVE_USART5
+ select STM32_HAVE_TIM1
+ select STM32_HAVE_TIM5
+ select STM32_HAVE_TIM6
+ select STM32_HAVE_TIM7
+ select STM32_HAVE_TIM12
+ select STM32_HAVE_TIM13
+ select STM32_HAVE_TIM14
+ select STM32_HAVE_TIM15
+ select STM32_HAVE_TIM16
+ select STM32_HAVE_TIM17
config STM32_CONNECTIVITYLINE
bool
default n
select STM32_HAVE_OTGFS
+ select STM32_HAVE_USART3
+ select STM32_HAVE_USART4
+ select STM32_HAVE_USART5
+ select STM32_HAVE_TIM1
+ select STM32_HAVE_TIM5
+ select STM32_HAVE_TIM6
+ select STM32_HAVE_TIM7
+ select STM32_HAVE_TIM8
config STM32_PERFORMANCELINE
bool
default n
select STM32_HAVE_USBDEV
+ select STM32_HAVE_USART3
+ select STM32_HAVE_USART4
+ select STM32_HAVE_USART5
+ select STM32_HAVE_TIM1
+ select STM32_HAVE_TIM5
+ select STM32_HAVE_TIM6
+ select STM32_HAVE_TIM7
+ select STM32_HAVE_TIM8
config STM32_HIGHDENSITY
bool
default n
select STM32_HAVE_FSMC
+ select STM32_HAVE_USART3
+ select STM32_HAVE_USART4
+ select STM32_HAVE_USART5
+ select STM32_HAVE_TIM1
+ select STM32_HAVE_TIM5
+ select STM32_HAVE_TIM6
+ select STM32_HAVE_TIM7
+ select STM32_HAVE_TIM8
config STM32_MEDIUMDENSITY
bool
default n
+ select STM32_HAVE_USART3
+ select STM32_HAVE_USART4
+ select STM32_HAVE_USART5
+ select STM32_HAVE_TIM1
+ select STM32_HAVE_TIM5
+ select STM32_HAVE_TIM6
+ select STM32_HAVE_TIM7
+ select STM32_HAVE_TIM8
config STM32_LOWDENSITY
bool
default n
+ select STM32_HAVE_USART3
+ select STM32_HAVE_USART4
+ select STM32_HAVE_USART5
+ select STM32_HAVE_TIM1
+ select STM32_HAVE_TIM5
+ select STM32_HAVE_TIM6
+ select STM32_HAVE_TIM7
+ select STM32_HAVE_TIM8
config STM32_STM32F20XX
bool
@@ -607,12 +675,34 @@ config STM32_STM32F20XX
select STM32_HAVE_OTGFS
select STM32_HAVE_FSMC
select STM32_HAVE_CCM
+ select STM32_HAVE_USART3
+ select STM32_HAVE_USART4
+ select STM32_HAVE_USART5
+ select STM32_HAVE_USART6
+ select STM32_HAVE_TIM1
+ select STM32_HAVE_TIM5
+ select STM32_HAVE_TIM6
+ select STM32_HAVE_TIM7
+ select STM32_HAVE_TIM8
+ select STM32_HAVE_TIM9
+ select STM32_HAVE_TIM10
+ select STM32_HAVE_TIM11
+ select STM32_HAVE_TIM12
+ select STM32_HAVE_TIM13
+ select STM32_HAVE_TIM14
config STM32_STM32F30XX
bool
default n
select STM32_HAVE_USBDEV
select STM32_HAVE_CCM
+ select STM32_HAVE_TIM1
+ select STM32_HAVE_TIM6
+ select STM32_HAVE_TIM7
+ select STM32_HAVE_TIM8
+ select STM32_HAVE_TIM15
+ select STM32_HAVE_TIM16
+ select STM32_HAVE_TIM17
config STM32_STM32F40XX
bool
@@ -622,18 +712,54 @@ config STM32_STM32F40XX
config STM32_STM32F401
bool
default n
+ select STM32_HAVE_USART6
+ select STM32_HAVE_TIM1
+ select STM32_HAVE_TIM5
+ select STM32_HAVE_TIM9
+ select STM32_HAVE_TIM10
+ select STM32_HAVE_TIM11
config STM32_STM32F405
bool
default n
select STM32_HAVE_FSMC
select STM32_HAVE_CCM
+ select STM32_HAVE_USART3
+ select STM32_HAVE_USART4
+ select STM32_HAVE_USART5
+ select STM32_HAVE_USART6
+ select STM32_HAVE_TIM1
+ select STM32_HAVE_TIM5
+ select STM32_HAVE_TIM6
+ select STM32_HAVE_TIM7
+ select STM32_HAVE_TIM8
+ select STM32_HAVE_TIM9
+ select STM32_HAVE_TIM10
+ select STM32_HAVE_TIM11
+ select STM32_HAVE_TIM12
+ select STM32_HAVE_TIM13
+ select STM32_HAVE_TIM14
config STM32_STM32F407
bool
default n
select STM32_HAVE_FSMC
select STM32_HAVE_CCM
+ select STM32_HAVE_USART3
+ select STM32_HAVE_USART4
+ select STM32_HAVE_USART5
+ select STM32_HAVE_USART6
+ select STM32_HAVE_TIM1
+ select STM32_HAVE_TIM5
+ select STM32_HAVE_TIM6
+ select STM32_HAVE_TIM7
+ select STM32_HAVE_TIM8
+ select STM32_HAVE_TIM9
+ select STM32_HAVE_TIM10
+ select STM32_HAVE_TIM11
+ select STM32_HAVE_TIM12
+ select STM32_HAVE_TIM13
+ select STM32_HAVE_TIM14
# This is really 427/437, but we treat the two the same.
config STM32_STM32F427
@@ -641,6 +767,23 @@ config STM32_STM32F427
default n
select STM32_HAVE_FSMC
select STM32_HAVE_CCM
+ select STM32_HAVE_USART3
+ select STM32_HAVE_USART4
+ select STM32_HAVE_USART5
+ select STM32_HAVE_USART6
+ select STM32_HAVE_USART7
+ select STM32_HAVE_USART8
+ select STM32_HAVE_TIM1
+ select STM32_HAVE_TIM5
+ select STM32_HAVE_TIM6
+ select STM32_HAVE_TIM7
+ select STM32_HAVE_TIM8
+ select STM32_HAVE_TIM9
+ select STM32_HAVE_TIM10
+ select STM32_HAVE_TIM11
+ select STM32_HAVE_TIM12
+ select STM32_HAVE_TIM13
+ select STM32_HAVE_TIM14
# This is really 429/439, but we treat the two the same.
config STM32_STM32F429
@@ -648,6 +791,22 @@ config STM32_STM32F429
default n
select STM32_HAVE_FSMC
select STM32_HAVE_CCM
+ select STM32_HAVE_USART3
+ select STM32_HAVE_USART4
+ select STM32_HAVE_USART5
+ select STM32_HAVE_USART6
+ select STM32_HAVE_USART7
+ select STM32_HAVE_USART8
+ select STM32_HAVE_TIM1
+ select STM32_HAVE_TIM6
+ select STM32_HAVE_TIM7
+ select STM32_HAVE_TIM8
+ select STM32_HAVE_TIM9
+ select STM32_HAVE_TIM10
+ select STM32_HAVE_TIM11
+ select STM32_HAVE_TIM12
+ select STM32_HAVE_TIM13
+ select STM32_HAVE_TIM14
config STM32_DFU
bool "DFU bootloader"
@@ -659,6 +818,13 @@ config STM32_DFU
menu "STM32 Peripheral Support"
+# These "hidden" settings determine is a peripheral option is available for the
+# selection MCU
+
+config STM32_HAVE_CCM
+ bool
+ default n
+
config STM32_HAVE_USBDEV
bool
default n
@@ -671,6 +837,88 @@ config STM32_HAVE_FSMC
bool
default n
+config STM32_HAVE_USART3
+ bool
+ default n
+
+config STM32_HAVE_USART4
+ bool
+ default n
+
+config STM32_HAVE_USART5
+ bool
+ default n
+
+config STM32_HAVE_USART6
+ bool
+ default n
+
+config STM32_HAVE_USART7
+ bool
+ default n
+
+config STM32_HAVE_USART8
+ bool
+ default n
+
+config STM32_HAVE_TIM1
+ bool
+ default n
+
+config STM32_HAVE_TIM5
+ bool
+ default n
+
+config STM32_HAVE_TIM6
+ bool
+ default n
+
+config STM32_HAVE_TIM7
+ bool
+ default n
+
+config STM32_HAVE_TIM8
+ bool
+ default n
+
+config STM32_HAVE_TIM9
+ bool
+ default n
+
+config STM32_HAVE_TIM10
+ bool
+ default n
+
+config STM32_HAVE_TIM11
+ bool
+ default n
+
+config STM32_HAVE_TIM12
+ bool
+ default n
+
+config STM32_HAVE_TIM13
+ bool
+ default n
+
+config STM32_HAVE_TIM14
+ bool
+ default n
+
+config STM32_HAVE_TIM15
+ bool
+ default n
+
+config STM32_HAVE_TIM16
+ bool
+ default n
+
+config STM32_HAVE_TIM17
+ bool
+ default n
+
+# These are the peripheral selections proper
+
config STM32_ADC1
bool "ADC1"
default n
@@ -901,7 +1149,7 @@ config STM32_SYSCFG
config STM32_TIM1
bool "TIM1"
default n
- depends on !STM32_STM32L15XX
+ depends on STM32_HAVE_TIM1
config STM32_TIM2
bool "TIM2"
@@ -918,65 +1166,67 @@ config STM32_TIM4
config STM32_TIM5
bool "TIM5"
default n
- depends on !STM32_STM32F30XX
+ depends on STM32_HAVE_TIM5
config STM32_TIM6
bool "TIM6"
default n
+ depends on STM32_HAVE_TIM6
config STM32_TIM7
bool "TIM7"
default n
+ depends on STM32_HAVE_TIM7
config STM32_TIM8
bool "TIM8"
default n
- depends on !STM32_VALUELINE && !STM32_STM32L15XX
+ depends on STM32_HAVE_TIM8
config STM32_TIM9
bool "TIM9"
default n
- depends on STM32_STM32L15XX || STM32_STM32F20XX || STM32_STM32F40XX
+ depends on STM32_HAVE_TIM9
config STM32_TIM10
bool "TIM10"
default n
- depends on STM32_STM32L15XX || STM32_STM32F20XX || STM32_STM32F40XX
+ depends on STM32_HAVE_TIM10
config STM32_TIM11
bool "TIM11"
default n
- depends on STM32_STM32L15XX || STM32_STM32F20XX || STM32_STM32F40XX
+ depends on STM32_HAVE_TIM11
config STM32_TIM12
bool "TIM12"
default n
- depends on STM32_STM32F20XX || STM32_STM32F40XX || STM32_VALUELINE
+ depends on STM32_HAVE_TIM12
config STM32_TIM13
bool "TIM13"
default n
- depends on STM32_STM32F20XX || STM32_STM32F40XX || STM32_VALUELINE
+ depends on STM32_HAVE_TIM13
config STM32_TIM14
bool "TIM14"
default n
- depends on STM32_STM32F20XX || STM32_STM32F40XX || STM32_VALUELINE
+ depends on STM32_HAVE_TIM14
config STM32_TIM15
bool "TIM15"
default n
- depends on STM32_VALUELINE || STM32_STM32F30XX
+ depends on STM32_HAVE_TIM15
config STM32_TIM16
bool "TIM16"
default n
- depends on STM32_VALUELINE || STM32_STM32F30XX
+ depends on STM32_HAVE_TIM16
config STM32_TIM17
bool "TIM17"
default n
- depends on STM32_VALUELINE || STM32_STM32F30XX
+ depends on STM32_HAVE_TIM17
config STM32_TSC
bool "TSC"
@@ -998,42 +1248,42 @@ config STM32_USART2
config STM32_USART3
bool "USART3"
default n
- depends on !STM32_STM32F30XX
+ depends on STM32_HAVE_USART3
select ARCH_HAVE_USART3
select STM32_USART
config STM32_UART4
bool "UART4"
default n
- depends on !STM32_STM32F30XX &&!STM32_STM32L15XX
+ depends on STM32_HAVE_USART4
select ARCH_HAVE_UART4
select STM32_USART
config STM32_UART5
bool "UART5"
default n
- depends on !STM32_STM32F30XX &&!STM32_STM32L15XX
+ depends on STM32_HAVE_USART5
select ARCH_HAVE_UART5
select STM32_USART
config STM32_USART6
bool "USART6"
default n
- depends on STM32_STM32F20XX || STM32_STM32F40XX
+ depends on STM32_HAVE_USART6
select ARCH_HAVE_USART6
select STM32_USART
config STM32_UART7
bool "UART7"
default n
- depends on STM32_STM32F427 || STM32_STM32F429
+ depends on STM32_HAVE_USART7
select ARCH_HAVE_UART7
select STM32_USART
config STM32_UART8
bool "UART8"
default n
- depends on STM32_STM32F427 || STM32_STM32F429
+ depends on STM32_HAVE_USART7
select ARCH_HAVE_UART8
select STM32_USART
diff --git a/nuttx/configs/nucleo-f401re/README.txt b/nuttx/configs/nucleo-f401re/README.txt
index 4749a5417..8f1219b50 100644
--- a/nuttx/configs/nucleo-f401re/README.txt
+++ b/nuttx/configs/nucleo-f401re/README.txt
@@ -343,13 +343,29 @@ Serial Consoles
USART1
------
+ Pins and Connectors:
+
RXD: PA11 CN10 pin 14
PB7 CN7 pin 21
TXD: PA10 CN9 pin 3, CN10 pin 33
PB6 CN5 pin 3, CN10 pin 17
+ To configure USART1 as the console:
+
+ CONFIG_STM32_USART1=y
+ CONFIG_USART1_ISUART=y
+ CONFIG_USART1_SERIAL_CONSOLE=y
+ CONFIG_USART1_RXBUFSIZE=256
+ CONFIG_USART1_TXBUFSIZE=256
+ CONFIG_USART1_BAUD=115200
+ CONFIG_USART1_BITS=8
+ CONFIG_USART1_PARITY=0
+ CONFIG_USART1_2STOP=0
+
USART2
-----
+ Pins and Connectors:
+
RXD: PA3 CN9 pin 1 (See SB13, 14, 62, 63). CN10 pin 37
PD6
TXD: PA2 CN9 pin 2(See SB13, 14, 62, 63). CN10 pin 35
@@ -359,10 +375,10 @@ Serial Consoles
serial console to use. UART2 is the default in all of these
configurations.
- Nucleo CN9 STM32F401RE
- ----------- ------------
- Pin 1 PA3 USART2_RX
- Pin 2 PA2 USART2_TX
+ Nucleo CN9 STM32F401RE
+ ----------- ------------
+ Pin 1 PA3 USART2_RX
+ Pin 2 PA2 USART2_TX
Solder Bridges. This configuration requires:
@@ -373,18 +389,44 @@ Serial Consoles
- SB13 and SB14 Open: PA2 and PA3 on STM32F103C8T6 (ST-LINK MCU) are
disconnected to PA3 and PA2 on STM32 MCU.
+ To configure USART2 as the console:
+
+ CONFIG_STM32_USART2=y
+ CONFIG_USART2_ISUART=y
+ CONFIG_USART2_SERIAL_CONSOLE=y
+ CONFIG_USART2_RXBUFSIZE=256
+ CONFIG_USART2_TXBUFSIZE=256
+ CONFIG_USART2_BAUD=115200
+ CONFIG_USART2_BITS=8
+ CONFIG_USART2_PARITY=0
+ CONFIG_USART2_2STOP=0
+
USART6
------
- RXD: PC7 CN5 pin2, CN10 pin 19
- PA12 CN10, pin 12
- TXD: PC6 CN10, pin 4
- PA11 CN10, pin 14
+ Pins and Connectors:
+
+ RXD: PC7 CN5 pin2, CN10 pin 19
+ PA12 CN10, pin 12
+ TXD: PC6 CN10, pin 4
+ PA11 CN10, pin 14
+
+ To configure USART6 as the console:
+
+ CONFIG_STM32_USART6=y
+ CONFIG_USART6_ISUART=y
+ CONFIG_USART6_SERIAL_CONSOLE=y
+ CONFIG_USART6_RXBUFSIZE=256
+ CONFIG_USART6_TXBUFSIZE=256
+ CONFIG_USART6_BAUD=115200
+ CONFIG_USART6_BITS=8
+ CONFIG_USART6_PARITY=0
+ CONFIG_USART6_2STOP=0
Virtual COM Port
----------------
- Yet another option is to use UART0 and the USB virtual COM port. This
- option may be more convenient for long term development, but was
- painful to use during board bring-up.
+ Yet another option is to use UART2 and the USB virtual COM port. This
+ option may be more convenient for long term development, but is painful
+ to use during board bring-up.
Solder Bridges. This configuration requires:
@@ -394,7 +436,12 @@ Serial Consoles
- SB13 and SB14 Closed: PA2 and PA3 on STM32F103C8T6 (ST-LINK MCU) are
connected to PA3 and PA2 on STM32 MCU to have USART communication
- between them. Thus SB61,SB62 and SB63 should be OFF.
+ between them. Thus SB61, SB62 and SB63 should be OFF.
+
+ Configuring USART2 is the same as given above.
+
+ Question: What BAUD should be configure to interface with the Virtual
+ COM port? 115200 8N1?
Default
-------
@@ -411,17 +458,8 @@ Shields
Pin 1 PA3 USART2_RX RXD
Pin 2 PA2 USART2_TX TXD
- Support for this shield is enabled by selecting:
-
- CONFIG_STM32_USART2=y
- CONFIG_USART2_ISUART=y
- CONFIG_USART2_SERIAL_CONSOLE=y
- CONFIG_USART2_RXBUFSIZE=256
- CONFIG_USART2_TXBUFSIZE=256
- CONFIG_USART2_BAUD=115200
- CONFIG_USART2_BITS=8
- CONFIG_USART2_PARITY=0
- CONFIG_USART2_2STOP=0
+ Support for this shield is enabled by selecting USART2 and configuring
+ SB13, 14, 62, and 63 as described above under "Serial Consoles"
2. CC3000 Wireless shield