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

This commit is contained in:
Gregory Nutt
2014-05-05 17:59:07 -06:00
parent f06e9dbcaa
commit 88abca5e5e
2 changed files with 329 additions and 41 deletions
+268 -18
View File
@@ -565,10 +565,25 @@ config STM32_STM32L15XX
bool bool
default n default n
select STM32_HAVE_USBDEV 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 config STM32_ENERGYLITE
bool bool
default n 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 config STM32_STM32F10XX
bool bool
@@ -577,29 +592,82 @@ config STM32_STM32F10XX
config STM32_VALUELINE config STM32_VALUELINE
bool bool
default n 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 config STM32_CONNECTIVITYLINE
bool bool
default n default n
select STM32_HAVE_OTGFS 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 config STM32_PERFORMANCELINE
bool bool
default n default n
select STM32_HAVE_USBDEV 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 config STM32_HIGHDENSITY
bool bool
default n default n
select STM32_HAVE_FSMC 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 config STM32_MEDIUMDENSITY
bool bool
default n 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 config STM32_LOWDENSITY
bool bool
default n 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 config STM32_STM32F20XX
bool bool
@@ -607,12 +675,34 @@ config STM32_STM32F20XX
select STM32_HAVE_OTGFS select STM32_HAVE_OTGFS
select STM32_HAVE_FSMC select STM32_HAVE_FSMC
select STM32_HAVE_CCM 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 config STM32_STM32F30XX
bool bool
default n default n
select STM32_HAVE_USBDEV select STM32_HAVE_USBDEV
select STM32_HAVE_CCM 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 config STM32_STM32F40XX
bool bool
@@ -622,18 +712,54 @@ config STM32_STM32F40XX
config STM32_STM32F401 config STM32_STM32F401
bool bool
default n 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 config STM32_STM32F405
bool bool
default n default n
select STM32_HAVE_FSMC select STM32_HAVE_FSMC
select STM32_HAVE_CCM 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 config STM32_STM32F407
bool bool
default n default n
select STM32_HAVE_FSMC select STM32_HAVE_FSMC
select STM32_HAVE_CCM 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. # This is really 427/437, but we treat the two the same.
config STM32_STM32F427 config STM32_STM32F427
@@ -641,6 +767,23 @@ config STM32_STM32F427
default n default n
select STM32_HAVE_FSMC select STM32_HAVE_FSMC
select STM32_HAVE_CCM 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. # This is really 429/439, but we treat the two the same.
config STM32_STM32F429 config STM32_STM32F429
@@ -648,6 +791,22 @@ config STM32_STM32F429
default n default n
select STM32_HAVE_FSMC select STM32_HAVE_FSMC
select STM32_HAVE_CCM 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 config STM32_DFU
bool "DFU bootloader" bool "DFU bootloader"
@@ -659,6 +818,13 @@ config STM32_DFU
menu "STM32 Peripheral Support" 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 config STM32_HAVE_USBDEV
bool bool
default n default n
@@ -671,6 +837,88 @@ config STM32_HAVE_FSMC
bool bool
default n 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 config STM32_ADC1
bool "ADC1" bool "ADC1"
default n default n
@@ -901,7 +1149,7 @@ config STM32_SYSCFG
config STM32_TIM1 config STM32_TIM1
bool "TIM1" bool "TIM1"
default n default n
depends on !STM32_STM32L15XX depends on STM32_HAVE_TIM1
config STM32_TIM2 config STM32_TIM2
bool "TIM2" bool "TIM2"
@@ -918,65 +1166,67 @@ config STM32_TIM4
config STM32_TIM5 config STM32_TIM5
bool "TIM5" bool "TIM5"
default n default n
depends on !STM32_STM32F30XX depends on STM32_HAVE_TIM5
config STM32_TIM6 config STM32_TIM6
bool "TIM6" bool "TIM6"
default n default n
depends on STM32_HAVE_TIM6
config STM32_TIM7 config STM32_TIM7
bool "TIM7" bool "TIM7"
default n default n
depends on STM32_HAVE_TIM7
config STM32_TIM8 config STM32_TIM8
bool "TIM8" bool "TIM8"
default n default n
depends on !STM32_VALUELINE && !STM32_STM32L15XX depends on STM32_HAVE_TIM8
config STM32_TIM9 config STM32_TIM9
bool "TIM9" bool "TIM9"
default n default n
depends on STM32_STM32L15XX || STM32_STM32F20XX || STM32_STM32F40XX depends on STM32_HAVE_TIM9
config STM32_TIM10 config STM32_TIM10
bool "TIM10" bool "TIM10"
default n default n
depends on STM32_STM32L15XX || STM32_STM32F20XX || STM32_STM32F40XX depends on STM32_HAVE_TIM10
config STM32_TIM11 config STM32_TIM11
bool "TIM11" bool "TIM11"
default n default n
depends on STM32_STM32L15XX || STM32_STM32F20XX || STM32_STM32F40XX depends on STM32_HAVE_TIM11
config STM32_TIM12 config STM32_TIM12
bool "TIM12" bool "TIM12"
default n default n
depends on STM32_STM32F20XX || STM32_STM32F40XX || STM32_VALUELINE depends on STM32_HAVE_TIM12
config STM32_TIM13 config STM32_TIM13
bool "TIM13" bool "TIM13"
default n default n
depends on STM32_STM32F20XX || STM32_STM32F40XX || STM32_VALUELINE depends on STM32_HAVE_TIM13
config STM32_TIM14 config STM32_TIM14
bool "TIM14" bool "TIM14"
default n default n
depends on STM32_STM32F20XX || STM32_STM32F40XX || STM32_VALUELINE depends on STM32_HAVE_TIM14
config STM32_TIM15 config STM32_TIM15
bool "TIM15" bool "TIM15"
default n default n
depends on STM32_VALUELINE || STM32_STM32F30XX depends on STM32_HAVE_TIM15
config STM32_TIM16 config STM32_TIM16
bool "TIM16" bool "TIM16"
default n default n
depends on STM32_VALUELINE || STM32_STM32F30XX depends on STM32_HAVE_TIM16
config STM32_TIM17 config STM32_TIM17
bool "TIM17" bool "TIM17"
default n default n
depends on STM32_VALUELINE || STM32_STM32F30XX depends on STM32_HAVE_TIM17
config STM32_TSC config STM32_TSC
bool "TSC" bool "TSC"
@@ -998,42 +1248,42 @@ config STM32_USART2
config STM32_USART3 config STM32_USART3
bool "USART3" bool "USART3"
default n default n
depends on !STM32_STM32F30XX depends on STM32_HAVE_USART3
select ARCH_HAVE_USART3 select ARCH_HAVE_USART3
select STM32_USART select STM32_USART
config STM32_UART4 config STM32_UART4
bool "UART4" bool "UART4"
default n default n
depends on !STM32_STM32F30XX &&!STM32_STM32L15XX depends on STM32_HAVE_USART4
select ARCH_HAVE_UART4 select ARCH_HAVE_UART4
select STM32_USART select STM32_USART
config STM32_UART5 config STM32_UART5
bool "UART5" bool "UART5"
default n default n
depends on !STM32_STM32F30XX &&!STM32_STM32L15XX depends on STM32_HAVE_USART5
select ARCH_HAVE_UART5 select ARCH_HAVE_UART5
select STM32_USART select STM32_USART
config STM32_USART6 config STM32_USART6
bool "USART6" bool "USART6"
default n default n
depends on STM32_STM32F20XX || STM32_STM32F40XX depends on STM32_HAVE_USART6
select ARCH_HAVE_USART6 select ARCH_HAVE_USART6
select STM32_USART select STM32_USART
config STM32_UART7 config STM32_UART7
bool "UART7" bool "UART7"
default n default n
depends on STM32_STM32F427 || STM32_STM32F429 depends on STM32_HAVE_USART7
select ARCH_HAVE_UART7 select ARCH_HAVE_UART7
select STM32_USART select STM32_USART
config STM32_UART8 config STM32_UART8
bool "UART8" bool "UART8"
default n default n
depends on STM32_STM32F427 || STM32_STM32F429 depends on STM32_HAVE_USART7
select ARCH_HAVE_UART8 select ARCH_HAVE_UART8
select STM32_USART select STM32_USART
+61 -23
View File
@@ -343,13 +343,29 @@ Serial Consoles
USART1 USART1
------ ------
Pins and Connectors:
RXD: PA11 CN10 pin 14 RXD: PA11 CN10 pin 14
PB7 CN7 pin 21 PB7 CN7 pin 21
TXD: PA10 CN9 pin 3, CN10 pin 33 TXD: PA10 CN9 pin 3, CN10 pin 33
PB6 CN5 pin 3, CN10 pin 17 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 USART2
----- -----
Pins and Connectors:
RXD: PA3 CN9 pin 1 (See SB13, 14, 62, 63). CN10 pin 37 RXD: PA3 CN9 pin 1 (See SB13, 14, 62, 63). CN10 pin 37
PD6 PD6
TXD: PA2 CN9 pin 2(See SB13, 14, 62, 63). CN10 pin 35 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 serial console to use. UART2 is the default in all of these
configurations. configurations.
Nucleo CN9 STM32F401RE Nucleo CN9 STM32F401RE
----------- ------------ ----------- ------------
Pin 1 PA3 USART2_RX Pin 1 PA3 USART2_RX
Pin 2 PA2 USART2_TX Pin 2 PA2 USART2_TX
Solder Bridges. This configuration requires: Solder Bridges. This configuration requires:
@@ -373,18 +389,44 @@ Serial Consoles
- SB13 and SB14 Open: PA2 and PA3 on STM32F103C8T6 (ST-LINK MCU) are - SB13 and SB14 Open: PA2 and PA3 on STM32F103C8T6 (ST-LINK MCU) are
disconnected to PA3 and PA2 on STM32 MCU. 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 USART6
------ ------
RXD: PC7 CN5 pin2, CN10 pin 19 Pins and Connectors:
PA12 CN10, pin 12
TXD: PC6 CN10, pin 4 RXD: PC7 CN5 pin2, CN10 pin 19
PA11 CN10, pin 14 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 Virtual COM Port
---------------- ----------------
Yet another option is to use UART0 and the USB virtual COM port. This Yet another option is to use UART2 and the USB virtual COM port. This
option may be more convenient for long term development, but was option may be more convenient for long term development, but is painful
painful to use during board bring-up. to use during board bring-up.
Solder Bridges. This configuration requires: Solder Bridges. This configuration requires:
@@ -394,7 +436,12 @@ Serial Consoles
- SB13 and SB14 Closed: PA2 and PA3 on STM32F103C8T6 (ST-LINK MCU) are - 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 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 Default
------- -------
@@ -411,17 +458,8 @@ Shields
Pin 1 PA3 USART2_RX RXD Pin 1 PA3 USART2_RX RXD
Pin 2 PA2 USART2_TX TXD Pin 2 PA2 USART2_TX TXD
Support for this shield is enabled by selecting: Support for this shield is enabled by selecting USART2 and configuring
SB13, 14, 62, and 63 as described above under "Serial Consoles"
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
2. CC3000 Wireless shield 2. CC3000 Wireless shield