aboutsummaryrefslogtreecommitdiffstats
path: root/src/stm32/Kconfig
blob: cb0fd5570edda2f4383d75fefc9eda0c2c5f0cdd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
# Kconfig settings for STM32 processors

if MACH_STM32

config STM32_SELECT
    bool
    default y
    select HAVE_GPIO
    select HAVE_GPIO_ADC
    select HAVE_GPIO_SPI
    select HAVE_GPIO_BITBANGING

config BOARD_DIRECTORY
    string
    default "stm32"

choice
    prompt "Processor model"
    config MACH_STM32F103
        bool "STM32F103"
        select MACH_STM32F1
        select HAVE_STM32_USBFS
    config MACH_STM32F405
        bool "STM32F405"
        select MACH_STM32F4
    config MACH_STM32F407
        bool "STM32F407"
        select MACH_STM32F4
    config MACH_STM32F446
        bool "STM32F446"
        select MACH_STM32F4
endchoice

config MACH_STM32F1
    bool
config MACH_STM32F4
    bool
config HAVE_STM32_USBFS
    bool

config MCU
    string
    default "stm32f103xb" if MACH_STM32F103
    default "stm32f405xx" if MACH_STM32F405
    default "stm32f407xx" if MACH_STM32F407
    default "stm32f446xx" if MACH_STM32F446

config CLOCK_FREQ
    int
    default 72000000 if MACH_STM32F103
    default 168000000 if MACH_STM32F405 || MACH_STM32F407
    default 180000000 if MACH_STM32F446

config FLASH_SIZE
    hex
    default 0x10000 if MACH_STM32F103
    default 0x80000 if MACH_STM32F4

config RAM_SIZE
    hex
    default 0x5000 if MACH_STM32F103
    default 0x20000 if MACH_STM32F4

config STACK_SIZE
    int
    default 512

choice
    prompt "Bootloader offset" if MACH_STM32F103
    config STM32_FLASH_START_2000
        bool "8KiB bootloader (stm32duino)"
    config STM32_FLASH_START_7000
        bool "28KiB bootloader"
    config STM32_FLASH_START_0000
        bool "No bootloader"
endchoice
config FLASH_START
    hex
    default 0x2000 if STM32_FLASH_START_2000
    default 0x7000 if STM32_FLASH_START_7000
    default 0x0000

choice
    prompt "Clock Reference" if LOW_LEVEL_OPTIONS
    config STM32_CLOCK_REF_8M
        bool "8Mhz crystal"
    config STM32_CLOCK_REF_INTERNAL
        bool "Internal clock"
endchoice
config CLOCK_REF_8M
    bool
    default n if STM32_CLOCK_REF_INTERNAL
    default y

config USBSERIAL
    bool "Use USB for communication (instead of serial)"
    depends on HAVE_STM32_USBFS
    default y
config SERIAL
    depends on !USBSERIAL
    bool
    default y
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"
endchoice
config SERIAL_PORT
    int
    default 3 if STM32_SERIAL_USART3
    default 2 if STM32_SERIAL_USART2
    default 1

endif