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
|
2021-02-03 20:23:17 +03:00
|
|
|
select HAVE_GPIO_I2C if !MACH_STM32F031
|
|
|
|
select HAVE_GPIO_SPI if !MACH_STM32F031
|
|
|
|
select HAVE_GPIO_BITBANGING if !MACH_STM32F031
|
2020-05-25 07:27:18 +03:00
|
|
|
select HAVE_STRICT_TIMING
|
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
|
2020-06-23 17:52:15 +03:00
|
|
|
config MACH_STM32F207
|
|
|
|
bool "STM32F207"
|
|
|
|
select MACH_STM32F2
|
2021-02-01 03:41:53 +03:00
|
|
|
config MACH_STM32F401
|
|
|
|
bool "STM32F401"
|
|
|
|
select MACH_STM32F4
|
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
|
2021-02-19 04:12:32 +03:00
|
|
|
config MACH_STM32F429
|
|
|
|
bool "STM32F429"
|
|
|
|
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
|
2021-02-03 20:23:17 +03:00
|
|
|
config MACH_STM32F031
|
|
|
|
bool "STM32F031"
|
|
|
|
select MACH_STM32F0
|
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
|
2020-06-23 17:52:15 +03:00
|
|
|
config MACH_STM32F2
|
|
|
|
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
|
2020-06-23 17:52:15 +03:00
|
|
|
default y if MACH_STM32F2 || MACH_STM32F4
|
2019-08-12 05:40:28 +03:00
|
|
|
default n
|
2019-07-28 21:40:41 +03:00
|
|
|
|
2019-07-27 23:43:35 +03:00
|
|
|
config MCU
|
|
|
|
string
|
2021-02-03 20:23:17 +03:00
|
|
|
default "stm32f031x6" if MACH_STM32F031
|
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
|
2020-06-23 17:52:15 +03:00
|
|
|
default "stm32f207xx" if MACH_STM32F207
|
2021-02-01 03:41:53 +03:00
|
|
|
default "stm32f401xc" if MACH_STM32F401
|
2019-07-28 21:40:41 +03:00
|
|
|
default "stm32f405xx" if MACH_STM32F405
|
|
|
|
default "stm32f407xx" if MACH_STM32F407
|
2021-02-19 04:12:32 +03:00
|
|
|
default "stm32f429xx" if MACH_STM32F429
|
2019-07-28 21:40:41 +03:00
|
|
|
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
|
2020-02-14 20:10:10 +03:00
|
|
|
default 64000000 if MACH_STM32F103 && STM32_CLOCK_REF_INTERNAL
|
2019-07-28 21:40:41 +03:00
|
|
|
default 72000000 if MACH_STM32F103
|
2020-06-23 17:52:15 +03:00
|
|
|
default 120000000 if MACH_STM32F207
|
2021-02-01 03:41:53 +03:00
|
|
|
default 84000000 if MACH_STM32F401
|
2021-02-19 19:29:12 +03:00
|
|
|
default 168000000 if MACH_STM32F405 || MACH_STM32F407 || MACH_STM32F429
|
|
|
|
default 180000000 if MACH_STM32F446
|
2019-07-27 23:43:35 +03:00
|
|
|
|
|
|
|
config FLASH_SIZE
|
|
|
|
hex
|
2021-02-03 20:23:17 +03:00
|
|
|
default 0x4000 if MACH_STM32F031
|
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
|
2020-03-21 19:24:25 +03:00
|
|
|
default 0x10000 if MACH_STM32F103 # Flash size of stm32f103x8 (64KiB)
|
2021-02-01 03:41:53 +03:00
|
|
|
default 0x40000 if MACH_STM32F2 || MACH_STM32F401
|
2021-02-19 04:12:32 +03:00
|
|
|
default 0x80000 if MACH_STM32F405 || MACH_STM32F407 || MACH_STM32F429 || MACH_STM32F446
|
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
|
2021-02-03 20:23:17 +03:00
|
|
|
default 0x1000 if MACH_STM32F031
|
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
|
2020-03-21 19:24:25 +03:00
|
|
|
default 0x5000 if MACH_STM32F103 # Ram size of stm32f103x8 (20KiB)
|
2020-06-23 17:52:15 +03:00
|
|
|
default 0x20000 if MACH_STM32F207
|
2021-02-01 03:41:53 +03:00
|
|
|
default 0x10000 if MACH_STM32F401
|
2021-02-19 04:12:32 +03:00
|
|
|
default 0x20000 if MACH_STM32F405 || MACH_STM32F407 || MACH_STM32F429 || MACH_STM32F446
|
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
|
2020-06-23 17:52:15 +03:00
|
|
|
prompt "Bootloader offset" if MACH_STM32F207 || MACH_STM32F407 || MACH_STM32F405 || MACH_STM32F103 || MACH_STM32F070
|
2019-07-29 01:26:22 +03:00
|
|
|
config STM32_FLASH_START_2000
|
2019-12-10 05:03:05 +03:00
|
|
|
bool "8KiB bootloader (stm32duino)" if MACH_STM32F103 || MACH_STM32F070
|
2020-06-20 20:30:10 +03:00
|
|
|
config STM32_FLASH_START_5000
|
|
|
|
bool "20KiB bootloader" 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
|
2020-08-30 19:59:28 +03:00
|
|
|
config STM32_FLASH_START_8800
|
|
|
|
bool "34KiB bootloader (Chitu v6 Bootloader)" if MACH_STM32F103
|
2020-03-21 19:24:25 +03:00
|
|
|
config STM32_FLASH_START_10000
|
|
|
|
bool "64KiB bootloader (Alfawise)" if MACH_STM32F103
|
2020-10-12 17:48:33 +03:00
|
|
|
config STM32_FLASH_START_800
|
|
|
|
bool "2KiB bootloader (HID Bootloader)" if MACH_STM32F103
|
|
|
|
|
|
|
|
config STM32_FLASH_START_8000
|
|
|
|
bool "32KiB bootloader (SKR-PRO or TFT35-V3.0)" if MACH_STM32F207 || MACH_STM32F407
|
|
|
|
config STM32_FLASH_START_4000
|
|
|
|
bool "16KiB bootloader (HID Bootloader)" if MACH_STM32F207 || MACH_STM32F405 || MACH_STM32F407
|
|
|
|
|
2019-07-29 01:26:22 +03:00
|
|
|
config STM32_FLASH_START_0000
|
|
|
|
bool "No bootloader"
|
|
|
|
endchoice
|
|
|
|
config FLASH_START
|
|
|
|
hex
|
2020-04-24 21:29:56 +03:00
|
|
|
default 0x8000800 if STM32_FLASH_START_800
|
2019-08-21 20:52:43 +03:00
|
|
|
default 0x8002000 if STM32_FLASH_START_2000
|
2020-04-25 21:20:25 +03:00
|
|
|
default 0x8004000 if STM32_FLASH_START_4000
|
2020-06-20 20:30:10 +03:00
|
|
|
default 0x8005000 if STM32_FLASH_START_5000
|
2019-08-21 20:52:43 +03:00
|
|
|
default 0x8007000 if STM32_FLASH_START_7000
|
|
|
|
default 0x8008000 if STM32_FLASH_START_8000
|
2020-08-30 19:59:28 +03:00
|
|
|
default 0x8008800 if STM32_FLASH_START_8800
|
2020-03-21 19:24:25 +03:00
|
|
|
default 0x8010000 if STM32_FLASH_START_10000
|
2019-08-21 20:52:43 +03:00
|
|
|
default 0x8000000
|
2019-07-29 01:26:22 +03:00
|
|
|
|
2019-12-10 05:03:05 +03:00
|
|
|
config ARMCM_RAM_VECTORTABLE
|
|
|
|
bool
|
|
|
|
default y if MACH_STM32F0 && FLASH_START != 0x8000000
|
|
|
|
default n
|
|
|
|
|
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"
|
2021-02-19 04:12:32 +03:00
|
|
|
config STM32_CLOCK_REF_25M
|
|
|
|
bool "25 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
|
2021-02-19 04:12:32 +03:00
|
|
|
default 25000000 if STM32_CLOCK_REF_25M
|
2019-11-25 22:00:30 +03:00
|
|
|
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
|
2020-06-25 01:59:38 +03:00
|
|
|
|
2019-12-28 14:01:58 +03:00
|
|
|
config CANSERIAL
|
|
|
|
bool "Use CAN for communication (instead of serial)"
|
2020-06-25 01:59:38 +03:00
|
|
|
depends on !USBSERIAL
|
2019-12-28 14:01:58 +03:00
|
|
|
default n
|
2021-01-30 02:49:11 +03:00
|
|
|
config CANBUS_FREQUENCY
|
2019-12-28 14:32:43 +03:00
|
|
|
int "CAN bus speed" if LOW_LEVEL_OPTIONS && CANSERIAL
|
2021-01-30 02:49:11 +03:00
|
|
|
default 500000
|
2020-06-25 01:59:38 +03:00
|
|
|
choice
|
|
|
|
depends on CANSERIAL
|
|
|
|
prompt "CAN pins"
|
|
|
|
config CAN_PINS_PA11_PA12
|
|
|
|
bool "Pins PA11(rx) and PA12(tx)"
|
|
|
|
config CAN_PINS_PB8_PB9
|
|
|
|
bool "Pins PB8(rx) and PB9(tx)"
|
|
|
|
config CAN_PINS_PI8_PH13
|
2021-02-19 04:12:32 +03:00
|
|
|
bool "Pins PI9(rx) and PH13(tx)" if MACH_STM32F4
|
2020-06-25 01:59:38 +03:00
|
|
|
config CAN_PINS_PB5_PB6
|
|
|
|
bool "Pins PB5(rx) and PB6(tx)" if MACH_STM32F4
|
|
|
|
config CAN_PINS_PB12_PB13
|
2021-02-19 04:12:32 +03:00
|
|
|
bool "Pins PB12(rx) and PB13(tx)" if MACH_STM32F4
|
|
|
|
config CAN_PINS_PD0_PD1
|
|
|
|
bool "Pins PD0(rx) and PD1(tx)" if MACH_STM32F4
|
2020-06-25 01:59:38 +03:00
|
|
|
endchoice
|
|
|
|
|
2021-01-18 20:47:59 +03:00
|
|
|
config STM32F0_TRIM
|
|
|
|
int "Internal clock trim override" if LOW_LEVEL_OPTIONS && MACH_STM32F0 && STM32_CLOCK_REF_INTERNAL && !USBSERIAL
|
|
|
|
default 16
|
|
|
|
help
|
|
|
|
Specify the internal clock trim value. Setting this can be
|
|
|
|
useful if the factory default internal clock is not accurate.
|
|
|
|
Default is 16 (use factory default). Each increment increases
|
|
|
|
the clock rate by ~240KHz.
|
|
|
|
|
2019-12-28 14:01:58 +03:00
|
|
|
config STM32F042_PIN_SWAP
|
|
|
|
bool "Use PA9/PA10 for USB or CAN" if MACH_STM32F042
|
|
|
|
depends on (USBSERIAL || CANSERIAL) && MACH_STM32F042
|
2019-12-28 14:32:43 +03:00
|
|
|
default y if (USBSERIAL || CANSERIAL)
|
2019-10-16 00:45:48 +03:00
|
|
|
default n
|
2020-06-25 01:59:38 +03:00
|
|
|
help
|
|
|
|
Remaps logical pins PA11/PA12 to physical PA9/PA10 on low pincount F042 devices.
|
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"
|
2021-02-03 20:23:17 +03:00
|
|
|
config STM32_SERIAL_USART1_ALT
|
|
|
|
bool "USART1 (on PA15/PA14)" if MACH_STM32F0
|
2019-07-29 05:27:32 +03:00
|
|
|
config STM32_SERIAL_USART2
|
2020-01-01 13:20:50 +03:00
|
|
|
bool "USART2 (on PA3/PA2)"
|
|
|
|
config STM32_SERIAL_USART2_ALT
|
2020-01-23 19:33:11 +03:00
|
|
|
bool "USART2 (on PA15/PA14)" if MACH_STM32F0
|
2019-07-29 05:27:32 +03:00
|
|
|
config STM32_SERIAL_USART3
|
|
|
|
bool "USART3"
|
2019-08-10 03:32:46 +03:00
|
|
|
config STM32_SERIAL_USART3_ALT
|
2021-02-01 03:41:53 +03:00
|
|
|
bool "USART3 (on PD9/PD8)" if MACH_STM32F405 || MACH_STM32F407
|
2019-07-29 05:27:32 +03:00
|
|
|
endchoice
|
|
|
|
config SERIAL_PORT
|
|
|
|
int
|
2020-01-23 19:33:11 +03:00
|
|
|
default 3 if STM32_SERIAL_USART3 || STM32_SERIAL_USART3_ALT
|
|
|
|
default 2 if STM32_SERIAL_USART2 || STM32_SERIAL_USART2_ALT
|
2019-07-29 05:27:32 +03:00
|
|
|
default 1
|
2019-07-24 06:51:31 +03:00
|
|
|
|
|
|
|
endif
|