2019-07-29 06:15:54 +03:00
|
|
|
# Kconfig settings for STM32 processors
|
2019-07-24 06:51:31 +03:00
|
|
|
|
2019-07-29 06:15:54 +03:00
|
|
|
if MACH_STM32
|
2019-07-24 06:51:31 +03:00
|
|
|
|
2019-07-29 06:15:54 +03:00
|
|
|
config STM32_SELECT
|
2019-07-24 06:51:31 +03:00
|
|
|
bool
|
|
|
|
default y
|
2019-07-25 21:55:10 +03:00
|
|
|
select HAVE_GPIO
|
2019-11-05 18:08:32 +03:00
|
|
|
select HAVE_GPIO_ADC
|
2019-11-14 06:20:29 +03:00
|
|
|
select HAVE_GPIO_I2C
|
2019-07-27 18:57:14 +03:00
|
|
|
select HAVE_GPIO_SPI
|
|
|
|
select HAVE_GPIO_BITBANGING
|
2019-11-25 08:25:57 +03:00
|
|
|
select HAVE_CHIPID
|
2019-07-24 06:51:31 +03:00
|
|
|
|
|
|
|
config BOARD_DIRECTORY
|
|
|
|
string
|
2019-07-29 06:15:54 +03:00
|
|
|
default "stm32"
|
2019-07-24 06:51:31 +03:00
|
|
|
|
2019-07-27 23:43:35 +03:00
|
|
|
choice
|
|
|
|
prompt "Processor model"
|
2019-07-28 21:40:41 +03:00
|
|
|
config MACH_STM32F103
|
|
|
|
bool "STM32F103"
|
2019-07-29 06:15:54 +03:00
|
|
|
select MACH_STM32F1
|
2019-07-27 23:43:35 +03:00
|
|
|
config MACH_STM32F405
|
|
|
|
bool "STM32F405"
|
2019-07-29 06:15:54 +03:00
|
|
|
select MACH_STM32F4
|
2019-07-27 23:43:35 +03:00
|
|
|
config MACH_STM32F407
|
|
|
|
bool "STM32F407"
|
2019-07-29 06:15:54 +03:00
|
|
|
select MACH_STM32F4
|
2019-07-27 23:43:35 +03:00
|
|
|
config MACH_STM32F446
|
|
|
|
bool "STM32F446"
|
2019-07-29 06:15:54 +03:00
|
|
|
select MACH_STM32F4
|
2019-09-17 04:39:29 +03:00
|
|
|
config MACH_STM32F042
|
|
|
|
bool "STM32F042"
|
|
|
|
select MACH_STM32F0
|
2019-09-16 18:45:36 +03:00
|
|
|
config MACH_STM32F070
|
|
|
|
bool "STM32F070"
|
|
|
|
select MACH_STM32F0
|
2019-07-27 23:43:35 +03:00
|
|
|
endchoice
|
|
|
|
|
2019-09-16 18:45:36 +03:00
|
|
|
config MACH_STM32F0
|
|
|
|
bool
|
2019-07-29 06:15:54 +03:00
|
|
|
config MACH_STM32F1
|
2019-07-28 21:40:41 +03:00
|
|
|
bool
|
2019-07-29 06:15:54 +03:00
|
|
|
config MACH_STM32F4
|
2019-07-28 21:40:41 +03:00
|
|
|
bool
|
2019-07-29 01:26:22 +03:00
|
|
|
config HAVE_STM32_USBFS
|
|
|
|
bool
|
2019-09-16 18:45:36 +03:00
|
|
|
default y if MACH_STM32F103 || MACH_STM32F0
|
2019-08-12 05:40:28 +03:00
|
|
|
default n
|
|
|
|
config HAVE_STM32_USBOTG
|
|
|
|
bool
|
|
|
|
default y if MACH_STM32F4
|
|
|
|
default n
|
2019-07-28 21:40:41 +03:00
|
|
|
|
2019-07-27 23:43:35 +03:00
|
|
|
config MCU
|
|
|
|
string
|
2019-09-17 04:39:29 +03:00
|
|
|
default "stm32f042x6" if MACH_STM32F042
|
2019-09-16 18:45:36 +03:00
|
|
|
default "stm32f070xb" if MACH_STM32F070
|
2019-10-23 22:49:00 +03:00
|
|
|
default "stm32f103xe" if MACH_STM32F103
|
2019-07-28 21:40:41 +03:00
|
|
|
default "stm32f405xx" if MACH_STM32F405
|
|
|
|
default "stm32f407xx" if MACH_STM32F407
|
|
|
|
default "stm32f446xx" if MACH_STM32F446
|
2019-07-27 23:43:35 +03:00
|
|
|
|
2019-07-24 06:51:31 +03:00
|
|
|
config CLOCK_FREQ
|
|
|
|
int
|
2019-09-16 18:45:36 +03:00
|
|
|
default 48000000 if MACH_STM32F0
|
2019-07-28 21:40:41 +03:00
|
|
|
default 72000000 if MACH_STM32F103
|
2019-07-27 23:43:35 +03:00
|
|
|
default 168000000 if MACH_STM32F405 || MACH_STM32F407
|
|
|
|
default 180000000 if MACH_STM32F446
|
|
|
|
|
|
|
|
config FLASH_SIZE
|
|
|
|
hex
|
2019-09-17 04:39:29 +03:00
|
|
|
default 0x8000 if MACH_STM32F042
|
2019-09-16 18:45:36 +03:00
|
|
|
default 0x20000 if MACH_STM32F070
|
2019-07-28 21:40:41 +03:00
|
|
|
default 0x10000 if MACH_STM32F103
|
2019-08-07 06:35:45 +03:00
|
|
|
default 0x80000 if MACH_STM32F4
|
2019-07-27 23:43:35 +03:00
|
|
|
|
2019-08-21 20:52:43 +03:00
|
|
|
config RAM_START
|
|
|
|
hex
|
|
|
|
default 0x20000000
|
|
|
|
|
2019-07-27 23:43:35 +03:00
|
|
|
config RAM_SIZE
|
|
|
|
hex
|
2019-09-17 04:39:29 +03:00
|
|
|
default 0x1800 if MACH_STM32F042
|
2019-09-16 18:45:36 +03:00
|
|
|
default 0x4000 if MACH_STM32F070
|
2019-07-28 21:40:41 +03:00
|
|
|
default 0x5000 if MACH_STM32F103
|
2019-08-07 06:35:45 +03:00
|
|
|
default 0x20000 if MACH_STM32F4
|
2019-07-27 23:43:35 +03:00
|
|
|
|
|
|
|
config STACK_SIZE
|
|
|
|
int
|
|
|
|
default 512
|
2019-07-24 06:51:31 +03:00
|
|
|
|
2019-07-29 01:26:22 +03:00
|
|
|
choice
|
2019-09-18 19:11:52 +03:00
|
|
|
prompt "Bootloader offset" if MACH_STM32F407 || MACH_STM32F103
|
2019-07-29 01:26:22 +03:00
|
|
|
config STM32_FLASH_START_2000
|
2019-08-10 03:37:31 +03:00
|
|
|
bool "8KiB bootloader (stm32duino)" if MACH_STM32F103
|
2019-07-29 01:26:22 +03:00
|
|
|
config STM32_FLASH_START_7000
|
2019-08-10 03:37:31 +03:00
|
|
|
bool "28KiB bootloader" if MACH_STM32F103
|
|
|
|
config STM32_FLASH_START_8000
|
2019-09-18 19:11:52 +03:00
|
|
|
bool "32KiB bootloader (SKR-PRO)" if MACH_STM32F407
|
2019-07-29 01:26:22 +03:00
|
|
|
config STM32_FLASH_START_0000
|
|
|
|
bool "No bootloader"
|
|
|
|
endchoice
|
|
|
|
config FLASH_START
|
|
|
|
hex
|
2019-08-21 20:52:43 +03:00
|
|
|
default 0x8002000 if STM32_FLASH_START_2000
|
|
|
|
default 0x8007000 if STM32_FLASH_START_7000
|
|
|
|
default 0x8008000 if STM32_FLASH_START_8000
|
|
|
|
default 0x8000000
|
2019-07-29 01:26:22 +03:00
|
|
|
|
2019-07-26 06:50:12 +03:00
|
|
|
choice
|
2019-07-29 05:42:41 +03:00
|
|
|
prompt "Clock Reference" if LOW_LEVEL_OPTIONS
|
|
|
|
config STM32_CLOCK_REF_8M
|
2019-12-18 19:13:26 +03:00
|
|
|
bool "8 MHz crystal"
|
2019-11-25 22:00:30 +03:00
|
|
|
config STM32_CLOCK_REF_12M
|
2019-12-18 19:13:26 +03:00
|
|
|
bool "12 MHz crystal"
|
2019-11-25 22:00:30 +03:00
|
|
|
config STM32_CLOCK_REF_16M
|
2019-12-18 19:13:26 +03:00
|
|
|
bool "16 MHz crystal"
|
2019-07-29 05:42:41 +03:00
|
|
|
config STM32_CLOCK_REF_INTERNAL
|
2019-07-26 06:50:12 +03:00
|
|
|
bool "Internal clock"
|
|
|
|
endchoice
|
2019-11-25 22:00:30 +03:00
|
|
|
config CLOCK_REF_FREQ
|
|
|
|
int
|
|
|
|
default 16000000 if STM32_CLOCK_REF_16M
|
|
|
|
default 12000000 if STM32_CLOCK_REF_12M
|
|
|
|
default 1 if STM32_CLOCK_REF_INTERNAL
|
|
|
|
default 8000000
|
2019-07-26 06:50:12 +03:00
|
|
|
|
2019-07-29 01:26:22 +03:00
|
|
|
config USBSERIAL
|
|
|
|
bool "Use USB for communication (instead of serial)"
|
2019-08-12 05:40:28 +03:00
|
|
|
depends on HAVE_STM32_USBFS || HAVE_STM32_USBOTG
|
2019-07-29 01:26:22 +03:00
|
|
|
default y
|
2019-12-28 14:01:58 +03:00
|
|
|
config CANSERIAL
|
|
|
|
bool "Use CAN for communication (instead of serial)"
|
|
|
|
depends on MACH_STM32F042 && !USBSERIAL
|
|
|
|
default n
|
|
|
|
config STM32F042_PIN_SWAP
|
|
|
|
bool "Use PA9/PA10 for USB or CAN" if MACH_STM32F042
|
|
|
|
depends on (USBSERIAL || CANSERIAL) && MACH_STM32F042
|
2019-10-16 00:45:48 +03:00
|
|
|
default n
|
2019-07-24 06:51:31 +03:00
|
|
|
config SERIAL
|
2019-12-28 14:01:58 +03:00
|
|
|
depends on !USBSERIAL && !CANSERIAL
|
2019-07-24 06:51:31 +03:00
|
|
|
bool
|
|
|
|
default y
|
2019-07-29 05:27:32 +03:00
|
|
|
choice
|
|
|
|
depends on SERIAL
|
|
|
|
prompt "Serial Port" if LOW_LEVEL_OPTIONS
|
|
|
|
help
|
|
|
|
Select the serial device to use.
|
|
|
|
config STM32_SERIAL_USART1
|
|
|
|
bool "USART1"
|
|
|
|
config STM32_SERIAL_USART2
|
|
|
|
bool "USART2"
|
|
|
|
config STM32_SERIAL_USART3
|
|
|
|
bool "USART3"
|
2019-08-10 03:32:46 +03:00
|
|
|
config STM32_SERIAL_USART3_ALT
|
|
|
|
bool "USART3 (on PD9/PD8)" if MACH_STM32F4
|
2019-07-29 05:27:32 +03:00
|
|
|
endchoice
|
|
|
|
config SERIAL_PORT
|
|
|
|
int
|
2019-08-10 03:32:46 +03:00
|
|
|
default 103 if STM32_SERIAL_USART3_ALT
|
2019-07-29 05:27:32 +03:00
|
|
|
default 3 if STM32_SERIAL_USART3
|
|
|
|
default 2 if STM32_SERIAL_USART2
|
|
|
|
default 1
|
2019-07-24 06:51:31 +03:00
|
|
|
|
|
|
|
endif
|